  
  [1m[4m[31m3. Functions directly available from the C library[0m
  
  The  following  functions  from  the  C  library  are  made available as [1mGAP[0m
  functions:
  
  [22m[32maccept[0m,  [22m[32mbind[0m,  [22m[32mchdir[0m,  [22m[32mchmod[0m,  [22m[32mchown[0m, [22m[32mclose[0m, [22m[32mclosedir[0m, [22m[32mconnect[0m, [22m[32mcreat[0m, [22m[32mdup[0m,
  [22m[32mdup2[0m,  [22m[32mexecv[0m,  [22m[32mexecve[0m,  [22m[32mexecvp[0m,  [22m[32mexit[0m  [22m[32mfchmod[0m,  [22m[32mfchown[0m,  [22m[32mfcntl[0m, [22m[32mfork[0m, [22m[32mfstat[0m,
  [22m[32mgethostbyname[0m,  [22m[32mgetsockopt[0m,  [22m[32mlchown[0m,  [22m[32mlink[0m,  [22m[32mlisten[0m,  [22m[32mlseek[0m,  [22m[32mlstat[0m,  [22m[32mmkdir[0m,
  [22m[32mmkfifo[0m, [22m[32mmknod[0m, [22m[32mopen[0m, [22m[32mopendir[0m, [22m[32mpipe[0m, [22m[32mread[0m, [22m[32mreaddir[0m, [22m[32mreadlink[0m, [22m[32mrecv[0m, [22m[32mrecvfrom[0m,
  [22m[32mrename[0m, [22m[32mrewinddir[0m, [22m[32mrmdir[0m, [22m[32mseekdir[0m, [22m[32mselect[0m, [22m[32msend[0m, [22m[32msendto[0m, [22m[32msetsockopt[0m, [22m[32msocket[0m,
  [22m[32mstat[0m, [22m[32msymlink[0m, [22m[32mtelldir[0m, [22m[32munlink[0m, [22m[32mwrite[0m.
  
  Use the [22m[32mman[0m command in your shell to get information about these functions.
  
  For  each  of  these  functions there is a corresponding [1mGAP[0m global function
  with  the  prefix  [22m[32mIO_[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  [1mGAP[0m strings and integers as [1mGAP[0m immediate integers.
  Return values are in general the same as for the C counterparts. However, an
  error  condition  is  indicated  by the value [22m[32mfail[0m instead of -1, and if the
  result can only be success or failure, [22m[32mtrue[0m indicates success.
  
  All errors are reported via the [1m[34mLastSystemError[0m ([1mReference: 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 [22m[32mIO[0m record.
  
  [22m[36mWarning:[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 [1mGAP[0m levels the functions and constants are there or
  not.  If  you  want  to  develop  platform  independent  [1mGAP[0m code using this
  package, then you have to check for existence of the functions and constants
  you need.
  
  
  [1m[4m[31m3.1 Differences in arguments - an overview[0m
  
  The  [22m[32mopen[0m  function  has to be called with three arguments. The version with
  two arguments is not available on the [1mGAP[0m level.
  
  The [22m[32mread[0m function takes four arguments: [22m[34mfd[0m is an integer file descriptor, [22m[34mst[0m
  is  a  [1mGAP[0m  string, [22m[34moffset[0m is an offset within this string (zero based), and
  [22m[34mcount[0m  is  the  maximal number of bytes to read. The data is read and stored
  into  the  string  [22m[34mst[0m,  starting at position [22m[34moffset[0m+1. The string [22m[34mst[0m is made
  long  enough, such that [22m[34mcount[0m bytes would fit into it, beginning at position
  [22m[34moffset[0m+1. The number of bytes read is returned or [22m[32mfail[0m in case of an error.
  
  The  [22m[32mwrite[0m  function  is  similar,  it  also  takes four arguments: [22m[34mfd[0m is an
  integer file descriptor, [22m[34mst[0m is a [1mGAP[0m string, [22m[34moffset[0m is an offset within this
  string  (zero  based),  and  [22m[34mcount[0m is the number of bytes to write, starting
  from  position  [22m[34moffset[0m+1  in  the  string [22m[34mst[0m. The number of bytes written is
  returned, or a [22m[32mfail[0m in case of an error.
  
  The [22m[32mopendir[0m function only returns [22m[32mtrue[0m or [22m[32mfail[0m.
  
  The  [22m[32mreaddir[0m  function  takes  no  argument. It reads the directory that was
  specified  in  the  last call to [22m[32mopendir[0m. It just returns a string, which is
  the  name  of  a  file  or  subdirectory  in the corresponding directory. It
  returns  [22m[32mfalse[0m  after the last file name in the directory or [22m[32mfail[0m in case of
  an error.
  
  The  [22m[32mclosedir[0m  function takes no argument. It should be called after [22m[32mreaddir[0m
  returned [22m[32mfalse[0m or [22m[32mfail[0m to avoid excessive use of file descriptors.
  
  The functions [22m[32mstat[0m, [22m[32mfstat[0m, and [22m[32mlstat[0m only take one argument and return a [1mGAP[0m
  record that has the same entries as a [22m[32mstruct stat[0m.
  
  The  function [22m[32msocket[0m can optionally take a string as third argument. In that
  case it automatically calls [22m[32mgetprotobyname[0m to look up the protocol name.
  
  The  functions  [22m[32mbind[0m  and  [22m[32mconnect[0m  take only one string argument as address
  field, because the string already encodes the length.
  
  There   are   two  convenience  functions  [1m[34mIO_make_sockaddr_in[0m  ([1m3.3-1[0m)  and
  [1m[34mIO_MakeIPAddressPort[0m  ([1m4.3-5[0m)  to create such addresses. The first takes two
  arguments  [22m[34maddr[0m and [22m[34mport[0m, where [22m[34maddr[0m is a string of length 4, containing the
  4  bytes  of  the  IP  address and [22m[34mport[0m is a port number as [1mGAP[0m integer. The
  function  [1m[34mIO_MakeIPAddressPort[0m  ([1m4.3-5[0m)  takes  the  same arguments, but the
  first  can  be  a  string  containing  an  IP  address  in dot notation like
  "137.226.152.77".
  
  The  [22m[32msetsockopt[0m  function  has  no argument [22m[34moptlen[0m. The length of the string
  [22m[34moptval[0m is taken.
  
  The [22m[32mselect[0m function works as the function [22m[32mUNIXSelect[0m in the [1mGAP[0m library.
  
  As  of  now, the file locking mechanisms of [22m[32mfcntl[0m using [22m[32mstruct flock[0m are not
  yet implemented on the [1mGAP[0m level.
  
  
  [1m[4m[31m3.2 The low-level functions in detail[0m
  
  Nearly  all  of this functions return an integer result in the C library. On
  the  [1mGAP[0m  level this is either returned as a non-negative integer in case of
  success  or  as  [22m[32mfail[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
  [22m[32mtrue[0m on the [1mGAP[0m level.
  
  [1m[4m[31m3.2-1 IO_accept[0m
  
  [1m[34m> IO_accept( [0m[22m[34mfd, addr[0m[1m[34m ) ____________________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Accepts  an incoming network connection. For details see "[22m[32mman 2 accept[0m". The
  argument  [22m[34maddr[0m can be made with [1m[34mIO_make_sockaddr_in[0m ([1m3.3-1[0m) and contains its
  length such that no third argument is necessary.
  
  [1m[4m[31m3.2-2 IO_bind[0m
  
  [1m[34m> IO_bind( [0m[22m[34mfd, my_addr[0m[1m[34m ) ___________________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Binds  a  local  address  to  a  socket.  For  details see "[22m[32mman 2 bind[0m". The
  argument  [22m[34mmy_addr[0m  can be made with [1m[34mIO_make_sockaddr_in[0m ([1m3.3-1[0m) and contains
  its length such that no third argument is necessary.
  
  [1m[4m[31m3.2-3 IO_chdir[0m
  
  [1m[34m> IO_chdir( [0m[22m[34mpath[0m[1m[34m ) _________________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Changes the current working directory. For details see "[22m[32mman 2 chdir[0m".
  
  [1m[4m[31m3.2-4 IO_chmod[0m
  
  [1m[34m> IO_chmod( [0m[22m[34mpathname, mode[0m[1m[34m ) _______________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Changes the mode of a file. For details see "[22m[32mman 2 chmod[0m".
  
  [1m[4m[31m3.2-5 IO_chown[0m
  
  [1m[34m> IO_chown( [0m[22m[34mpath, owner, group[0m[1m[34m ) ___________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Sets owner and/or group of file. For details see "[22m[32mman 2 chown[0m".
  
  [1m[4m[31m3.2-6 IO_close[0m
  
  [1m[34m> IO_close( [0m[22m[34mfd[0m[1m[34m ) ___________________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Closes a file descriptor. For details see "[22m[32mman 2 close[0m".
  
  [1m[4m[31m3.2-7 IO_closedir[0m
  
  [1m[34m> IO_closedir( [0m[22m[34m[0m[1m[34m ) __________________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Closes  a  directory.  For  details  see "[22m[32mman 3 closedir[0m". Has no arguments,
  because we only have one [22m[32mDIR[0m struct in the C part.
  
  [1m[4m[31m3.2-8 IO_connect[0m
  
  [1m[34m> IO_connect( [0m[22m[34mfd, serv_addr[0m[1m[34m ) ______________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Connects  to  a remote socket. For details see "[22m[32mman 2 connect[0m". The argument
  [22m[34mserv_addr[0m  can  be  made  with  [1m[34mIO_make_sockaddr_in[0m ([1m3.3-1[0m) and contains its
  length such that no third argument is necessary.
  
  [1m[4m[31m3.2-9 IO_creat[0m
  
  [1m[34m> IO_creat( [0m[22m[34mpathname, mode[0m[1m[34m ) _______________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Creates a new file. For details see "[22m[32mman 2 creat[0m".
  
  [1m[4m[31m3.2-10 IO_dup[0m
  
  [1m[34m> IO_dup( [0m[22m[34moldfd[0m[1m[34m ) __________________________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Duplicates a file descriptor. For details see "[22m[32mman 2 dup[0m".
  
  [1m[4m[31m3.2-11 IO_dup2[0m
  
  [1m[34m> IO_dup2( [0m[22m[34moldfd, newfd[0m[1m[34m ) __________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Duplicates a file descriptor to a new one. For details see "[22m[32mman 2 dup2[0m".
  
  [1m[4m[31m3.2-12 IO_execv[0m
  
  [1m[34m> IO_execv( [0m[22m[34mpath, argv[0m[1m[34m ) ___________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mfail[0m or does not return
  
  Replaces  the  process  with another process. For details see "[22m[32mman 3 execv[0m".
  The  argument [22m[34margv[0m is a list of strings. The called program does not have to
  be the first argument in this list.
  
  [1m[4m[31m3.2-13 IO_execve[0m
  
  [1m[34m> IO_execve( [0m[22m[34mpath, argv, envp[0m[1m[34m ) ____________________________________[0mfunction
  [1mReturns:[0m  [22m[32mfail[0m or does not return
  
  Replaces  the  process with another process. For details see "[22m[32mman 3 execve[0m".
  The  arguments  [22m[34margv[0m  and [22m[34menvp[0m are both lists of strings. The called program
  does  not  have  to be the first argument in [22m[34margv[0m. The list [22m[34menvp[0m can be made
  with  [1m[34mIO_MakeEnvList[0m  ([1m4.3-7[0m)  from  a  record  acquired from [1m[34mIO_Environment[0m
  ([1m4.3-6[0m) and modified later.
  
  [1m[4m[31m3.2-14 IO_execvp[0m
  
  [1m[34m> IO_execvp( [0m[22m[34mpath, argv[0m[1m[34m ) __________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mfail[0m or does not return
  
  Replaces  the  process with another process. For details see "[22m[32mman 3 execvp[0m".
  The  argument [22m[34margv[0m is a list of strings. The called program does not have to
  be the first argument in this list.
  
  [1m[4m[31m3.2-15 IO_exit[0m
  
  [1m[34m> IO_exit( [0m[22m[34mstatus[0m[1m[34m ) ________________________________________________[0mfunction
  
  Stops  process  immediately  with return code [22m[34mstatus[0m. For details see "[22m[32mman 2
  exit[0m". The argument [22m[34mstatus[0m must be an integer. Does not return.
  
  [1m[4m[31m3.2-16 IO_fchmod[0m
  
  [1m[34m> IO_fchmod( [0m[22m[34mfd, mode[0m[1m[34m ) ____________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Changes mode of an opened file. For details see "[22m[32mman 2 fchmod[0m".
  
  [1m[4m[31m3.2-17 IO_fchown[0m
  
  [1m[34m> IO_fchown( [0m[22m[34mfd, owner, group[0m[1m[34m ) ____________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Changes  owner  and/or  group  of  an  opened  file.  For details see "[22m[32mman 2
  fchown[0m".
  
  [1m[4m[31m3.2-18 IO_fcntl[0m
  
  [1m[34m> IO_fcntl( [0m[22m[34mfd, cmd, arg[0m[1m[34m ) _________________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Does  various  things  to  control  the  behaviour of a file descriptor. For
  details see "[22m[32mman 2 fcntl[0m".
  
  [1m[4m[31m3.2-19 IO_fork[0m
  
  [1m[34m> IO_fork( [0m[22m[34m[0m[1m[34m ) ______________________________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Forks  off a child process, which is an identical copy. For details see "[22m[32mman
  2  fork[0m".  Note  that if you want to use the [1m[34mIO_WaitPid[0m ([1m3.2-52[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
  [1m[34mIO_InstallSIGCHLDHandler[0m  ([1m3.3-3[0m).  Note  further that after that you cannot
  use       the       function       [1m[34mInputOutputLocalProcess[0m       ([1mReference:
  InputOutputLocalProcess[0m)  any  more, since its SIGCHLD handler does not work
  any   more.   To   switch  back  to  that  functionality  use  the  function
  [1m[34mIO_RestoreSIGCHLDHandler[0m ([1m3.3-4[0m).
  
  [1m[4m[31m3.2-20 IO_fstat[0m
  
  [1m[34m> IO_fstat( [0m[22m[34mfd[0m[1m[34m ) ___________________________________________________[0mfunction
  [1mReturns:[0m  a record or [22m[32mfail[0m
  
  Returns  the  file  meta  data  for  an  opened file. For details see "[22m[32mman 2
  fstat[0m". A [1mGAP[0m record is returned with the same entries than a [22m[32mstruct stat[0m.
  
  [1m[4m[31m3.2-21 IO_gethostbyname[0m
  
  [1m[34m> IO_gethostbyname( [0m[22m[34mname[0m[1m[34m ) _________________________________________[0mfunction
  [1mReturns:[0m  a record or [22m[32mfail[0m
  
  Return  host  information  by name. For details see "[22m[32mman 3 gethostbyname[0m". A
  [1mGAP[0m record is returned with all the relevant information about the host.
  
  [1m[4m[31m3.2-22 IO_getsockopt[0m
  
  [1m[34m> IO_getsockopt( [0m[22m[34mfd, level, optname, optval[0m[1m[34m ) ______________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m
  
  Get  a  socket  option.  For  details  see "[22m[32mman 2 getsockopt[0m". Note that the
  argument  [22m[34moptval[0m  carries  its  length  around, such that no 5th argument is
  necessary.
  
  [1m[4m[31m3.2-23 IO_lchown[0m
  
  [1m[34m> IO_lchown( [0m[22m[34mpath, owner, group[0m[1m[34m ) __________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m
  
  Changes  owner  and/or  group of a file not following links. For details see
  "[22m[32mman 2 lchown[0m".
  
  [1m[4m[31m3.2-24 IO_link[0m
  
  [1m[34m> IO_link( [0m[22m[34moldpath, newpath[0m[1m[34m ) ______________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m
  
  Create a hard link. For details see "[22m[32mman 2 link[0m".
  
  [1m[4m[31m3.2-25 IO_listen[0m
  
  [1m[34m> IO_listen( [0m[22m[34mfd, backlog[0m[1m[34m ) _________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m
  
  Switch a socket to listening. For details see "[22m[32mman 2 listen[0m".
  
  [1m[4m[31m3.2-26 IO_lseek[0m
  
  [1m[34m> IO_lseek( [0m[22m[34mfd, offset, whence[0m[1m[34m ) ___________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Seeks within an open file. For details see "[22m[32mman 2 lseek[0m".
  
  [1m[4m[31m3.2-27 IO_lstat[0m
  
  [1m[34m> IO_lstat( [0m[22m[34mname[0m[1m[34m ) _________________________________________________[0mfunction
  [1mReturns:[0m  a record or [22m[32mfail[0m
  
  Returns  the  file meta data for a file not following links. For details see
  "[22m[32mman  2 lstat[0m". A [1mGAP[0m record is returned with the same entries than a [22m[32mstruct
  stat[0m.
  
  [1m[4m[31m3.2-28 IO_mkdir[0m
  
  [1m[34m> IO_mkdir( [0m[22m[34mpathname, mode[0m[1m[34m ) _______________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m
  
  Creates a directory. For details see "[22m[32mman 2 mkdir[0m".
  
  [1m[4m[31m3.2-29 IO_mkfifo[0m
  
  [1m[34m> IO_mkfifo( [0m[22m[34mpathname, mode[0m[1m[34m ) ______________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m
  
  Creates a FIFO special file (a named pipe). For details see "[22m[32mman 3 mkfifo[0m".
  
  [1m[4m[31m3.2-30 IO_mknod[0m
  
  [1m[34m> IO_mknod( [0m[22m[34mpathname, mode, dev[0m[1m[34m ) __________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m
  
  Create a special or ordinary file. For details see "[22m[32mman 2 mknod[0m".
  
  [1m[4m[31m3.2-31 IO_open[0m
  
  [1m[34m> IO_open( [0m[22m[34mpathname, flags, mode[0m[1m[34m ) _________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Open  and  possibly  create  a file or device. For details see "[22m[32mman 2 open[0m".
  Only the variant with 3 arguments can be used.
  
  [1m[4m[31m3.2-32 IO_opendir[0m
  
  [1m[34m> IO_opendir( [0m[22m[34mname[0m[1m[34m ) _______________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m
  
  Opens  a  directory. For details see "[22m[32mman 3 opendir[0m". Note that only [22m[32mtrue[0m is
  returned  if  everything is OK, since only one [22m[32mDIR[0m struct is stored on the C
  level and thus only one directory can be open at any time.
  
  [1m[4m[31m3.2-33 IO_pipe[0m
  
  [1m[34m> IO_pipe( [0m[22m[34m[0m[1m[34m ) ______________________________________________________[0mfunction
  [1mReturns:[0m  a record or [22m[32mfail[0m
  
  Create  a pair of file descriptors with a pipe between them. For details see
  "[22m[32mman  2  pipe[0m". Note that no arguments are needed. The result is either [22m[32mfail[0m
  in case of an error or a record with two components [22m[32mtoread[0m and [22m[32mtowrite[0m bound
  to the two filedescriptors for reading and writing respectively.
  
  [1m[4m[31m3.2-34 IO_read[0m
  
  [1m[34m> IO_read( [0m[22m[34mfd, st, offset, count[0m[1m[34m ) _________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Reads from file descriptor. For details see "[22m[32mman 2 read[0m". Note that there is
  one  more  argument [22m[34moffset[0m to specify at which position in the string [22m[34mst[0m the
  read  data should be stored. Note that [22m[34moffset[0m zero means at the beginning of
  the  string, which is position 1 in [1mGAP[0m. The number of bytes read or [22m[32mfail[0m in
  case of an error is returned.
  
  [1m[4m[31m3.2-35 IO_readdir[0m
  
  [1m[34m> IO_readdir( [0m[22m[34m[0m[1m[34m ) ___________________________________________________[0mfunction
  [1mReturns:[0m  a string or [22m[32mfail[0m or [22m[32mfalse[0m
  
  Reads  from  a  directory.  For  details  see  "[22m[32mman 2 readdir[0m". Note that no
  argument  is  required as we have only one [22m[32mDIR[0m struct on the C level. If the
  directory  is  read completely [22m[32mfalse[0m is returned, and otherwise a string. An
  error is indicated by [22m[32mfail[0m.
  
  [1m[4m[31m3.2-36 IO_readlink[0m
  
  [1m[34m> IO_readlink( [0m[22m[34mpath, buf, bufsize[0m[1m[34m ) ________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Reads the value of a symbolic link. For details see "[22m[32mman 2 readlink[0m". [22m[34mbuf[0m is
  modified. The new length of [22m[34mbuf[0m is returned or [22m[32mfail[0m in case of an error.
  
  [1m[4m[31m3.2-37 IO_recv[0m
  
  [1m[34m> IO_recv( [0m[22m[34mfd, st, offset, len, flags[0m[1m[34m ) ____________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Receives  data  from  a  socket.  For  details  see  "[22m[32mman  2 recv[0m". Note the
  additional  argument  [22m[34moffset[0m  which  plays  the same role as for the [1m[34mIO_read[0m
  ([1m3.2-34[0m) function.
  
  [1m[4m[31m3.2-38 IO_recvfrom[0m
  
  [1m[34m> IO_recvfrom( [0m[22m[34mfd, st, offset, len, flags, addr[0m[1m[34m ) __________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Receives  data  from  a  socket  with  given address. For details see "[22m[32mman 2
  recvfrom[0m".  Note the additional argument [22m[34moffset[0m which plays the same role as
  for  the  [1m[34mIO_read[0m  ([1m3.2-34[0m)  function.  The  argument  [22m[34maddr[0m can be made with
  [1m[34mIO_make_sockaddr_in[0m  ([1m3.3-1[0m)  and  contains  its  length  such  that  no 7th
  argument is necessary.
  
  [1m[4m[31m3.2-39 IO_rename[0m
  
  [1m[34m> IO_rename( [0m[22m[34moldpath, newpath[0m[1m[34m ) ____________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[0m
  
  Renames a file or moves it. For details see "[22m[32mman 2 rename[0m".
  
  [1m[4m[31m3.2-40 IO_rewinddir[0m
  
  [1m[34m> IO_rewinddir( [0m[22m[34m[0m[1m[34m ) _________________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Rewinds  a  directory.  For  details  see  "[22m[32mman  2  rewinddir[0m". Note that no
  argument  is required as we have only one [22m[32mDIR[0m struct on the C level. Returns
  [22m[32mfail[0m only, if no prior [1m[34mIO_opendir[0m ([1m3.2-32[0m) command has been called.
  
  [1m[4m[31m3.2-41 IO_rmdir[0m
  
  [1m[34m> IO_rmdir( [0m[22m[34mname[0m[1m[34m ) _________________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Removes an empty directory. For details see "[22m[32mman 2 rmdir[0m".
  
  [1m[4m[31m3.2-42 IO_seekdir[0m
  
  [1m[34m> IO_seekdir( [0m[22m[34moffset[0m[1m[34m ) _____________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Sets the position of the next readdir call. For details see "[22m[32mman 3 seekdir[0m".
  Note  that  no second argument is required as we have only one [22m[32mDIR[0m struct on
  the C level.
  
  [1m[4m[31m3.2-43 IO_select[0m
  
  [1m[34m> IO_select( [0m[22m[34minlist, outlist, exclist, timeoutsec, timeoutusec[0m[1m[34m ) ___[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Used  for  I/O multiplexing. For details see "[22m[32mman 2 select[0m". [22m[34minlist[0m, [22m[34moutlist[0m
  and  [22m[34mexclist[0m  are  lists  of  filedescriptors,  which  are  modified. If the
  corresponding file descriptor is not yet ready, it is replaced by [22m[32mfail[0m.
  
  [1m[4m[31m3.2-44 IO_send[0m
  
  [1m[34m> IO_send( [0m[22m[34mfd, st, offset, len, flags[0m[1m[34m ) ____________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Sends  data  to  a  socket.  For  details  see  "[22m[32mman  2 send[0m". Note that the
  additional argument [22m[34moffset[0m specifies the position of the data to send within
  the  string  [22m[34mst[0m.  It is zero based, meaning that zero indicates the start of
  the string, which is position 1 in [1mGAP[0m.
  
  [1m[4m[31m3.2-45 IO_sendto[0m
  
  [1m[34m> IO_sendto( [0m[22m[34mfd, st, offset, len, flags, addr[0m[1m[34m ) ____________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Sends  data  to  a  socket.  For  details  see "[22m[32mman 2 sendto[0m". Note that the
  additional argument [22m[34moffset[0m specifies the position of the data to send within
  the  string  [22m[34mst[0m.  It is zero based, meaning that zero indicates the start of
  the  string,  which is position 1 in [1mGAP[0m. The argument [22m[34maddr[0m can be made with
  [1m[34mIO_make_sockaddr_in[0m  ([1m3.3-1[0m)  and  contains  its  length  such  that  no 7th
  argument is necessary.
  
  [1m[4m[31m3.2-46 IO_setsockopt[0m
  
  [1m[34m> IO_setsockopt( [0m[22m[34mfd, level, optname, optval[0m[1m[34m ) ______________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Sets  a  socket  option.  For  details see "[22m[32mman 2 setsockopt[0m". Note that the
  argument  [22m[34moptval[0m  carries  its  length  around, such that no 5th argument is
  necessary.
  
  [1m[4m[31m3.2-47 IO_socket[0m
  
  [1m[34m> IO_socket( [0m[22m[34mdomain, type, protocol[0m[1m[34m ) ______________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Creates  a  socket,  an  endpoint  for communication. For details see "[22m[32mman 2
  socket[0m".  There  is  one little special: On systems that have [22m[32mgetprotobyname[0m
  you  can  pass  a  string  as third argument [22m[34mprotocol[0m which is automatically
  looked up by [22m[32mgetprotobyname[0m.
  
  [1m[4m[31m3.2-48 IO_stat[0m
  
  [1m[34m> IO_stat( [0m[22m[34mpathname[0m[1m[34m ) ______________________________________________[0mfunction
  [1mReturns:[0m  a record or [22m[32mfail[0m
  
  Returns  the  file  metadata  for  the file [22m[34mpathname[0m. For details see "[22m[32mman 2
  stat[0m". A [1mGAP[0m record is returned with the same entries than a [22m[32mstruct stat[0m.
  
  [1m[4m[31m3.2-49 IO_symlink[0m
  
  [1m[34m> IO_symlink( [0m[22m[34moldpath, newpath[0m[1m[34m ) ___________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Creates a symbolic link. For details see "[22m[32mman 2 symlink[0m".
  
  [1m[4m[31m3.2-50 IO_telldir[0m
  
  [1m[34m> IO_telldir( [0m[22m[34m[0m[1m[34m ) ___________________________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Return  current location in directory. For details see "[22m[32mman 3 telldir[0m". Note
  that  no second argument is required as we have only one [22m[32mDIR[0m struct on the C
  level.
  
  [1m[4m[31m3.2-51 IO_unlink[0m
  
  [1m[34m> IO_unlink( [0m[22m[34mpathname[0m[1m[34m ) ____________________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfail[0m
  
  Delete  a  name  and  possibly the file it refers to. For details see "[22m[32mman 2
  unlink[0m".
  
  [1m[4m[31m3.2-52 IO_WaitPid[0m
  
  [1m[34m> IO_WaitPid( [0m[22m[34mpid, wait[0m[1m[34m ) __________________________________________[0mfunction
  [1mReturns:[0m  a record or [22m[32mfail[0m
  
  Waits  for  the  termination  of  a  child  process.  For details see "[22m[32mman 2
  waitpid[0m".  Returns  a  [1mGAP[0m record describing PID and exit status. The second
  argument  [22m[34mwait[0m  must  be  either  [22m[32mtrue[0m or [22m[32mfalse[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 [1m[34mIO_fork[0m ([1m3.2-19[0m).
  
  [1m[4m[31m3.2-53 IO_write[0m
  
  [1m[34m> IO_write( [0m[22m[34mfd, st, offset, count[0m[1m[34m ) ________________________________[0mfunction
  [1mReturns:[0m  an integer or [22m[32mfail[0m
  
  Writes  to  a  file descriptor. For details see "[22m[32mman 2 write[0m". Note that the
  additional argument [22m[34moffset[0m specifies the position of the data to send within
  the  string  [22m[34mst[0m.  It is zero based, meaning that zero indicates the start of
  the string, which is position 1 in [1mGAP[0m.
  
  
  [1m[4m[31m3.3 Further C level functions[0m
  
  The following functions do not correspond to functions in the C library, but
  are there to provide convenience to use other functions:
  
  [1m[4m[31m3.3-1 IO_make_sockaddr_in[0m
  
  [1m[34m> IO_make_sockaddr_in( [0m[22m[34mip, port[0m[1m[34m ) __________________________________[0mfunction
  [1mReturns:[0m  a string or [22m[32mfail[0m
  
  Makes  a struct [22m[32msockaddr_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.
  
  [1m[4m[31m3.3-2 IO_environ[0m
  
  [1m[34m> IO_environ( [0m[22m[34m[0m[1m[34m ) ___________________________________________________[0mfunction
  [1mReturns:[0m  a list of strings
  
  For  details see "[22m[32mman environ[0m". Returns the current environment as a list of
  strings of the form "key=value".
  
  [1m[4m[31m3.3-3 IO_InstallSIGCHLDHandler[0m
  
  [1m[34m> IO_InstallSIGCHLDHandler( [0m[22m[34m[0m[1m[34m ) _____________________________________[0mfunction
  [1mReturns:[0m  [22m[32mtrue[0m or [22m[32mfalse[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
  [22m[32mtrue[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 [1m[34mIO_fork[0m ([1m3.2-19[0m).
  
  [1m[4m[31m3.3-4 IO_RestoreSIGCHLDHandler[0m
  
  [1m[34m> IO_RestoreSIGCHLDHandler( [0m[22m[34m[0m[1m[34m ) _____________________________________[0mfunction
  
  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   [22m[32mtrue[0m   when  it  is  called  for  the  first  time  after  calling
  [1m[34mIO_InstallSIGCHLDHandler[0m ([1m3.3-3[0m). See [1m[34mIO_fork[0m ([1m3.2-19[0m).
  
