aboutsummaryrefslogtreecommitdiffstats
path: root/installer/9/eo/content/setupBootloader.html
diff options
context:
space:
mode:
Diffstat (limited to 'installer/9/eo/content/setupBootloader.html')
-rw-r--r--installer/9/eo/content/setupBootloader.html73
1 files changed, 73 insertions, 0 deletions
diff --git a/installer/9/eo/content/setupBootloader.html b/installer/9/eo/content/setupBootloader.html
new file mode 100644
index 00000000..2e34ae00
--- /dev/null
+++ b/installer/9/eo/content/setupBootloader.html
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+ <meta http-equiv="X-UA-Compatible" content="IE=7"/>
+ <title>Bootloader</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Instalado per DrakX-o"/><link rel="up" href="index.html" title="Instalado per DrakX-o"/><link rel="prev" href="graphicalConfiguration.html" title="Graphical Configuration"/><link rel="next" href="misc-params.html" title="Configuration Summary"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript">
+ //The id for tree cookie
+ var treeCookieId = "treeview-2610";
+ var language = "en";
+ var w = new Object();
+ //Localization
+ txt_filesfound = 'Rezultoj';
+ txt_enter_at_least_1_char = "Vi devas enigi almenaŭ unu karaktron.";
+ txt_browser_not_supported = "JavaScript estas malŝaltita en via navigilo. Bonvolu ŝalti JavaScript por ĝui ĉiujn trajtojn de ĉi tiu retejo.";
+ txt_please_wait = "Bonvolu atendi. Serĉado farata...";
+ txt_results_for = "Rezultoj por:";
+ txt_no_results_for = "";
+ </script><style type="text/css">
+ input {
+ margin-bottom: 5px;
+ margin-top: 2px;
+ }
+
+ .folder {
+ display: block;
+ height: 22px;
+ padding-left: 20px;
+ background: transparent url(../../common/jquery/treeview/images/folder.gif) 0 0px no-repeat;
+ }
+
+ </style><link rel="shortcut icon" href="https://www.mageia.org/g/favicon.png" type="image/x-icon"/><link rel="stylesheet" type="text/css" href="../../common/css/positioning.css"/><link rel="stylesheet" type="text/css" href="../../common/jquery/theme-redmond/jquery-ui-1.8.2.custom.css"/><link rel="stylesheet" type="text/css" href="../../common/jquery/treeview/jquery.treeview.css"/><link rel="stylesheet" type="text/css" href="webhelp-default.css"/><link rel="stylesheet" type="text/css" href="webhelp-custom.css"/><script type="text/javascript" src="../../common/jquery/jquery-1.4.2.min.js"><!----></script><script type="text/javascript" src="../../common/jquery/jquery-ui-1.8.2.custom.min.js"><!----></script><script type="text/javascript" src="../../common/jquery/jquery.cookie.js"><!----></script><script type="text/javascript" src="../../common/jquery/treeview/jquery.treeview.min.js"><!----></script><script type="text/javascript" src="search/htmlFileList.js"><!----></script><script type="text/javascript" src="search/htmlFileInfoList.js"><!----></script><script type="text/javascript" src="nwSearchFnt.js"><!----></script><script type="text/javascript" src="search/stemmers/en_stemmer.js"><!--//make this scalable to other languages as well.--></script><script type="text/javascript" src="search/index-1.js"><!----></script><script type="text/javascript" src="search/index-2.js"><!----></script><script type="text/javascript" src="search/index-3.js"><!----></script></head><body><img xmlns="" src="loupe.svg" alt="ghost" style="display:none;"/><div xmlns="" id="header"><div id="navheader"><!----><table><tr><td style="height: 28px; width: 16px;"><a id="showHideButton" onclick="showHideToc();" class="pointLeft" title="Hide TOC tree">.
+ </a></td><td><img src="../../common/images/highlight-blue.gif" alt="H" height="25px" onclick="toggleHighlight()" id="showHideHighlight" style="cursor:pointer" title="Rezulto-diĝesto"/></td><td><a accesskey="p" href="graphicalConfiguration.html">Antaŭen</a> 
+ |
+ <a accesskey="n" href="misc-params.html">Sekven</a></td></tr></table></div><div id="headerlogo"><img src="https://doc.mageia.org/g/mageia-2013-200p.png" alt="Company Logo"/></div><h1 id="pagetitle">Bootloader<br/> </h1></div><div id="content"><!----><div xml:lang="eo" class="section" title="Bootloader"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="setupBootloader"><!----></a>Bootloader</h2></div></div></div><div class="section" title="Grub2"><div class="titlepage"><div><div><h3 class="title"><a id="d4e970"><!----></a>Grub2</h3></div></div></div><div class="itemizedlist" title="Grub2 on Legacy MBR/GPT systems"><p class="title"><b>Grub2 on Legacy MBR/GPT systems</b></p><ul class="itemizedlist" type="disc"><li class="listitem"><p>GRUB2 (with or without graphical menu) will be used exclusively as the
+bootloader for a Legacy/MBR or Legacy/GPT system.</p></li><li class="listitem"><p>By default, a new bootloader will be written into either the MBR (Master
+Boot Record) of your first hard drive or in the BIOS boot partition.</p></li></ul></div><div class="itemizedlist" title="Grub2-efi on UEFI systems"><p class="title"><b>Grub2-efi on UEFI systems</b></p><ul class="itemizedlist" type="disc"><li class="listitem"><p>GRUB2-efi will be used exclusively as the bootloader for a UEFI system.</p></li><li class="listitem"><p>By default, a new bootloader (Grub2-efi) will be written into the ESP (EFI
+System Partition).</p><p>If there are already UEFI-based operating systems installed on your computer
+(Windows 8 for example), the Mageia installer will detect the existing ESP
+created by Windows and add grub2-efi to it. If no ESP exists, then one will
+be created. Although it is possible to have several ESPs, only one is
+required, whatever the number of operating systems you have.</p></li></ul></div></div><div class="section" title="Bootloader Setup"><div class="titlepage"><div><div><h3 class="title"><a id="d4e985"><!----></a>Bootloader Setup</h3></div></div></div><div class="section" title="Lanĉilaj ĉefaj elektoj"><div class="titlepage"><div><div><h4 class="title"><a id="d4e988"><!----></a>Lanĉilaj ĉefaj elektoj</h4></div></div></div><div class="mediaobject" align="center"><img src="images/dx2-setupBootloader.png" align="middle"/></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="bold"><strong>Bootloader to use</strong></span></p><p>This feature is only available to Legacy MBR/BIOS systems. Users of UEFI
+systems will not see this option here.</p></li><li class="listitem"><p><span class="bold"><strong>Boot device</strong></span></p><p>Don't change this unless you really know what you are doing</p></li><li class="listitem"><p><span class="bold"><strong>Delay before booting the default image</strong></span></p><p>This text box lets you set a delay, in seconds, before the default operating
+system is started up.</p></li><li class="listitem"><p><span class="bold"><strong>Security</strong></span></p><p>This allows you to set a password for the bootloader. This means a username
+and password will be required when booting in order to select a booting
+entry or change settings. This is optional, and most people are not likely
+to have a need for it. The username is <code class="literal">root</code> and the
+password is the one chosen hereafter.</p></li><li class="listitem"><p><span class="bold"><strong>Password</strong></span></p><p>Choose a password for the bootloader (optional)</p></li><li class="listitem"><p><span class="bold"><strong>Password (again)</strong></span></p><p>Retype the password and DrakX will check that it matches with the one set
+above</p></li></ul></div><p><span class="emphasis"><em>Advanced</em></span></p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Enable ACPI</em></span></p><p>ACPI (Advanced Configuration and Power Interface) is a standard for power
+management. It can save energy by stopping unused devices. Deselecting it
+could be useful if, for example, your computer does not support ACPI or if
+you think the ACPI implementation might cause some problems (for instance
+random reboots or system lockups).</p></li><li class="listitem"><p><span class="emphasis"><em>Enable SMP</em></span></p><p>This option enables/disables symmetric multiprocessing for multi-core
+processors</p></li><li class="listitem"><p><span class="emphasis"><em>Enable APIC</em></span></p><p>Enabling this gives the operating system access to the Advanced Programmable
+Interrupt Controller. APIC devices permit more complex priority models, and
+Advanced IRQ (Interrupt Request) management.</p></li><li class="listitem"><p><span class="emphasis"><em>Enable Local APIC</em></span></p><p>Here you can set Local APIC, which manages all external interrupts for a
+specific processor in an SMP system</p></li></ul></div></div><div class="section" title="Bootloader Configuration"><div class="titlepage"><div><div><h4 class="title"><a id="d4e1038"><!----></a>Bootloader Configuration</h4></div></div></div><div class="mediaobject" align="center"><img src="../../en/content/images/dx2-setupBootloader3.png" align="middle"/></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="bold"><strong>Default</strong></span></p><p>The operating system to be started up by default.</p></li><li class="listitem"><p><span class="bold"><strong>Append</strong></span></p><p>This option lets you pass information to the kernel or tell the kernel to
+give you more information as it boots.</p></li><li class="listitem"><p><span class="bold"><strong>Probe foreign OS</strong></span></p><p>If you already have other operating systems installed, Mageia attempts to
+add them to your new Mageia boot menu. If you don't want this behaviour,
+then untick the Probe Foreign OS option.</p></li></ul></div><p><span class="emphasis"><em>Advanced</em></span></p><div class="mediaobject" align="center"><img src="../../en/content/images/dx2-setupBootloader4.png" align="middle"/></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Video mode</em></span></p><p>This sets the screen size and colour depth to be used by the boot menu. If
+you click the down-triangle you will be offered other size and colour depth
+options.</p></li><li class="listitem"><p><span class="emphasis"><em>Do not touch ESP or MBR</em></span></p><p>Select this option if you don't want a bootable Mageia, but would rather
+chain-load it from another OS. You will get a warning that the bootloader is
+missing. Click<span class="emphasis"><em> Ok</em></span> if you are sure you understand the
+implications, and wish to proceed.</p></li></ul></div><div class="mediaobject" align="center"><img src="../../en/content/images/live-setupBootloader5.png" align="middle"/></div></div></div><div class="section" title="Other Options"><div class="titlepage"><div><div><h3 class="title"><a id="d4e1074"><!----></a>Other Options</h3></div></div></div><div class="section" title="Uzi ekzistantan lanĉilon"><div class="titlepage"><div><div><h4 class="title"><a id="d4e1076"><!----></a>Uzi ekzistantan lanĉilon</h4></div></div></div><p>The exact procedure for adding Mageia to an existing bootloader is beyond
+the scope of this documentation. However in most cases it will involve
+running the relevant bootloader installation program, which should detect
+Mageia and automatically add an entry for it in the bootloader menu. See the
+documentation for the relevant operating system.</p></div><div class="section" title="Installing Without a Bootloader"><div class="titlepage"><div><div><h4 class="title"><a id="d4e1079"><!----></a>Installing Without a Bootloader</h4></div></div></div><p>While you can opt to install Mageia without a bootloader (see section 2.1
+Advanced), this is not recommended unless you absolutely know what you are
+doing, as without some form of bootloader your operating system will be
+unable to start.</p></div><div xml:lang="eo" class="section" title="Add or Modify a Boot Menu Entry"><div class="titlepage"><div><div><h4 class="title"><a id="setupBootloaderAddEntry"><!----></a>Add or Modify a Boot Menu Entry</h4></div></div></div><p>To do this you need to manually edit /boot/grub2/custom.cfg or use the
+software <span class="bold"><strong>grub-customizer</strong></span> tool instead
+(available in the Mageia repositories).</p><div class="note" title="Rimarko" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Rimarko</h3><p>For more information, see: <a class="link" href="https://wiki.mageia.org/en/Grub2-efi_and_Mageia" target="_top">https://wiki.mageia.org/en/Grub2-efi_and_Mageia</a></p></div></div></div></div><script xmlns="" type="text/javascript" src="main.js"><!----></script><hr xmlns=""/><div xmlns="" class="copyright">© Mageia</div><div xmlns="" class="license"><a href="index.html#CC_BY-SA">CC BY-SA 3.0</a></div><div id="upload_date">Uploaded on 11/06/2023</div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="graphicalConfiguration.html">Antaŭen</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="misc-params.html">Sekven</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Hejmen</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></div><span id="zz_current-id" style="display: none;" data-id="toc-d4e967"><!----></span><div><div id="leftnavigation"><div id="tabs"><ul><li><a href="#treeDiv"><em>Contents</em></a></li><li><a href="#searchDiv"><em>Search</em></a></li></ul><div id="treeDiv"><img src="../../common/images/loading.gif" alt="loading table of contents..." id="tocLoading" style="display:block;"/><div id="ulTreeDiv" style="display:none"><ul id="tree" class="filetree"><li id="toc-d4e15"><span class="file section"><a href="Select-and-use-ISOs.html">Select and use ISOs</a></span><ul><li id="toc-d4e18"><span class="file section"><a href="Select-and-use-ISOs.html#d4e18">Introduction</a></span></li><li id="toc-d4e40"><span class="file section"><a href="Select-and-use-ISOs.html#d4e40">Media</a></span><ul><li id="toc-d4e42"><span class="file section"><a href="Select-and-use-ISOs.html#d4e42">Definition</a></span></li><li id="toc-d4e47"><span class="file section"><a href="Select-and-use-ISOs.html#d4e47">Classical installation media</a></span><ul><li id="toc-d4e49"><span class="file section"><a href="Select-and-use-ISOs.html#d4e49">Common features</a></span></li></ul></li><li id="toc-d4e67"><span class="file section"><a href="Select-and-use-ISOs.html#d4e67">Live media</a></span><ul><li id="toc-d4e69"><span class="file section"><a href="Select-and-use-ISOs.html#d4e69">Common features</a></span></li><li id="toc-d4e82"><span class="file section"><a href="Select-and-use-ISOs.html#d4e82">Live DVD Plasma</a></span></li><li id="toc-d4e91"><span class="file section"><a href="Select-and-use-ISOs.html#d4e91">Live DVD GNOME</a></span></li><li id="toc-d4e100"><span class="file section"><a href="Select-and-use-ISOs.html#d4e100">Live DVD Xfce</a></span></li></ul></li><li id="toc-d4e109"><span class="file section"><a href="Select-and-use-ISOs.html#d4e109">Net install media</a></span><ul><li id="toc-d4e111"><span class="file section"><a href="Select-and-use-ISOs.html#d4e111">Common features</a></span></li><li id="toc-d4e118"><span class="file section"><a href="Select-and-use-ISOs.html#d4e118">netinstall.iso</a></span></li><li id="toc-d4e123"><span class="file section"><a href="Select-and-use-ISOs.html#d4e123">netinstall-nonfree.iso</a></span></li></ul></li></ul></li><li id="toc-d4e128"><span class="file section"><a href="Select-and-use-ISOs.html#d4e128">Downloading and Checking Media</a></span><ul><li id="toc-d4e130"><span class="file section"><a href="Select-and-use-ISOs.html#d4e130">Downloading</a></span></li><li id="toc-d4e148"><span class="file section"><a href="Select-and-use-ISOs.html#d4e148">Checking the integrity of the downloaded media</a></span></li></ul></li><li id="toc-d4e167"><span class="file section"><a href="Select-and-use-ISOs.html#d4e167">Burn or dump the ISO</a></span><ul><li id="toc-d4e171"><span class="file section"><a href="Select-and-use-ISOs.html#d4e171">Burning the ISO to a CD/DVD</a></span></li><li id="toc-d4e178"><span class="file section"><a href="Select-and-use-ISOs.html#d4e178">Dump the ISO to a USB stick</a></span><ul><li id="toc-d4e186"><span class="file section"><a href="Select-and-use-ISOs.html#d4e186">Using a graphical tool within Mageia</a></span></li><li id="toc-d4e190"><span class="file section"><a href="Select-and-use-ISOs.html#d4e190">Using a graphical tool within Windows</a></span></li><li id="toc-d4e200"><span class="file section"><a href="Select-and-use-ISOs.html#d4e200">Using the Command line within a GNU/Linux system</a></span></li></ul></li></ul></li></ul></li><li id="toc-d4e255"><span class="file section"><a href="installer.html">DrakX, la instalilo de Magejo</a></span><ul><li id="toc-d4e259"><span class="file section"><a href="installer.html#d4e259">La instal-paŝoj</a></span></li><li id="toc-d4e281"><span class="file section"><a href="installer.html#d4e281">Bonveniga instal-ekrano</a></span><ul><li id="toc-d4e285"><span class="file section"><a href="installer.html#d4e285">Legacy (BIOS) Systems</a></span></li><li id="toc-d4e308"><span class="file section"><a href="installer.html#d4e308">UEFI Systems</a></span></li></ul></li><li id="toc-d4e330"><span class="file section"><a href="installer.html#d4e330">Instal-problemoj kaj eblaj solvoj</a></span><ul><li id="toc-d4e332"><span class="file section"><a href="installer.html#d4e332">Sen grafika interfaco</a></span></li><li id="toc-d4e347"><span class="file section"><a href="installer.html#d4e347">Instal-paneoj</a></span></li><li id="toc-d4e351"><span class="file section"><a href="installer.html#d4e351">RAM problem</a></span></li><li id="toc-d4e358"><span class="file section"><a href="installer.html#d4e358">Dynamic partitions</a></span></li></ul></li></ul></li><li id="toc-d4e365"><span class="file section"><a href="selectLanguage.html">Bv. elekti la uzotan lingvon</a></span></li><li id="toc-d4e392"><span class="file section"><a href="acceptLicense.html">Licenco kaj publikig-notoj</a></span><ul><li id="toc-d4e399"><span class="file section"><a href="acceptLicense.html#license">Licenco</a></span></li><li id="toc-d4e413"><span class="file section"><a href="acceptLicense.html#releaseNotes">Publikig-notoj</a></span></li></ul></li><li id="toc-d4e418"><span class="file section"><a href="setupSCSI.html">Konfiguri SCSI</a></span></li><li id="toc-d4e426"><span class="file section"><a href="selectInstallClass.html">Instalado/ĝisdatigo</a></span></li><li id="toc-d4e458"><span class="file section"><a href="selectKeyboard.html">Klavaro</a></span></li><li id="toc-d4e478"><span class="file section"><a href="diskPartitioning.html">Partitioning</a></span><ul><li id="toc-d4e480"><span class="file section"><a href="diskPartitioning.html#doPartitionDisks">Suggested Partitioning</a></span></li><li id="toc-d4e573"><span class="file section"><a href="diskPartitioning.html#ask_mntpoint_s">Elekti surmetingojn</a></span></li><li id="toc-d4e606"><span class="file section"><a href="diskPartitioning.html#takeOverHdConfirm">Confirm hard disk to be formatted</a></span></li><li id="toc-d4e622"><span class="file section"><a href="diskPartitioning.html#diskdrake">Custom Disk Partitioning with DiskDrake</a></span></li><li id="toc-d4e668"><span class="file section"><a href="diskPartitioning.html#formatPartitions">Strukturi subdiskojn</a></span></li></ul></li><li id="toc-d4e687"><span class="file section"><a href="software.html">Software</a></span><ul><li id="toc-d4e689"><span class="file section"><a href="software.html#d4e689">Media Selection</a></span><ul><li id="toc-d4e691"><span class="file section"><a href="software.html#add_supplemental_media">Supplemental Installation Media</a></span></li><li id="toc-d4e710"><span class="file section"><a href="software.html#media_selection">Nonfree Media</a></span></li></ul></li><li id="toc-d4e727"><span class="file section"><a href="software.html#chooseDesktop">Grafika medio</a></span></li><li id="toc-d4e742"><span class="file section"><a href="software.html#choosePackageGroups">Pakaĵaj grupoj</a></span></li><li id="toc-d4e764"><span class="file section"><a href="software.html#minimal-install">Minimuma instalo</a></span></li><li id="toc-d4e791"><span class="file section"><a href="software.html#choosePackagesTree">Elekto de individuaj pakaĵoj</a></span></li></ul></li><li id="toc-d4e800"><span class="file section"><a href="addUser.html">User Management</a></span><ul><li id="toc-d4e808"><span class="file section"><a href="addUser.html#root-password">Kreo de mastrumanta pasvorto (Set administrator (root) password):</a></span></li><li id="toc-d4e816"><span class="file section"><a href="addUser.html#enterUser">Enigo de uzulo (Enter a user)</a></span></li><li id="toc-d4e848"><span class="file section"><a href="addUser.html#addUserAdvanced">User Management (advanced)</a></span></li></ul></li><li id="toc-d4e866"><span class="file section"><a href="graphicalConfiguration.html">Graphical Configuration</a></span><ul><li id="toc-d4e869"><span class="file section"><a href="graphicalConfiguration.html#configureX_chooser">Konfiguri X, grafik-karton kaj monitoron</a></span></li><li id="toc-d4e909"><span class="file section"><a href="graphicalConfiguration.html#configureX_card_list">Choose an X Server (Configure your Graphic Card)</a></span></li><li id="toc-d4e932"><span class="file section"><a href="graphicalConfiguration.html#configureX_monitor">Choosing your Monitor</a></span></li></ul></li><li id="toc-d4e967"><span class="file section"><a href="setupBootloader.html">Bootloader</a></span><ul><li id="toc-d4e970"><span class="file section"><a href="setupBootloader.html#d4e970">Grub2</a></span></li><li id="toc-d4e985"><span class="file section"><a href="setupBootloader.html#d4e985">Bootloader Setup</a></span><ul><li id="toc-d4e988"><span class="file section"><a href="setupBootloader.html#d4e988">Lanĉilaj ĉefaj elektoj</a></span></li><li id="toc-d4e1038"><span class="file section"><a href="setupBootloader.html#d4e1038">Bootloader Configuration</a></span></li></ul></li><li id="toc-d4e1074"><span class="file section"><a href="setupBootloader.html#d4e1074">Other Options</a></span><ul><li id="toc-d4e1076"><span class="file section"><a href="setupBootloader.html#d4e1076">Uzi ekzistantan lanĉilon</a></span></li><li id="toc-d4e1079"><span class="file section"><a href="setupBootloader.html#d4e1079">Installing Without a Bootloader</a></span></li><li id="toc-d4e1082"><span class="file section"><a href="setupBootloader.html#setupBootloaderAddEntry">Add or Modify a Boot Menu Entry</a></span></li></ul></li></ul></li><li id="toc-d4e1090"><span class="file section"><a href="misc-params.html">Configuration Summary</a></span><ul><li id="toc-d4e1107"><span class="file section"><a href="misc-params.html#misc-params-system">Sistemaj parametroj</a></span></li><li id="toc-d4e1138"><span class="file section"><a href="misc-params.html#misc-params-hardware">Aparatar-parametroj</a></span></li><li id="toc-d4e1166"><span class="file section"><a href="misc-params.html#misc-params-network">Retaj parametroj</a></span></li><li id="toc-d4e1182"><span class="file section"><a href="misc-params.html#misc-params-security">Sekureco</a></span></li></ul></li><li id="toc-d4e1201"><span class="file section"><a href="locale.html">Locale</a></span><ul><li id="toc-d4e1203"><span class="file section"><a href="locale.html#configureTimezoneUTC">Konfiguru vian horzonon</a></span></li><li id="toc-d4e1215"><span class="file section"><a href="locale.html#selectCountry">Elektu vian Landon / Regionon</a></span><ul><li id="toc-d4e1231"><span class="file section"><a href="locale.html#inputMethod">Enir-metodo</a></span></li></ul></li></ul></li><li id="toc-d4e1243"><span class="file section"><a href="configureServices.html">Konfiguru viajn Servojn</a></span></li><li id="toc-d4e1256"><span class="file section"><a href="selectMouse.html">Selekti muson</a></span></li><li id="toc-d4e1271"><span class="file section"><a href="soundConfig.html">Sound Configuration</a></span><ul><li id="toc-d4e1287"><span class="file section"><a href="soundConfig.html#soundConfig-Advanced">Progresinta</a></span></li></ul></li><li id="toc-d4e1292"><span class="file section"><a href="securityLevel.html">Sekurec-nivelo</a></span></li><li id="toc-d4e1314"><span class="file section"><a href="firewall.html">Firewall</a></span></li><li id="toc-d4e1339"><span class="file section"><a href="installUpdates.html">Ĝisdatigoj</a></span></li><li id="toc-d4e1356"><span class="file section"><a href="exitInstall.html">Gratulon</a></span></li><li id="toc-d4e1368"><span class="file section"><a href="uninstall-Mageia.html">Uninstalling Mageia</a></span></li></ul></div></div><div id="searchDiv"><div id="search"><form onsubmit="Verifie(ditaSearch_Form);return false" name="ditaSearch_Form" class="searchForm"><fieldset class="searchFieldSet"><legend>Search</legend><center><input id="textToSearch" name="textToSearch" type="text" class="searchText"/> &nbsp; <input onclick="Verifie(ditaSearch_Form)" type="button" class="searchButton" value="Go" id="doSearch"/></center></fieldset></form></div><div id="searchResults"><center/></div></div></div></div></div></body></html>
983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057
/* file intrinsics for S-Lang */
/* Copyright (c) 1992, 1999, 2001 John E. Davis
 * This file is part of the S-Lang library.
 *
 * You may distribute under the terms of either the GNU General Public
 * License or the Perl Artistic License.
 */

#include "slinclud.h"

#if defined(__unix__) || (defined (__os2__) && defined (__EMX__))
# include <sys/types.h>
#endif

#ifdef HAVE_IO_H
# include <io.h>		       /* for chmod */
#endif

#if defined(__BORLANDC__)
# include <process.h>
# include <dos.h>
#endif

#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#ifdef HAVE_SYS_FCNTL_H
# include <sys/fcntl.h>
#endif

#ifdef __unix__
# include <sys/file.h>
#endif

#if defined(__BORLANDC__)
# include <dir.h>
#endif

#if defined(_MSC_VER)
# include <io.h>
#endif

#if defined(__DECC) && defined(VMS)
# include <unixio.h>
# include <unixlib.h>
#endif

#ifdef VMS
# include <stat.h>
#else
# include <sys/stat.h>
#endif

#if defined(VMS)
# define USE_LISTDIR_INTRINSIC	0
#else
# define USE_LISTDIR_INTRINSIC	1
#endif

#if USE_LISTDIR_INTRINSIC

#if defined(__WIN32__)
# include <windows.h>
#else
# if defined(__OS2__) && defined(__IBMC__)
#  define INCL_DOS
#  define INCL_ERRORS
#  include <os2.h>
#  include <direct.h>
#  include <ctype.h>
# else
#  ifdef HAVE_DIRENT_H
#   include <dirent.h>
#  else
#   ifdef HAVE_DIRECT_H
#    include <direct.h>
#   else
#    define dirent direct
#    define NEED_D_NAMLEN
#    if HAVE_SYS_NDIR_H
#     include <sys/ndir.h>
#    endif
#    if HAVE_SYS_DIR_H
#     include <sys/dir.h>
#    endif
#    if HAVE_NDIR_H
#     include <ndir.h>
#    endif
#   endif
#  endif
# endif
#endif

#endif				       /* USE_LISTDIR_INTRINSIC */

#include <errno.h>

#include "slang.h"
#include "_slang.h"

static int push_stat_struct (struct stat *st, int opt_attrs)
{
   char *field_names [12];
   unsigned char field_types[12];
   VOID_STAR field_values [12];
   int int_values [12];
   unsigned int i;

   field_names [0] = "st_dev"; int_values [0] = (int) st->st_dev;
   field_names [1] = "st_ino"; int_values [1] = (int) st->st_ino;
   field_names [2] = "st_mode"; int_values [2] = (int) st->st_mode;
   field_names [3] = "st_nlink"; int_values [3] = (int) st->st_nlink;
   field_names [4] = "st_uid"; int_values [4] = (int) st->st_uid;
   field_names [5] = "st_gid"; int_values [5] = (int) st->st_gid;
   field_names [6] = "st_rdev"; int_values [6] = (int) st->st_rdev;
   field_names [7] = "st_size"; int_values [7] = (int) st->st_size;
   field_names [8] = "st_atime"; int_values [8] = (int) st->st_atime;
   field_names [9] = "st_mtime"; int_values [9] = (int) st->st_mtime;
   field_names [10] = "st_ctime"; int_values [10] = (int) st->st_ctime;

   field_names [11] = "st_opt_attrs"; int_values[11] = opt_attrs;

   for (i = 0; i < 12; i++)
     {
	field_types [i] = SLANG_INT_TYPE;
	field_values [i] = (VOID_STAR) (int_values + i);
     }

   return SLstruct_create_struct (12, field_names, field_types, field_values);
}

static void stat_cmd (char *file)
{
   struct stat st;
   int status;
   int opt_attrs;

   status = stat (file, &st);

#if defined(__MSDOS__) || defined(__WIN32__)
   if (status == -1)
     {
	unsigned int len = strlen (file);
	if (len && ((file[len-1] == '\\') || (file[len-1] == '/')))
	  {
	     file = SLmake_nstring (file, len-1);
	     if (file == NULL)
	       return;

	     status = stat (file, &st);
	     SLfree (file);
	  }
     }
#endif
   if (status == -1)
     {
	_SLerrno_errno = errno;
	SLang_push_null ();
	return;
     }

#ifdef __WIN32__
   opt_attrs = GetFileAttributes (file);
#else
   opt_attrs = 0;
#endif

   push_stat_struct (&st, opt_attrs);
}

static void lstat_cmd (char *file)
{
#ifdef HAVE_LSTAT
   struct stat st;
   int opt_attrs;

   if (-1 == lstat (file, &st))
     {
	_SLerrno_errno = errno;
	SLang_push_null ();
	return;
     }

#ifdef __WIN32__
   opt_attrs = GetFileAttributes (file);
#else
   opt_attrs = 0;
#endif
   
   push_stat_struct (&st, opt_attrs);
#else
   stat_cmd (file);
#endif
}

/* Well, it appears that on some systems, these are not defined.  Here I
 * provide them.  These are derived from the Linux stat.h file.
 */

#ifdef __os2__
# ifdef __IBMC__
/* IBM VA3 doesn't declare S_IFMT */
#  define	S_IFMT	(S_IFDIR | S_IFCHR | S_IFREG)
# endif
#endif

#ifndef S_ISLNK
# ifdef S_IFLNK
#   define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
# else
#   define S_ISLNK(m) 0
# endif
#endif

#ifndef S_ISREG
# ifdef S_IFREG
#   define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
# else
#   define S_ISREG(m) 0
# endif
#endif

#ifndef S_ISDIR
# ifdef S_IFDIR
#   define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# else
#   define S_ISDIR(m) 0
# endif
#endif

#ifndef S_ISCHR
# ifdef S_IFCHR
#   define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
# else
#   define S_ISCHR(m) 0
# endif
#endif

#ifndef S_ISBLK
# ifdef S_IFBLK
#   define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
# else
#   define S_ISBLK(m) 0
# endif
#endif

#ifndef S_ISFIFO
# ifdef S_IFIFO
#   define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
# else
#   define S_ISFIFO(m) 0
# endif
#endif

#ifndef S_ISSOCK
# ifdef S_IFSOCK
#   define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
# else
#   define S_ISSOCK(m) 0
# endif
#endif

static char stat_is_cmd (char *what, int *mode_ptr)
{
   int ret;
   int st_mode = *mode_ptr;

   if (!strcmp (what, "sock")) ret = S_ISSOCK(st_mode);
   else if (!strcmp (what, "fifo")) ret = S_ISFIFO(st_mode);
   else if (!strcmp (what, "blk")) ret = S_ISBLK(st_mode);
   else if (!strcmp (what, "chr")) ret = S_ISCHR(st_mode);
   else if (!strcmp (what, "dir")) ret = S_ISDIR(st_mode);
   else if (!strcmp (what, "reg")) ret = S_ISREG(st_mode);
   else if (!strcmp (what, "lnk")) ret = S_ISLNK(st_mode);
   else
     {
	SLang_verror (SL_INVALID_PARM, "stat_is: Unrecognized type: %s", what);
	return -1;
     }

   return (char) (ret != 0);
}

#ifdef HAVE_READLINK
static void readlink_cmd (char *s)
{
   char buf[2048];
   int n;

   n = readlink (s, buf, sizeof (buf)-1);
   if (n == -1)
     {
	_SLerrno_errno = errno;
	s = NULL;
     }
   else
     {
	buf[n] = 0;
	s = buf;
     }

   (void) SLang_push_string (s);
}
#endif

static int chmod_cmd (char *file, int *mode)
{
   if (-1 == chmod(file, (mode_t) *mode))
     {
	_SLerrno_errno = errno;
	return -1;
     }
   return 0;
}

#ifdef HAVE_CHOWN
static int chown_cmd (char *file, int *owner, int *group)
{
   int ret;

   if (-1 == (ret = chown(file, (uid_t) *owner, (gid_t) *group)))
     _SLerrno_errno = errno;
   return ret;
}
#endif

/* add trailing slash to dir */
static void fixup_dir (char *dir)
{
#ifndef VMS
   int n;

   if ((n = strlen(dir)) > 1)
     {
	n--;
#if defined(IBMPC_SYSTEM)
      if ( dir[n] != '/' && dir[n] != '\\' )
      	strcat(dir, "\\" );
#else
      if (dir[n] != '/' )
      	strcat(dir, "/" );
#endif
     }
#endif /* !VMS */
}

static void slget_cwd (void)
{
   char cwd[1024];
   char *p;

#ifndef HAVE_GETCWD
   p = getwd (cwd);
#else
# if defined (__EMX__)
   p = _getcwd2(cwd, 1022);	       /* includes drive specifier */
# else
   p = getcwd(cwd, 1022);	       /* djggp includes drive specifier */
# endif
#endif

   if (p == NULL)
     {
	_SLerrno_errno = errno;
	SLang_push_null ();
	return;
     }

#ifndef VMS
#ifdef __GO32__
   /* You never know about djgpp since it favors unix */
     {
	char ch;
	p = cwd;
	while ((ch = *p) != 0)
	  {
	     if (ch == '/') *p = '\\';
	     p++;
	  }
     }
#endif
   fixup_dir (cwd);
#endif
   SLang_push_string (cwd);
}

static int chdir_cmd (char *s)
{
   int ret;

   while (-1 == (ret = chdir (s)))
     {
#ifdef EINTR
	if (errno == EINTR)
	  continue;
#endif
	_SLerrno_errno = errno;
	break;
     }
   return ret;
}

#ifdef VMS
static int remove_cmd (char *);
/* If the file looks like xxx, then change it to xxx.dir.  If
 * it looks like A:[B.xxx] then change it to A:[B]xxx.dir.
 */

static char *vms_convert_dirspec_to_vms_dir (char *str)
{
   char *s;
   char *version;
   unsigned int len;
   char *dot;

   len = strlen (str);

   version = strchr (str, ';');
   if (version == NULL)
     version = str + len;
   /* version points to the version of the input string */

   
   if (NULL == (s = SLmalloc (len + 8)))/* allow extra space to work with */
     return NULL;

   len = (unsigned int) (version - str);
   strncpy (s, str, len);
   s[len] = 0;
   str = s;
   
   /* Lowercase the whole thing */
   while (*s != 0)
     {
	*s = LOWER_CASE(*s);
	s++;
     }

   if ((s > str)
       && (s[-1] != ']'))
     {
	if ((s >= str + 4)
	    && (0 == strcmp (s - 4, ".dir")))
	  s -= 4;
	goto add_dir_version;
     }

   /* Check for one of two possibilities:
    * 
    *     dev:[x]   --> dev:x
    *     dev:[a.x] --> dev:[a]x
    */
   
   if (NULL == (dot = strchr (str, '.')))
     {
	/* First possibility */
	if (NULL == (s = strchr (str, '[')))
	  return str;		       /* let someone else figure this out */
	while (s[1] != ']')
	  {
	     s[0] = s[1];
	     s++;
	  }
	*s = 0;
	goto add_dir_version;
     }
   
   while (NULL != (s = strchr (dot + 1, '.')))
     dot = s;
   
   *dot = ']';
   s = str + (len - 1);
   
   /* Drop */

   add_dir_version:
   strcpy (s, ".dir");
   strcpy (s+4, version);
   return str;
}
#endif

static int rmdir_cmd (char *s)
{
#ifdef VMS
   int status;

   if (NULL == (s = vms_convert_dirspec_to_vms_dir (s)))
     return -1;
   
   status = remove_cmd (s);
   SLfree (s);
   
   return status;

#else
   int ret;

   while (-1 == (ret = rmdir (s)))
     {
#ifdef EINTR
	if (errno == EINTR)
	  continue;
#endif
	_SLerrno_errno = errno;
	break;
     }
   return ret;
#endif
}

static int remove_cmd (char *s)
{
   int ret;
#ifdef VMS
# define REMOVE delete
#else
# ifdef REAL_UNIX_SYSTEM
#  define REMOVE unlink
# else
#  define REMOVE remove
# endif
#endif

   while (-1 == (ret = REMOVE (s)))
     {
#ifdef EINTR
	if (errno == EINTR)
	  continue;
#endif
	_SLerrno_errno = errno;
	break;
     }
   return ret;
}

static int rename_cmd (char *oldpath, char *newpath)
{
   int ret;
   while (-1 == (ret = rename (oldpath, newpath)))
     {
#ifdef EINTR
	if (errno == EINTR)
	  continue;
#endif
	_SLerrno_errno = errno;
	break;
     }
   return ret;
}

static int mkdir_cmd (char *s, int *mode_ptr)
{
   int ret;

   (void) mode_ptr;
   errno = 0;

#if defined (__MSDOS__) && !defined(__GO32__)
# define MKDIR(x,y) mkdir(x)
#else
# if defined (__os2__) && !defined (__EMX__)
#  define MKDIR(x,y) mkdir(x)
# else
#  if defined (__WIN32__) && !defined (__CYGWIN32__)
#   define MKDIR(x,y) mkdir(x)
#  else
#   define MKDIR mkdir
#  endif
# endif
#endif

   while (-1 == (ret = MKDIR(s, *mode_ptr)))
     {
#ifdef EINTR
	if (errno == EINTR)
	  continue;
#endif
	_SLerrno_errno = errno;
	break;
     }
   return ret;
}

#ifdef HAVE_MKFIFO
static int mkfifo_cmd (char *path, int *mode)
{
   if (-1 == mkfifo (path, *mode))
     {
	_SLerrno_errno = errno;
	return -1;
     }
   return 0;
}
#endif

#if USE_LISTDIR_INTRINSIC

static void free_dir_list (char **list, unsigned int num)
{
   unsigned int i;

   if (list == NULL)
     return;

   for (i = 0; i < num; i++)
     SLang_free_slstring (list[i]);
   SLfree ((char *) list);
}

#if defined(__WIN32__) || defined(__os2__) && defined(__IBMC__)
static int build_dirlist (char *file, char *opt, char ***listp, unsigned int *nump, unsigned int *maxnum)
{
# ifdef __WIN32__
   DWORD status;
   HANDLE h;
   WIN32_FIND_DATA fd;
# else
   APIRET rc;
   FILESTATUS3 status;
   HDIR h;
   FILEFINDBUF3 fd;
   ULONG cFileNames;
# endif
   char *pat;
   unsigned int len;
   char **list;
   unsigned int num;
   unsigned int max_num;
   int hok;

   /* If an option is present, assume ok to list hidden files.  Later
    * I will formalize this.
    */
   hok = (opt != NULL);

# ifdef __WIN32__
   status = GetFileAttributes (file);
# else
   rc = DosQueryPathInfo(file, FIL_STANDARD, &status, sizeof(FILESTATUS3));
# endif


# ifdef __WIN32__
   if (status == (DWORD)-1)
     {
	_SLerrno_errno = ENOENT;
	return -1;
     }
   if (0 == (status & FILE_ATTRIBUTE_DIRECTORY))
     {
	_SLerrno_errno = ENOTDIR;
	return -1;
     }
# else
   if ((rc != 0) || (status.attrFile & FILE_DIRECTORY) == 0)
     {
	/* ENOTDIR isn't defined in VA3. */
	_SLerrno_errno = ENOENT;
	return -1;
     }
# endif

   len = strlen (file);
   pat = SLmalloc (len + 3);
   if (pat == NULL)
     return -1;

   strcpy (pat, file);
   file = pat;
   while (*file != 0)
     {
	if (*file == '/') *file = '\\';
	file++;
     }

   if (len && (pat[len-1] != '\\'))
     {
	pat[len] = '\\';
	len++;
     }
   pat[len++] = '*';
   pat[len] = 0;

   num = 0;
   max_num = 50;
   list = (char **)SLmalloc (max_num * sizeof(char *));
   if (list == NULL)
     {
	SLfree (pat);
	return -1;
     }

# ifdef __WIN32__
   h = FindFirstFile(pat, &fd);
   if (h == INVALID_HANDLE_VALUE)
     {
	if (ERROR_NO_MORE_FILES != GetLastError())
	  {
	     SLfree (pat);
	     SLfree ((char *)list);
	     return -1;
	  }
     }
# else
   h = HDIR_CREATE;
   cFileNames = 1;
   rc = DosFindFirst(pat, &h, FILE_READONLY | FILE_DIRECTORY |
		     FILE_ARCHIVED, &fd, sizeof(fd), &cFileNames, FIL_STANDARD);
   if (rc != 0)
     {
	if (rc != ERROR_NO_MORE_FILES)
	  {
	     SLfree (pat);
	     SLfree ((char *)list);
	     return -1;
	  }
     }
# endif   
   else while (1)
     {
	/* Do not include hidden files in the list.  Also, do not
	 * include "." and ".." entries.
	 */
#ifdef __WIN32__
	file = fd.cFileName;
#else
	file = fd.achName;
#endif
	if (
#ifdef __WIN32__
	    (hok || (0 == (fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)))
#else
	    (hok || (0 == (fd.attrFile & FILE_HIDDEN)))
#endif
	    && ((*file != '.')
		|| ((0 != strcmp (file, "."))
		    && (0 != strcmp (file, "..")))))
	  {
	     if (num == max_num)
	       {
		  char **new_list;

		  max_num += 100;
		  new_list = (char **)SLrealloc ((char *)list, max_num * sizeof (char *));
		  if (new_list == NULL)
		    goto return_error;

		  list = new_list;
	       }

	     file = SLang_create_slstring (file);
	     if (file == NULL)
	       goto return_error;

	     list[num] = file;
	     num++;
	  }

#ifdef __WIN32__
	if (FALSE == FindNextFile(h, &fd))
	  {
	     if (ERROR_NO_MORE_FILES == GetLastError())
	       {
		  FindClose (h);
		  break;
	       }

	     _SLerrno_errno = errno;
	     FindClose (h);
	     goto return_error;
	  }
#else
        cFileNames = 1;
        rc = DosFindNext(h, &fd, sizeof(fd), &cFileNames);
        if (rc != 0)
	  {
	     if (rc == ERROR_NO_MORE_FILES)
	       {
		  DosFindClose (h);
		  break;
	       }

	     _SLerrno_errno = errno;
	     DosFindClose (h);
	     goto return_error;
	  }
#endif
     }

   SLfree (pat);
   *maxnum = max_num;
   *nump = num;
   *listp = list;
   return 0;

   return_error:
   free_dir_list (list, num);
   SLfree (pat);
   return -1;
}

#else				       /* NOT __WIN32__ */

static int build_dirlist (char *dir, char *opt, char ***listp, unsigned int *nump, unsigned int *maxnum)
{
   DIR *dp;
   struct dirent *ep;
   unsigned int num_files;
   unsigned int max_num_files;
   char **list;

   (void) opt;

   if (NULL == (dp = opendir (dir)))
     {
	_SLerrno_errno = errno;
	return -1;
     }

   num_files = max_num_files = 0;
   list = NULL;
   while (NULL != (ep = readdir (dp)))
     {
	unsigned int len;
	char *name;

	name = ep->d_name;
#  ifdef NEED_D_NAMLEN
	len = ep->d_namlen;
#  else
	len = strlen (name);
#  endif
	if ((*name == '.') && (len <= 2))
	  {
	     if (len == 1) continue;
	     if (name [1] == '.') continue;
	  }

	if (num_files == max_num_files)
	  {
	     char **new_list;

	     max_num_files += 100;
	     if (NULL == (new_list = (char **) SLrealloc ((char *)list, max_num_files * sizeof(char *))))
	       goto return_error;

	     list = new_list;
	  }

	if (NULL == (list[num_files] = SLang_create_nslstring (name, len)))
	  goto return_error;

	num_files++;
     }

   closedir (dp);
   *nump = num_files;
   *maxnum = max_num_files;
   *listp = list;
   return 0;

   return_error:
   if (dp != NULL)
     closedir (dp);
   free_dir_list (list, num_files);
   return -1;
}
# endif				       /* NOT __WIN32__ */

static void listdir_cmd (char *dir, char *opt)
{
   SLang_Array_Type *at;
   unsigned int num_files;
   unsigned int max_num_files;
   int inum_files;
   char **list;

   if (-1 == build_dirlist (dir, opt, &list, &num_files, &max_num_files))
     {
	SLang_push_null ();
	return;
     }
   /* If max_num_files == 0, then num_files == 0 and list == NULL.  
    * The realloc step below will malloc list for us.
    */
   if (num_files + 1 < max_num_files)
     {
	char **new_list;
	if (NULL == (new_list = (char **) SLrealloc ((char *)list, (num_files + 1)* sizeof(char*))))
	  {
	     free_dir_list (list, num_files);
	     SLang_push_null ();
	     return;
	  }
	list = new_list;
     }

   inum_files = (int) num_files;
   if (NULL == (at = SLang_create_array (SLANG_STRING_TYPE, 0, (VOID_STAR) list, &inum_files, 1)))
     {
	free_dir_list (list, num_files);
	SLang_push_null ();
	return;
     }

   /* Allow the array to free this list if push fails */
   if (-1 == SLang_push_array (at, 1))
     SLang_push_null ();
}

static void listdir_cmd_wrap (void)
{
   char *s, *sopt;

   sopt = NULL;
   switch (SLang_Num_Function_Args)
     {
      case 2:
	if (-1 == SLang_pop_slstring (&sopt))
	  return;
      case 1:
	if (-1 == SLang_pop_slstring (&s))
	  {
	     SLang_free_slstring (sopt);
	     return;
	  }
	break;
      default:
	SLang_verror (SL_INVALID_PARM, "usage: listdir (string, [opt-string]");
	return;
     }

   listdir_cmd (s, sopt);
   SLang_free_slstring (s);
   SLang_free_slstring (sopt);
}

#endif				       /* USE_LISTDIR_INTRINSIC */

#ifdef HAVE_UMASK
static int umask_cmd (int *u)
{
   return umask (*u);
}
#endif

static SLang_Intrin_Fun_Type PosixDir_Name_Table [] =
{
#ifdef HAVE_READLINK
   MAKE_INTRINSIC_S("readlink", readlink_cmd, SLANG_VOID_TYPE),
#endif
   MAKE_INTRINSIC_S("lstat_file", lstat_cmd, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_S("stat_file", stat_cmd, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_SI("stat_is", stat_is_cmd, SLANG_CHAR_TYPE),
#ifdef HAVE_MKFIFO
   MAKE_INTRINSIC_SI("mkfifo", mkfifo_cmd, SLANG_INT_TYPE),
#endif
#ifdef HAVE_CHOWN
   MAKE_INTRINSIC_SII("chown", chown_cmd, SLANG_INT_TYPE),
#endif
   MAKE_INTRINSIC_SI("chmod", chmod_cmd, SLANG_INT_TYPE),
#ifdef HAVE_UMASK
   MAKE_INTRINSIC_I("umask", umask_cmd, SLANG_INT_TYPE),
#endif
   MAKE_INTRINSIC_0("getcwd", slget_cwd, SLANG_VOID_TYPE),
   MAKE_INTRINSIC_SI("mkdir", mkdir_cmd, SLANG_INT_TYPE),
   MAKE_INTRINSIC_S("chdir", chdir_cmd, SLANG_INT_TYPE),
   MAKE_INTRINSIC_S("rmdir", rmdir_cmd, SLANG_INT_TYPE),
   MAKE_INTRINSIC_S("remove", remove_cmd, SLANG_INT_TYPE),
   MAKE_INTRINSIC_SS("rename", rename_cmd, SLANG_INT_TYPE),
#if USE_LISTDIR_INTRINSIC
   MAKE_INTRINSIC("listdir", listdir_cmd_wrap, SLANG_VOID_TYPE, 0),
#endif
   SLANG_END_INTRIN_FUN_TABLE
};

static SLang_IConstant_Type PosixDir_Consts [] =
{
#ifndef S_IRWXU
# define S_IRWXU 00700
#endif
   MAKE_ICONSTANT("S_IRWXU", S_IRWXU),
#ifndef S_IRUSR
# define S_IRUSR 00400
#endif
   MAKE_ICONSTANT("S_IRUSR", S_IRUSR),
#ifndef S_IWUSR
# define S_IWUSR 00200
#endif
   MAKE_ICONSTANT("S_IWUSR", S_IWUSR),
#ifndef S_IXUSR
# define S_IXUSR 00100
#endif
   MAKE_ICONSTANT("S_IXUSR", S_IXUSR),
#ifndef S_IRWXG
# define S_IRWXG 00070
#endif
   MAKE_ICONSTANT("S_IRWXG", S_IRWXG),
#ifndef S_IRGRP
# define S_IRGRP 00040
#endif
   MAKE_ICONSTANT("S_IRGRP", S_IRGRP),
#ifndef S_IWGRP
# define S_IWGRP 00020
#endif
   MAKE_ICONSTANT("S_IWGRP", S_IWGRP),
#ifndef S_IXGRP
# define S_IXGRP 00010
#endif
   MAKE_ICONSTANT("S_IXGRP", S_IXGRP),
#ifndef S_IRWXO
# define S_IRWXO 00007
#endif
   MAKE_ICONSTANT("S_IRWXO", S_IRWXO),
#ifndef S_IROTH
# define S_IROTH 00004
#endif
   MAKE_ICONSTANT("S_IROTH", S_IROTH),
#ifndef S_IWOTH
# define S_IWOTH 00002
#endif
   MAKE_ICONSTANT("S_IWOTH", S_IWOTH),
#ifndef S_IXOTH
# define S_IXOTH 00001
#endif
   MAKE_ICONSTANT("S_IXOTH", S_IXOTH),
#ifdef __WIN32__
   MAKE_ICONSTANT("FILE_ATTRIBUTE_ARCHIVE", FILE_ATTRIBUTE_ARCHIVE),
   MAKE_ICONSTANT("FILE_ATTRIBUTE_COMPRESSED", FILE_ATTRIBUTE_COMPRESSED),
   MAKE_ICONSTANT("FILE_ATTRIBUTE_NORMAL", FILE_ATTRIBUTE_NORMAL),
   MAKE_ICONSTANT("FILE_ATTRIBUTE_DIRECTORY", FILE_ATTRIBUTE_DIRECTORY),
   MAKE_ICONSTANT("FILE_ATTRIBUTE_HIDDEN", FILE_ATTRIBUTE_HIDDEN),
   MAKE_ICONSTANT("FILE_ATTRIBUTE_READONLY", FILE_ATTRIBUTE_READONLY),
   MAKE_ICONSTANT("FILE_ATTRIBUTE_SYSTEM", FILE_ATTRIBUTE_SYSTEM),
   MAKE_ICONSTANT("FILE_ATTRIBUTE_TEMPORARY", FILE_ATTRIBUTE_TEMPORARY),
#endif
   SLANG_END_ICONST_TABLE
};

static int Initialized;

int SLang_init_posix_dir (void)
{
   if (Initialized)
     return 0;

   if ((-1 == SLadd_intrin_fun_table(PosixDir_Name_Table, "__POSIX_DIR__"))
       || (-1 == SLadd_iconstant_table (PosixDir_Consts, NULL))
       || (-1 == _SLerrno_init ()))
     return -1;

   Initialized = 1;

   return 0;
}