  
  [1X3 Functions directly available from the C library[0X
  
  The  following  functions  from  the  C  library  are  made available as [5XGAP[0m
  functions:
  
  [10Xaccept[0m,  [10Xbind[0m,  [10Xchdir[0m,  [10Xchmod[0m,  [10Xchown[0m, [10Xclose[0m, [10Xclosedir[0m, [10Xconnect[0m, [10Xcreat[0m, [10Xdup[0m,
  [10Xdup2[0m,  [10Xexecv[0m,  [10Xexecve[0m,  [10Xexecvp[0m,  [10Xexit[0m,  [10Xfchmod[0m,  [10Xfchown[0m, [10Xfcntl[0m, [10Xfork[0m, [10Xfstat[0m,
  [10Xgethostbyname[0m,   [10Xgethostname[0m,   [10Xgetpid[0m,  [10Xgetppid[0m,  [10Xgetsockname[0m,  [10Xgetsockopt[0m,
  [10Xgettimeofday[0m,  [10Xgmtime[0m,  [10Xkill[0m, [10Xlchown[0m, [10Xlink[0m, [10Xlisten[0m, [10Xlocaltime[0m, [10Xlseek[0m, [10Xlstat[0m,
  [10Xmkdir[0m,  [10Xmkfifo[0m,  [10Xmknod[0m,  [10Xopen[0m, [10Xopendir[0m, [10Xpipe[0m, [10Xread[0m, [10Xreaddir[0m, [10Xreadlink[0m, [10Xrecv[0m,
  [10Xrecvfrom[0m,   [10Xrename[0m,   [10Xrewinddir[0m,   [10Xrmdir[0m,  [10Xseekdir[0m,  [10Xselect[0m,  [10Xsend[0m,  [10Xsendto[0m,
  [10Xsetsockopt[0m, [10Xsocket[0m, [10Xstat[0m, [10Xsymlink[0m, [10Xtelldir[0m, [10Xunlink[0m, [10Xwrite[0m.
  
  Use the [10Xman[0m command in your shell to get information about these functions.
  
  For  each  of  these  functions there is a corresponding [5XGAP[0m global function
  with  the  prefix  [10XIO_[0m  before  its  name. Apart from minor differences (see
  below) they take exactly the same arguments as their C counterparts. Strings
  must  be  specified  as  [5XGAP[0m strings and integers as [5XGAP[0m immediate integers.
  Return values are in general the same as for the C counterparts. However, an
  error  condition  is  indicated  by the value [10Xfail[0m instead of -1, and if the
  result can only be success or failure, [10Xtrue[0m indicates success.
  
  All errors are reported via the [2XLastSystemError[0m ([14XReference: LastSystemError[0m)
  function.
  
  In  the  C  library a lot of integers are defined as macros in header files.
  All  the necessary values for the above functions are bound to their name in
  the global [10XIO[0m record.
  
  [13XWarning:[0m  Existence  of  many  of  these functions and constants is platform
  dependent.  The  compilation  process checks existence and this leads to the
  situation  that  on  the [5XGAP[0m levels the functions and constants are there or
  not.  If  you  want  to  develop  platform  independent  [5XGAP[0m code using this
  package, then you have to check for existence of the functions and constants
  you need.
  
  
  [1X3.1 Differences in arguments - an overview[0X
  
  The  [10Xopen[0m  function  has to be called with three arguments. The version with
  two arguments is not available on the [5XGAP[0m level.
  
  The [10Xread[0m function takes four arguments: [3Xfd[0m is an integer file descriptor, [3Xst[0m
  is  a  [5XGAP[0m  string, [3Xoffset[0m is an offset within this string (zero based), and
  [3Xcount[0m  is  the  maximal number of bytes to read. The data is read and stored
  into  the  string  [3Xst[0m,  starting at position [3Xoffset[0m+1. The string [3Xst[0m is made
  long  enough, such that [3Xcount[0m bytes would fit into it, beginning at position
  [3Xoffset[0m+1. The number of bytes read is returned or [10Xfail[0m in case of an error.
  
  The  [10Xwrite[0m  function  is  similar,  it  also  takes four arguments: [3Xfd[0m is an
  integer file descriptor, [3Xst[0m is a [5XGAP[0m string, [3Xoffset[0m is an offset within this
  string  (zero  based),  and  [3Xcount[0m is the number of bytes to write, starting
  from  position  [3Xoffset[0m+1  in  the  string [3Xst[0m. The number of bytes written is
  returned, or a [10Xfail[0m in case of an error.
  
  The [10Xopendir[0m function only returns [10Xtrue[0m or [10Xfail[0m.
  
  The  [10Xreaddir[0m  function  takes  no  argument. It reads the directory that was
  specified  in  the  last call to [10Xopendir[0m. It just returns a string, which is
  the  name  of  a  file  or  subdirectory  in the corresponding directory. It
  returns  [10Xfalse[0m  after the last file name in the directory or [10Xfail[0m in case of
  an error.
  
  The  [10Xclosedir[0m  function takes no argument. It should be called after [10Xreaddir[0m
  returned [10Xfalse[0m or [10Xfail[0m to avoid excessive use of file descriptors.
  
  The functions [10Xstat[0m, [10Xfstat[0m, and [10Xlstat[0m only take one argument and return a [5XGAP[0m
  record that has the same entries as a [10Xstruct stat[0m.
  
  The  function [10Xsocket[0m can optionally take a string as third argument. In that
  case it automatically calls [10Xgetprotobyname[0m to look up the protocol name.
  
  The  functions  [10Xbind[0m  and  [10Xconnect[0m  take only one string argument as address
  field, because the string already encodes the length.
  
  There   are   two  convenience  functions  [2XIO_make_sockaddr_in[0m  ([14X3.3-1[0m)  and
  [2XIO_MakeIPAddressPort[0m  ([14X4.3-6[0m)  to create such addresses. The first takes two
  arguments  [3Xaddr[0m and [3Xport[0m, where [3Xaddr[0m is a string of length 4, containing the
  4  bytes  of  the  IP  address and [3Xport[0m is a port number as [5XGAP[0m integer. The
  function  [2XIO_MakeIPAddressPort[0m  ([14X4.3-6[0m)  takes  the  same arguments, but the
  first  can  be  a  string  containing  an  IP  address  in dot notation like
  "137.226.152.77" or a hostname to be looked up.
  
  The  [10Xsetsockopt[0m  function  has  no argument [3Xoptlen[0m. The length of the string
  [3Xoptval[0m is taken.
  
  The [10Xselect[0m function works as the function [10XUNIXSelect[0m in the [5XGAP[0m library.
  
  As  of  now, the file locking mechanisms of [10Xfcntl[0m using [10Xstruct flock[0m are not
  yet implemented on the [5XGAP[0m level.
  
  
  [1X3.2 The low-level functions in detail[0X
  
  Nearly  all  of this functions return an integer result in the C library. On
  the  [5XGAP[0m  level this is either returned as a non-negative integer in case of
  success  or  as  [9Xfail[0m  in case of an error (where on the C level -1 would be
  returned).  If  the  integer can only be 0 for "no error" this is changed to
  [9Xtrue[0m on the [5XGAP[0m level.
  
  [1X3.2-1 IO_accept[0m
  
  [2X> IO_accept( [0X[3Xfd, addr[0X[2X ) ____________________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Accepts  an incoming network connection. For details see "[10Xman 2 accept[0m". The
  argument  [3Xaddr[0m can be made with [2XIO_make_sockaddr_in[0m ([14X3.3-1[0m) and contains its
  length such that no third argument is necessary.
  
  [1X3.2-2 IO_bind[0m
  
  [2X> IO_bind( [0X[3Xfd, my_addr[0X[2X ) ___________________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Binds  a  local  address  to  a  socket.  For  details see "[10Xman 2 bind[0m". The
  argument  [3Xmy_addr[0m  can be made with [2XIO_make_sockaddr_in[0m ([14X3.3-1[0m) and contains
  its length such that no third argument is necessary.
  
  [1X3.2-3 IO_chdir[0m
  
  [2X> IO_chdir( [0X[3Xpath[0X[2X ) _________________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Changes the current working directory. For details see "[10Xman 2 chdir[0m".
  
  [1X3.2-4 IO_chmod[0m
  
  [2X> IO_chmod( [0X[3Xpathname, mode[0X[2X ) _______________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Changes the mode of a file. For details see "[10Xman 2 chmod[0m".
  
  [1X3.2-5 IO_chown[0m
  
  [2X> IO_chown( [0X[3Xpath, owner, group[0X[2X ) ___________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Sets owner and/or group of file. For details see "[10Xman 2 chown[0m".
  
  [1X3.2-6 IO_close[0m
  
  [2X> IO_close( [0X[3Xfd[0X[2X ) ___________________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Closes a file descriptor. For details see "[10Xman 2 close[0m".
  
  [1X3.2-7 IO_closedir[0m
  
  [2X> IO_closedir( [0X[3X[0X[2X ) __________________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Closes  a  directory.  For  details  see "[10Xman 3 closedir[0m". Has no arguments,
  because we only have one [10XDIR[0m struct in the C part.
  
  [1X3.2-8 IO_connect[0m
  
  [2X> IO_connect( [0X[3Xfd, serv_addr[0X[2X ) ______________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Connects  to  a remote socket. For details see "[10Xman 2 connect[0m". The argument
  [3Xserv_addr[0m  can  be  made  with  [2XIO_make_sockaddr_in[0m ([14X3.3-1[0m) and contains its
  length such that no third argument is necessary.
  
  [1X3.2-9 IO_creat[0m
  
  [2X> IO_creat( [0X[3Xpathname, mode[0X[2X ) _______________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Creates a new file. For details see "[10Xman 2 creat[0m".
  
  [1X3.2-10 IO_dup[0m
  
  [2X> IO_dup( [0X[3Xoldfd[0X[2X ) __________________________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Duplicates a file descriptor. For details see "[10Xman 2 dup[0m".
  
  [1X3.2-11 IO_dup2[0m
  
  [2X> IO_dup2( [0X[3Xoldfd, newfd[0X[2X ) __________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Duplicates a file descriptor to a new one. For details see "[10Xman 2 dup2[0m".
  
  [1X3.2-12 IO_execv[0m
  
  [2X> IO_execv( [0X[3Xpath, argv[0X[2X ) ___________________________________________[0Xfunction
  [6XReturns:[0X  [9Xfail[0m or does not return
  
  Replaces  the  process  with another process. For details see "[10Xman 3 execv[0m".
  The  argument [3Xargv[0m is a list of strings. The called program does not have to
  be the first argument in this list.
  
  [1X3.2-13 IO_execve[0m
  
  [2X> IO_execve( [0X[3Xpath, argv, envp[0X[2X ) ____________________________________[0Xfunction
  [6XReturns:[0X  [9Xfail[0m or does not return
  
  Replaces  the  process with another process. For details see "[10Xman 3 execve[0m".
  The  arguments  [3Xargv[0m  and [3Xenvp[0m are both lists of strings. The called program
  does  not  have  to be the first argument in [3Xargv[0m. The list [3Xenvp[0m can be made
  with  [2XIO_MakeEnvList[0m  ([14X4.3-8[0m)  from  a  record  acquired from [2XIO_Environment[0m
  ([14X4.3-7[0m) and modified later.
  
  [1X3.2-14 IO_execvp[0m
  
  [2X> IO_execvp( [0X[3Xpath, argv[0X[2X ) __________________________________________[0Xfunction
  [6XReturns:[0X  [9Xfail[0m or does not return
  
  Replaces  the  process with another process. For details see "[10Xman 3 execvp[0m".
  The  argument [3Xargv[0m is a list of strings. The called program does not have to
  be the first argument in this list.
  
  [1X3.2-15 IO_exit[0m
  
  [2X> IO_exit( [0X[3Xstatus[0X[2X ) ________________________________________________[0Xfunction
  
  Stops  process  immediately  with return code [3Xstatus[0m. For details see "[10Xman 2
  exit[0m". The argument [3Xstatus[0m must be an integer. Does not return.
  
  [1X3.2-16 IO_fchmod[0m
  
  [2X> IO_fchmod( [0X[3Xfd, mode[0X[2X ) ____________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Changes mode of an opened file. For details see "[10Xman 2 fchmod[0m".
  
  [1X3.2-17 IO_fchown[0m
  
  [2X> IO_fchown( [0X[3Xfd, owner, group[0X[2X ) ____________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Changes  owner  and/or  group  of  an  opened  file.  For details see "[10Xman 2
  fchown[0m".
  
  [1X3.2-18 IO_fcntl[0m
  
  [2X> IO_fcntl( [0X[3Xfd, cmd, arg[0X[2X ) _________________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Does  various  things  to  control  the  behaviour of a file descriptor. For
  details see "[10Xman 2 fcntl[0m".
  
  [1X3.2-19 IO_fork[0m
  
  [2X> IO_fork( [0X[3X[0X[2X ) ______________________________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Forks  off a child process, which is an identical copy. For details see "[10Xman
  2  fork[0m".  Note  that if you want to use the [2XIO_WaitPid[0m ([14X3.2-60[0m) function to
  wait  or  check for the termination of child processes, you have to activate
  the  SIGCHLD  handler  for  this  package  beforehand  by using the function
  [2XIO_InstallSIGCHLDHandler[0m  ([14X3.3-3[0m).  Note  further that after that you cannot
  use       the       function       [2XInputOutputLocalProcess[0m       ([14XReference:
  InputOutputLocalProcess[0m)  any  more, since its SIGCHLD handler does not work
  any   more.   To   switch  back  to  that  functionality  use  the  function
  [2XIO_RestoreSIGCHLDHandler[0m ([14X3.3-4[0m).
  
  [1X3.2-20 IO_fstat[0m
  
  [2X> IO_fstat( [0X[3Xfd[0X[2X ) ___________________________________________________[0Xfunction
  [6XReturns:[0X  a record or [9Xfail[0m
  
  Returns  the  file  meta  data  for  an  opened file. For details see "[10Xman 2
  fstat[0m". A [5XGAP[0m record is returned with the same entries than a [10Xstruct stat[0m.
  
  [1X3.2-21 IO_gethostbyname[0m
  
  [2X> IO_gethostbyname( [0X[3Xname[0X[2X ) _________________________________________[0Xfunction
  [6XReturns:[0X  a record or [9Xfail[0m
  
  Return  host  information  by name. For details see "[10Xman 3 gethostbyname[0m". A
  [5XGAP[0m record is returned with all the relevant information about the host.
  
  [1X3.2-22 IO_gethostname[0m
  
  [2X> IO_gethostname( [0X[3X[0X[2X ) _______________________________________________[0Xfunction
  [6XReturns:[0X  a string or [9Xfail[0m
  
  Return host name. For details see "[10Xman 3 gethostname[0m".
  
  [1X3.2-23 IO_getpid[0m
  
  [2X> IO_getpid( [0X[3X[0X[2X ) ____________________________________________________[0Xfunction
  [6XReturns:[0X  an integer
  
  Returns the process ID of the current process as an integer. For details see
  "[10Xman 2 getpid[0m".
  
  [1X3.2-24 IO_getppid[0m
  
  [2X> IO_getppid( [0X[3X[0X[2X ) ___________________________________________________[0Xfunction
  [6XReturns:[0X  an integer
  
  Returns  the  process ID of the parent of the current process as an integer.
  For details see "[10Xman 2 getppid[0m".
  
  [1X3.2-25 IO_getsockname[0m
  
  [2X> IO_getsockname( [0X[3Xfd[0X[2X ) _____________________________________________[0Xfunction
  [6XReturns:[0X  a string or [9Xfail[0m
  
  Get a socket name. For details see "[10Xman 2 getsockname[0m".
  
  [1X3.2-26 IO_getsockopt[0m
  
  [2X> IO_getsockopt( [0X[3Xfd, level, optname, optval[0X[2X ) ______________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m
  
  Get  a  socket  option.  For  details  see "[10Xman 2 getsockopt[0m". Note that the
  argument  [3Xoptval[0m  carries  its  length  around, such that no 5th argument is
  necessary.
  
  [1X3.2-27 IO_gettimeofday[0m
  
  [2X> IO_gettimeofday( [0X[3X[0X[2X ) ______________________________________________[0Xfunction
  [6XReturns:[0X  A record with components [10Xtv_sec[0m and [10Xtv_usec[0m
  
  This returns the time elapsed since 1.1.1970, 0:00 GMT. The component [10Xtv_sec[0m
  contains  the  number  of full seconds and the number [10Xtv_usec[0m the additional
  microseconds.
  
  [1X3.2-28 IO_gmtime[0m
  
  [2X> IO_gmtime( [0X[3Xseconds[0X[2X ) _____________________________________________[0Xfunction
  [6XReturns:[0X  A record
  
  The argument is the number of seconds that have elapsed since 1.1.1970, 0:00
  GMT. The result is a record with the current Greenwich mean time broken down
  into date and time as in the C-library function [10Xgmtime[0m.
  
  [1X3.2-29 IO_kill[0m
  
  [2X> IO_kill( [0X[3Xpid, sig[0X[2X ) ______________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Sends  the  signal  [3Xsig[0m  to the process with process ID [3Xpid[0m. For details see
  "[10Xman  2  kill[0m".  The  signal numbers available can be found in the global [10XIO[0m
  record with names like [10XSIGTERM[0m.
  
  [1X3.2-30 IO_lchown[0m
  
  [2X> IO_lchown( [0X[3Xpath, owner, group[0X[2X ) __________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m
  
  Changes  owner  and/or  group of a file not following links. For details see
  "[10Xman 2 lchown[0m".
  
  [1X3.2-31 IO_link[0m
  
  [2X> IO_link( [0X[3Xoldpath, newpath[0X[2X ) ______________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m
  
  Create a hard link. For details see "[10Xman 2 link[0m".
  
  [1X3.2-32 IO_listen[0m
  
  [2X> IO_listen( [0X[3Xfd, backlog[0X[2X ) _________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m
  
  Switch a socket to listening. For details see "[10Xman 2 listen[0m".
  
  [1X3.2-33 IO_localtime[0m
  
  [2X> IO_localtime( [0X[3Xseconds[0X[2X ) __________________________________________[0Xfunction
  [6XReturns:[0X  A record
  
  The argument is the number of seconds that have elapsed since 1.1.1970, 0:00
  GMT.  The  result  is  a record with the current local time broken down into
  date and time as in the C-library function [10Xlocaltime[0m.
  
  [1X3.2-34 IO_lseek[0m
  
  [2X> IO_lseek( [0X[3Xfd, offset, whence[0X[2X ) ___________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Seeks within an open file. For details see "[10Xman 2 lseek[0m".
  
  [1X3.2-35 IO_lstat[0m
  
  [2X> IO_lstat( [0X[3Xname[0X[2X ) _________________________________________________[0Xfunction
  [6XReturns:[0X  a record or [9Xfail[0m
  
  Returns  the  file meta data for a file not following links. For details see
  "[10Xman  2 lstat[0m". A [5XGAP[0m record is returned with the same entries than a [10Xstruct
  stat[0m.
  
  [1X3.2-36 IO_mkdir[0m
  
  [2X> IO_mkdir( [0X[3Xpathname, mode[0X[2X ) _______________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m
  
  Creates a directory. For details see "[10Xman 2 mkdir[0m".
  
  [1X3.2-37 IO_mkfifo[0m
  
  [2X> IO_mkfifo( [0X[3Xpathname, mode[0X[2X ) ______________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m
  
  Creates a FIFO special file (a named pipe). For details see "[10Xman 3 mkfifo[0m".
  
  [1X3.2-38 IO_mknod[0m
  
  [2X> IO_mknod( [0X[3Xpathname, mode, dev[0X[2X ) __________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m
  
  Create a special or ordinary file. For details see "[10Xman 2 mknod[0m".
  
  [1X3.2-39 IO_open[0m
  
  [2X> IO_open( [0X[3Xpathname, flags, mode[0X[2X ) _________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Open  and  possibly  create  a file or device. For details see "[10Xman 2 open[0m".
  Only the variant with 3 arguments can be used.
  
  [1X3.2-40 IO_opendir[0m
  
  [2X> IO_opendir( [0X[3Xname[0X[2X ) _______________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m
  
  Opens  a  directory. For details see "[10Xman 3 opendir[0m". Note that only [9Xtrue[0m is
  returned  if  everything is OK, since only one [10XDIR[0m struct is stored on the C
  level and thus only one directory can be open at any time.
  
  [1X3.2-41 IO_pipe[0m
  
  [2X> IO_pipe( [0X[3X[0X[2X ) ______________________________________________________[0Xfunction
  [6XReturns:[0X  a record or [9Xfail[0m
  
  Create  a pair of file descriptors with a pipe between them. For details see
  "[10Xman  2  pipe[0m". Note that no arguments are needed. The result is either [9Xfail[0m
  in case of an error or a record with two components [10Xtoread[0m and [10Xtowrite[0m bound
  to the two filedescriptors for reading and writing respectively.
  
  [1X3.2-42 IO_read[0m
  
  [2X> IO_read( [0X[3Xfd, st, offset, count[0X[2X ) _________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Reads from file descriptor. For details see "[10Xman 2 read[0m". Note that there is
  one  more  argument [3Xoffset[0m to specify at which position in the string [3Xst[0m the
  read  data should be stored. Note that [3Xoffset[0m zero means at the beginning of
  the  string, which is position 1 in [5XGAP[0m. The number of bytes read or [9Xfail[0m in
  case of an error is returned.
  
  [1X3.2-43 IO_readdir[0m
  
  [2X> IO_readdir( [0X[3X[0X[2X ) ___________________________________________________[0Xfunction
  [6XReturns:[0X  a string or [9Xfail[0m or [9Xfalse[0m
  
  Reads  from  a  directory.  For  details  see  "[10Xman 2 readdir[0m". Note that no
  argument  is  required as we have only one [10XDIR[0m struct on the C level. If the
  directory  is  read completely [9Xfalse[0m is returned, and otherwise a string. An
  error is indicated by [9Xfail[0m.
  
  [1X3.2-44 IO_readlink[0m
  
  [2X> IO_readlink( [0X[3Xpath, buf, bufsize[0X[2X ) ________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Reads the value of a symbolic link. For details see "[10Xman 2 readlink[0m". [3Xbuf[0m is
  modified. The new length of [3Xbuf[0m is returned or [9Xfail[0m in case of an error.
  
  [1X3.2-45 IO_recv[0m
  
  [2X> IO_recv( [0X[3Xfd, st, offset, len, flags[0X[2X ) ____________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Receives  data  from  a  socket.  For  details  see  "[10Xman  2 recv[0m". Note the
  additional  argument  [3Xoffset[0m  which  plays  the same role as for the [2XIO_read[0m
  ([14X3.2-42[0m) function.
  
  [1X3.2-46 IO_recvfrom[0m
  
  [2X> IO_recvfrom( [0X[3Xfd, st, offset, len, flags, addr[0X[2X ) __________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Receives  data  from  a  socket  with  given address. For details see "[10Xman 2
  recvfrom[0m".  Note the additional argument [3Xoffset[0m which plays the same role as
  for  the  [2XIO_read[0m  ([14X3.2-42[0m)  function.  The  argument  [3Xaddr[0m can be made with
  [2XIO_make_sockaddr_in[0m  ([14X3.3-1[0m)  and  contains  its  length  such  that  no 7th
  argument is necessary.
  
  [1X3.2-47 IO_rename[0m
  
  [2X> IO_rename( [0X[3Xoldpath, newpath[0X[2X ) ____________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m
  
  Renames a file or moves it. For details see "[10Xman 2 rename[0m".
  
  [1X3.2-48 IO_rewinddir[0m
  
  [2X> IO_rewinddir( [0X[3X[0X[2X ) _________________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Rewinds  a  directory.  For  details  see  "[10Xman  2  rewinddir[0m". Note that no
  argument  is required as we have only one [10XDIR[0m struct on the C level. Returns
  [9Xfail[0m only, if no prior [2XIO_opendir[0m ([14X3.2-40[0m) command has been called.
  
  [1X3.2-49 IO_rmdir[0m
  
  [2X> IO_rmdir( [0X[3Xname[0X[2X ) _________________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Removes an empty directory. For details see "[10Xman 2 rmdir[0m".
  
  [1X3.2-50 IO_seekdir[0m
  
  [2X> IO_seekdir( [0X[3Xoffset[0X[2X ) _____________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Sets the position of the next readdir call. For details see "[10Xman 3 seekdir[0m".
  Note  that  no second argument is required as we have only one [10XDIR[0m struct on
  the C level.
  
  [1X3.2-51 IO_select[0m
  
  [2X> IO_select( [0X[3Xinlist, outlist, exclist, timeoutsec, timeoutusec[0X[2X ) ___[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Used  for  I/O multiplexing. For details see "[10Xman 2 select[0m". [3Xinlist[0m, [3Xoutlist[0m
  and  [3Xexclist[0m  are  lists  of  filedescriptors,  which  are  modified. If the
  corresponding  file descriptor is not yet ready, it is replaced by [9Xfail[0m. The
  timeout  values [3Xtimeoutsec[0m and [3Xtimeoutusec[0m correspond to the usual arguments
  of [10Xselect[0m, if both are immediate integers, they are set, otherwise [10Xselect[0m is
  called with no timeout value.
  
  [1X3.2-52 IO_send[0m
  
  [2X> IO_send( [0X[3Xfd, st, offset, len, flags[0X[2X ) ____________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Sends  data  to  a  socket.  For  details  see  "[10Xman  2 send[0m". Note that the
  additional argument [3Xoffset[0m specifies the position of the data to send within
  the  string  [3Xst[0m.  It is zero based, meaning that zero indicates the start of
  the string, which is position 1 in [5XGAP[0m.
  
  [1X3.2-53 IO_sendto[0m
  
  [2X> IO_sendto( [0X[3Xfd, st, offset, len, flags, addr[0X[2X ) ____________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Sends  data  to  a  socket.  For  details  see "[10Xman 2 sendto[0m". Note that the
  additional argument [3Xoffset[0m specifies the position of the data to send within
  the  string  [3Xst[0m.  It is zero based, meaning that zero indicates the start of
  the  string,  which is position 1 in [5XGAP[0m. The argument [3Xaddr[0m can be made with
  [2XIO_make_sockaddr_in[0m  ([14X3.3-1[0m)  and  contains  its  length  such  that  no 7th
  argument is necessary.
  
  [1X3.2-54 IO_setsockopt[0m
  
  [2X> IO_setsockopt( [0X[3Xfd, level, optname, optval[0X[2X ) ______________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Sets  a  socket  option.  For  details see "[10Xman 2 setsockopt[0m". Note that the
  argument  [3Xoptval[0m  carries  its  length  around, such that no 5th argument is
  necessary.
  
  [1X3.2-55 IO_socket[0m
  
  [2X> IO_socket( [0X[3Xdomain, type, protocol[0X[2X ) ______________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Creates  a  socket,  an  endpoint  for communication. For details see "[10Xman 2
  socket[0m".  There  is  one little special: On systems that have [10Xgetprotobyname[0m
  you  can  pass  a  string  as third argument [3Xprotocol[0m which is automatically
  looked up by [10Xgetprotobyname[0m.
  
  [1X3.2-56 IO_stat[0m
  
  [2X> IO_stat( [0X[3Xpathname[0X[2X ) ______________________________________________[0Xfunction
  [6XReturns:[0X  a record or [9Xfail[0m
  
  Returns  the  file  metadata  for  the file [3Xpathname[0m. For details see "[10Xman 2
  stat[0m". A [5XGAP[0m record is returned with the same entries than a [10Xstruct stat[0m.
  
  [1X3.2-57 IO_symlink[0m
  
  [2X> IO_symlink( [0X[3Xoldpath, newpath[0X[2X ) ___________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Creates a symbolic link. For details see "[10Xman 2 symlink[0m".
  
  [1X3.2-58 IO_telldir[0m
  
  [2X> IO_telldir( [0X[3X[0X[2X ) ___________________________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Return  current location in directory. For details see "[10Xman 3 telldir[0m". Note
  that  no second argument is required as we have only one [10XDIR[0m struct on the C
  level.
  
  [1X3.2-59 IO_unlink[0m
  
  [2X> IO_unlink( [0X[3Xpathname[0X[2X ) ____________________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfail[0m
  
  Delete  a  name  and  possibly the file it refers to. For details see "[10Xman 2
  unlink[0m".
  
  [1X3.2-60 IO_WaitPid[0m
  
  [2X> IO_WaitPid( [0X[3Xpid, wait[0X[2X ) __________________________________________[0Xfunction
  [6XReturns:[0X  a record or [9Xfail[0m
  
  Waits  for  the  termination  of  a  child  process.  For details see "[10Xman 2
  waitpid[0m".  Returns  a  [5XGAP[0m record describing PID and exit status. The second
  argument  [3Xwait[0m  must  be  either  [9Xtrue[0m or [9Xfalse[0m. In the first case, the call
  blocks  until new information about a terminated child process is available.
  In  the  second  case  no  such  waiting  is  performed,  the  call  returns
  immediately. See [2XIO_fork[0m ([14X3.2-19[0m).
  
  [1X3.2-61 IO_write[0m
  
  [2X> IO_write( [0X[3Xfd, st, offset, count[0X[2X ) ________________________________[0Xfunction
  [6XReturns:[0X  an integer or [9Xfail[0m
  
  Writes  to  a  file descriptor. For details see "[10Xman 2 write[0m". Note that the
  additional argument [3Xoffset[0m specifies the position of the data to send within
  the  string  [3Xst[0m.  It is zero based, meaning that zero indicates the start of
  the string, which is position 1 in [5XGAP[0m.
  
  
  [1X3.3 Further C level functions[0X
  
  The following functions do not correspond to functions in the C library, but
  are there to provide convenience to use other functions:
  
  [1X3.3-1 IO_make_sockaddr_in[0m
  
  [2X> IO_make_sockaddr_in( [0X[3Xip, port[0X[2X ) __________________________________[0Xfunction
  [6XReturns:[0X  a string or [9Xfail[0m
  
  Makes  a struct [10Xsockaddr_in[0m from IP address and port. The IP address must be
  given  as  a  string  of  length  four, containing the four bytes of an IPv4
  address  in  natural order. The port must be a port number. Returns a string
  containing  the  struct, which can be given to all functions above having an
  address argument.
  
  [1X3.3-2 IO_environ[0m
  
  [2X> IO_environ( [0X[3X[0X[2X ) ___________________________________________________[0Xfunction
  [6XReturns:[0X  a list of strings
  
  For  details see "[10Xman environ[0m". Returns the current environment as a list of
  strings of the form "key=value".
  
  [1X3.3-3 IO_InstallSIGCHLDHandler[0m
  
  [2X> IO_InstallSIGCHLDHandler( [0X[3X[0X[2X ) _____________________________________[0Xfunction
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m
  
  Installs  our  SIGCHLD  handler. This functions works as an idempotent. That
  is,  calling  it  twice does exactly the same as calling it once. It returns
  [9Xtrue[0m  when  it  is called for the first time since then a pointer to the old
  signal handler is stored in a global variable. See [2XIO_fork[0m ([14X3.2-19[0m).
  
  [1X3.3-4 IO_RestoreSIGCHLDHandler[0m
  
  [2X> IO_RestoreSIGCHLDHandler( [0X[3X[0X[2X ) _____________________________________[0Xfunction
  
  Restores the original SIGCHLD handler. This function works as an idempotent.
  That  is,  calling  it  twice  does  exactly the same as calling it once. It
  returns   [9Xtrue[0m   when  it  is  called  for  the  first  time  after  calling
  [2XIO_InstallSIGCHLDHandler[0m ([14X3.3-3[0m). See [2XIO_fork[0m ([14X3.2-19[0m).
  
