bunxh.inc 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2002 by Marco van de Voort
  5. The interface part of the baseunix unit.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
  13. pGrpArr = ^TGrpArr;
  14. TFilDes = Array [0..1] of cInt;
  15. pFilDes = ^TFilDes;
  16. // if you are looking for macro definitions or non C template overloaded versions, they are moved to bunxovlh.inc
  17. Function FpSigProcMask(how : cInt; nset : pSigSet; oset : pSigSet): cInt; external name 'FPC_SYSC_SIGPROCMASK';
  18. Function FpSigProcMask(how : cInt; Const nset : TSigSet; var oset : TSigSet): cInt; external name 'FPC_SYSC_SIGPROCMASK';
  19. Function FpSigPending (var nset : TSigSet): cInt;
  20. Function FpSigSuspend (Const sigmask : TSigSet): cInt;
  21. Function FpUmask (cmask : TMode): TMode;
  22. Function FpLink (existing : pChar; newone : pChar): cInt;
  23. Function FpMkfifo (path : pChar; Mode : TMode): cInt;
  24. Function FpChmod (path : pChar; Mode : TMode): cInt;
  25. Function FpChown (path : pChar; owner : TUid; group : TGid): cInt;
  26. Function FpUtime (path : pChar; times : putimbuf): cInt;
  27. Function FpPipe (var fildes : tfildes):cInt;
  28. Function FpDup (fildes : cInt): cInt; external name 'FPC_SYSC_DUP';
  29. Function FpDup2 (fildes, fildes2 : cInt): cInt; external name 'FPC_SYSC_DUP2';
  30. Function FpTimes (var buffer : tms): TClock;
  31. Function FpAlarm (seconds : cuint): cuint;
  32. Function FpPause : cInt;
  33. Function FpSleep (seconds : cuint): cuint;
  34. Function FpGetpid : TPid; external name 'FPC_SYSC_GETPID';
  35. Function FpGetppid : TPid;
  36. Function FpGetuid : TUid;
  37. Function FpGeteuid : TUid;
  38. Function FpGetgid : TGid;
  39. Function FpGetegid : TGid;
  40. Function FpSetuid (uid : TUid): cInt;
  41. Function FpSetgid (gid : TGid): cInt;
  42. Function FpGetgroups (gidsetsize : cInt; var grouplist : tgrparr): cInt;
  43. Function FpGetpgrp : TPid;
  44. Function FpSetsid : TPid;
  45. Function FpFcntl (fildes : cInt; cmd : cInt): cInt;
  46. Function FpFcntl (fildes : cInt; cmd : cInt; arg : cInt): cInt;
  47. Function FpFcntl (fildes : cInt; cmd : cInt; var arg : flock): cInt;
  48. Function FpGetcwd (path:pChar; siz:TSize):pChar; external name 'FPC_SYSC_GETCWD';
  49. Function FpFork : TPid; external name 'FPC_SYSC_FORK';
  50. Function FpExecve (path : pChar; argv : ppChar; envp: ppChar): cInt;
  51. Function FpExecv (path : pChar; argv : ppChar): cInt;
  52. Function FpWaitpid (pid : TPid; stat_loc : pcInt; options: cInt): TPid; external name 'FPC_SYSC_WAITPID';
  53. Function FpWait (var stat_loc : cInt): TPid;
  54. Procedure FpExit (Status : cInt); external name 'FPC_SYSC_EXIT';
  55. Function FpKill (pid : TPid; sig: cInt): cInt;
  56. Function FpUname (var name: utsname): cInt;
  57. Function FpOpendir (dirname : pChar): pDir; external name 'FPC_SYSC_OPENDIR';
  58. Function FpReaddir (var dirp : Dir) : pDirent; external name 'FPC_SYSC_READDIR';
  59. Function FpClosedir (var dirp : Dir): cInt; external name 'FPC_SYSC_CLOSEDIR';
  60. Function FpChdir (path : pChar): cInt; external name 'FPC_SYSC_CHDIR';
  61. Function FpOpen (path : pChar; flags : cInt; Mode: TMode):cInt; external name 'FPC_SYSC_OPEN';
  62. Function FpMkdir (path : pChar; Mode: TMode):cInt; external name 'FPC_SYSC_MKDIR';
  63. Function FpUnlink (path : pChar): cInt; external name 'FPC_SYSC_UNLINK';
  64. Function FpRmdir (path : pChar): cInt; external name 'FPC_SYSC_RMDIR';
  65. Function FpRename (old : pChar; newpath: pChar): cInt; external name 'FPC_SYSC_RENAME';
  66. Function FpFStat (fd : cInt; var sb : stat): cInt; external name 'FPC_SYSC_FSTAT';
  67. Function FpStat (path: pChar; var buf : stat): cInt; external name 'FPC_SYSC_STAT';
  68. Function FpAccess (pathname : pChar; aMode : cInt): cInt; external name 'FPC_SYSC_ACCESS';
  69. Function FpClose (fd : cInt): cInt; external name 'FPC_SYSC_CLOSE';
  70. Function FpRead (fd : cInt; buf: pChar; nbytes : TSize): TSsize; external name 'FPC_SYSC_READ';
  71. Function FpWrite (fd : cInt; buf:pChar; nbytes : TSize): TSsize; external name 'FPC_SYSC_WRITE';
  72. Function FpLseek (fd : cInt; offset : TOff; whence : cInt): TOff; external name 'FPC_SYSC_LSEEK';
  73. Function FpTime (var tloc : TTime): TTime; external name 'FPC_SYSC_TIME';
  74. Function FpFtruncate (fd : cInt; flength : TOff): cInt; external name 'FPC_SYSC_FTRUNCATE';
  75. Function FPSigaction (sig: cInt; act : pSigActionRec; oact : pSigActionRec): cint; external name 'FPC_SYSC_SIGACTION';
  76. Function FPSelect (N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cint;
  77. Function FpIOCtl (Handle:cint;Ndx: culong;Data: Pointer):cint; external name 'FPC_SYSC_IOCTL';
  78. Function FpNanoSleep (req : ptimespec;rem : ptimespec):cint; external name 'FPC_SYSC_NANOSLEEP';
  79. Function fpLstat(path:pchar;Info:pstat):cint;
  80. Function fpLstat(Filename: ansistring;Info:pstat):cint;
  81. Function fpSymlink(oldname,newname:pchar):cint;
  82. Function fpReadLink(name,linkname:pchar;maxlen:size_t):cint; external name 'FPC_SYSC_READLINK';
  83. function fpNice(N:cint):cint;
  84. Function fpGetPriority(Which,Who:cint):cint;
  85. Function fpSetPriority(Which,Who,What:cint):cint;
  86. Function Fpmmap(start:pointer;len:size_t;prot:cint;flags:cint;fd:cint;offst:off_t):pointer; external name 'FPC_SYSC_MMAP';
  87. Function Fpmunmap(start:pointer;len:size_t):cint; external name 'FPC_SYSC_MUNMAP';
  88. Function FpGetEnv (name : pChar): pChar;
  89. function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
  90. {
  91. $Log$
  92. Revision 1.15 2005-02-13 20:01:38 peter
  93. * include file cleanup
  94. Revision 1.14 2004/11/21 11:28:21 peter
  95. * fixed bootstrap with 1.0.10 and 1.9.4
  96. Revision 1.13 2004/11/19 13:15:14 marco
  97. * external rework. Mostly done.
  98. Revision 1.12 2004/11/14 12:21:08 marco
  99. * moved some calls from unix to baseunix. Darwin untested.
  100. Revision 1.11 2003/12/30 12:24:01 marco
  101. * FPC_USE_LIBC
  102. Revision 1.10 2003/09/27 13:49:41 peter
  103. * fpnanosleep exported
  104. Revision 1.9 2003/09/27 12:51:33 peter
  105. * fpISxxx macros renamed to C compliant fpS_ISxxx
  106. Revision 1.8 2003/09/20 12:38:29 marco
  107. * FCL now compiles for FreeBSD with new 1.1. Now Linux.
  108. Revision 1.7 2003/09/17 11:24:46 marco
  109. * fixes for new macro's
  110. Revision 1.6 2003/09/17 11:14:25 marco
  111. * two extra FPIS added
  112. Revision 1.5 2003/09/16 16:13:56 marco
  113. * fdset functions renamed to fp<posix name>
  114. Revision 1.4 2003/09/14 20:15:01 marco
  115. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  116. Revision 1.3 2003/06/01 16:28:41 marco
  117. * Enhancements to make the compiler baseunix using.
  118. Revision 1.2 2003/01/05 19:11:32 marco
  119. * small changes originating from introduction of Baseunix to FreeBSD
  120. Revision 1.1 2002/12/18 16:49:02 marco
  121. * New RTL. Linux system unit and baseunix operational.
  122. }