unistdh.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. const
  2. _POSIX_VERSION = 199506;
  3. _POSIX2_C_VERSION = 199209;
  4. _POSIX2_VERSION = 199209;
  5. _POSIX2_C_BIND = 1;
  6. _POSIX2_C_DEV = 1;
  7. _POSIX2_SW_DEV = 1;
  8. _POSIX2_LOCALEDEF = 1;
  9. const
  10. _XOPEN_VERSION = 500;
  11. const
  12. _XOPEN_XCU_VERSION = 4;
  13. _XOPEN_XPG2 = 1;
  14. _XOPEN_XPG3 = 1;
  15. _XOPEN_XPG4 = 1;
  16. _XOPEN_UNIX = 1;
  17. _XOPEN_CRYPT = 1;
  18. _XOPEN_ENH_I18N = 1;
  19. _XOPEN_LEGACY = 1;
  20. const
  21. STDIN_FILENO = 0;
  22. STDOUT_FILENO = 1;
  23. STDERR_FILENO = 2;
  24. type
  25. Pintptr_t = ^intptr_t;
  26. function access(__name:Pchar; __type:longint):longint;cdecl;external clib name 'access';
  27. function euidaccess(__name:Pchar; __type:longint):longint;cdecl;external clib name 'euidaccess';
  28. function lseek(__fd:longint; __offset:__off_t; __whence:longint):__off_t;cdecl;external clib name 'lseek';
  29. function lseek64(__fd:longint; __offset:__off64_t; __whence:longint):__off64_t;cdecl;external clib name 'lseek64';
  30. { // Removed, conflicts with system routines
  31. function close(__fd:longint):longint;cdecl;external clib name 'close';
  32. function read(__fd:longint; __buf:pointer; __nbytes:size_t):ssize_t;cdecl;external clib name 'read';
  33. function write(__fd:longint; __buf:pointer; __n:size_t):ssize_t;cdecl;external clib name 'write';
  34. }
  35. function pread(__fd:longint; __buf:pointer; __nbytes:size_t; __offset:__off_t):ssize_t;cdecl;external clib name 'pread';
  36. function pwrite(__fd:longint; __buf:pointer; __n:size_t; __offset:__off_t):ssize_t;cdecl;external clib name 'pwrite';
  37. function pread64(__fd:longint; __buf:pointer; __nbytes:size_t; __offset:__off64_t):ssize_t;cdecl;external clib name 'pread64';
  38. function pwrite64(__fd:longint; __buf:pointer; __n:size_t; __offset:__off64_t):ssize_t;cdecl;external clib name 'pwrite64';
  39. Type
  40. TPipes = Array[0..1] of longint;
  41. PPipes = ^TPipes;
  42. function pipe(var __pipedes: TPipes):longint;cdecl;external clib name 'pipe';
  43. function pipe(__pipedes: Plongint):longint;cdecl;external clib name 'pipe';
  44. function alarm(__seconds:dword):dword;cdecl;external clib name 'alarm';
  45. function __sleep(__seconds:dword):dword;cdecl;external clib name 'sleep';
  46. function ualarm(__value:__useconds_t; __interval:__useconds_t):__useconds_t;cdecl;external clib name 'ualarm';
  47. function usleep(__useconds:__useconds_t):longint;cdecl;external clib name 'usleep';
  48. function pause:longint;cdecl;external clib name 'pause';
  49. function chown(__file:Pchar; __owner:__uid_t; __group:__gid_t):longint;cdecl;external clib name 'chown';
  50. function fchown(__fd:longint; __owner:__uid_t; __group:__gid_t):longint;cdecl;external clib name 'fchown';
  51. function lchown(__file:Pchar; __owner:__uid_t; __group:__gid_t):longint;cdecl;external clib name 'lchown';
  52. function __chdir(__path:Pchar):longint;cdecl;external clib name 'chdir';
  53. function fchdir(__fd:longint):longint;cdecl;external clib name 'fchdir';
  54. function getcwd(__buf:Pchar; __size:size_t):Pchar;cdecl;external clib name 'getcwd';
  55. function get_current_dir_name:Pchar;cdecl;external clib name 'get_current_dir_name';
  56. function getwd(__buf:Pchar):Pchar;cdecl;external clib name 'getwd';
  57. function dup(__fd:longint):longint;cdecl;external clib name 'dup';
  58. function dup2(__fd:longint; __fd2:longint):longint;cdecl;external clib name 'dup2';
  59. var
  60. __environ : ^Pchar;cvar;external;
  61. environ : ^Pchar;cvar;external;
  62. function execve(__path:Pchar; __argv:PPchar; __envp:PPchar):longint;cdecl;external clib name 'execve';
  63. function fexecve(__fd:longint; __argv:PPchar; __envp:PPchar):longint;cdecl;external clib name 'fexecve';
  64. function execv(__path:Pchar; __argv:PPchar):longint;cdecl;external clib name 'execv';
  65. function execle(__path:Pchar; __arg:Pchar):longint;cdecl;varargs;external clib name 'execle';
  66. function execl(__path:Pchar; __arg:Pchar):longint;cdecl;varargs;external clib name 'execl';
  67. function execvp(__file:Pchar; __argv:PPchar):longint;cdecl;external clib name 'execvp';
  68. function execlp(__file:Pchar; __arg:Pchar):longint;cdecl;varargs;external clib name 'execlp';
  69. function nice(__inc:longint):longint;cdecl;external clib name 'nice';
  70. procedure _exit (__status : longint); cdecl; external clib name '_exit';
  71. function pathconf(__path:Pchar; __name:longint):longint;cdecl;external clib name 'pathconf';
  72. function fpathconf(__fd:longint; __name:longint):longint;cdecl;external clib name 'fpathconf';
  73. function sysconf (__name : longint) : longint; cdecl; external clib name 'sysconf';
  74. function confstr(__name:longint; __buf:Pchar; __len:size_t):size_t;cdecl;external clib name 'confstr';
  75. function getpid:__pid_t;cdecl;external clib name 'getpid';
  76. function getppid:__pid_t;cdecl;external clib name 'getppid';
  77. function getpgrp:__pid_t;cdecl;external clib name 'getpgrp';
  78. function __getpgid(__pid:__pid_t):__pid_t;cdecl;external clib name '__getpgid';
  79. function getpgid(__pid:__pid_t):__pid_t;cdecl;external clib name 'getpgid';
  80. function setpgid(__pid:__pid_t; __pgid:__pid_t):longint;cdecl;external clib name 'setpgid';
  81. function setpgrp:longint;cdecl;external clib name 'setpgrp';
  82. function setsid:__pid_t;cdecl;external clib name 'setsid';
  83. function getsid(__pid:__pid_t):__pid_t;cdecl;external clib name 'getsid';
  84. function getuid:__uid_t;cdecl;external clib name 'getuid';
  85. function geteuid:__uid_t;cdecl;external clib name 'geteuid';
  86. function getgid:__gid_t;cdecl;external clib name 'getgid';
  87. function getegid:__gid_t;cdecl;external clib name 'getegid';
  88. function getgroups(__size:longint; __list:array of __gid_t):longint;cdecl;external clib name 'getgroups';
  89. function group_member(__gid:__gid_t):longint;cdecl;external clib name 'group_member';
  90. function setuid(__uid:__uid_t):longint;cdecl;external clib name 'setuid';
  91. function setreuid(__ruid:__uid_t; __euid:__uid_t):longint;cdecl;external clib name 'setreuid';
  92. function seteuid(__uid:__uid_t):longint;cdecl;external clib name 'seteuid';
  93. function setgid(__gid:__gid_t):longint;cdecl;external clib name 'setgid';
  94. function setregid(__rgid:__gid_t; __egid:__gid_t):longint;cdecl;external clib name 'setregid';
  95. function setegid(__gid:__gid_t):longint;cdecl;external clib name 'setegid';
  96. function fork:__pid_t;cdecl;external clib name 'fork';
  97. function vfork:__pid_t;cdecl;external clib name 'vfork';
  98. function ttyname(__fd:longint):Pchar;cdecl;external clib name 'ttyname';
  99. function ttyname_r(__fd:longint; __buf:Pchar; __buflen:size_t):longint;cdecl;external clib name 'ttyname_r';
  100. function isatty(__fd:longint):longint;cdecl;external clib name 'isatty';
  101. function link(__from:Pchar; __to:Pchar):longint;cdecl;external clib name 'link';
  102. function symlink(__from:Pchar; __to:Pchar):longint;cdecl;external clib name 'symlink';
  103. function readlink(__path:Pchar; __buf:Pchar; __len:size_t):longint;cdecl;external clib name 'readlink';
  104. function unlink(__name:Pchar):longint;cdecl;external clib name 'unlink';
  105. function __rmdir(__path:Pchar):longint;cdecl;external clib name 'rmdir';
  106. function tcgetpgrp(__fd:longint):__pid_t;cdecl;external clib name 'tcgetpgrp';
  107. function tcsetpgrp(__fd:longint; __pgrp_id:__pid_t):longint;cdecl;external clib name 'tcsetpgrp';
  108. function getlogin:Pchar;cdecl;external clib name 'getlogin';
  109. function getlogin_r(__name:Pchar; __name_len:size_t):longint;cdecl;external clib name 'getlogin_r';
  110. function setlogin(__name:Pchar):longint;cdecl;external clib name 'setlogin';
  111. function gethostname(__name:Pchar; __len:size_t):longint;cdecl;external clib name 'gethostname';
  112. function sethostname(__name:Pchar; __len:size_t):longint;cdecl;external clib name 'sethostname';
  113. function sethostid(__id:longint):longint;cdecl;external clib name 'sethostid';
  114. function getdomainname(__name:Pchar; __len:size_t):longint;cdecl;external clib name 'getdomainname';
  115. function setdomainname(__name:Pchar; __len:size_t):longint;cdecl;external clib name 'setdomainname';
  116. function vhangup:longint;cdecl;external clib name 'vhangup';
  117. function revoke(__file:Pchar):longint;cdecl;external clib name 'revoke';
  118. function profil(__sample_buffer:Pword; __size:size_t; __offset:size_t; __scale:dword):longint;cdecl;external clib name 'profil';
  119. function acct(__name:Pchar):longint;cdecl;external clib name 'acct';
  120. function getusershell:Pchar;cdecl;external clib name 'getusershell';
  121. procedure endusershell;cdecl;external clib name 'endusershell';
  122. procedure setusershell;cdecl;external clib name 'setusershell';
  123. function daemon(__nochdir:longint; __noclose:longint):longint;cdecl;external clib name 'daemon';
  124. function chroot(__path:Pchar):longint;cdecl;external clib name 'chroot';
  125. function getpass(__prompt:Pchar):Pchar;cdecl;external clib name 'getpass';
  126. function fsync(__fd:longint):longint;cdecl;external clib name 'fsync';
  127. function gethostid:longint;cdecl;external clib name 'gethostid';
  128. procedure sync;cdecl;external clib name 'sync';
  129. function getpagesize : longint;cdecl; external clib name 'getpagesize';
  130. function __truncate(__file:Pchar; __length:__off_t):longint;cdecl;external clib name 'truncate';
  131. function truncate64(__file:Pchar; __length:__off64_t):longint;cdecl;external clib name 'truncate64';
  132. function ftruncate(__fd:longint; __length:__off_t):longint;cdecl;external clib name 'ftruncate';
  133. function ftruncate64(__fd:longint; __length:__off64_t):longint;cdecl;external clib name 'ftruncate64';
  134. function getdtablesize:longint;cdecl;external clib name 'getdtablesize';
  135. function brk(__addr:pointer):longint;cdecl;external clib name 'brk';
  136. function sbrk(__delta:intptr_t):pointer;cdecl;external clib name 'sbrk';
  137. function syscall(__sysno:longint):longint;cdecl;varargs;external clib name 'syscall';
  138. function crypt(__key:Pchar; __salt:Pchar):Pchar;cdecl;external clib name 'crypt';
  139. procedure encrypt(__block:Pchar; __edflag:longint);cdecl;external clib name 'encrypt';
  140. procedure swab(__from:pointer; __to:pointer; __n:ssize_t);cdecl;external clib name 'swab';
  141. { ---------------------------------------------------------------------
  142. Borland compatibility types
  143. ---------------------------------------------------------------------}
  144. Type
  145. TPipeDescriptors = {packed} record
  146. ReadDes: Integer;
  147. WriteDes: Integer;
  148. end;
  149. PPipeDescriptors = ^TPipeDescriptors;
  150. function pipe(var PipeDes: TPipeDescriptors): Integer; cdecl; external clib name 'pipe';
  151. function __read(Handle: Integer; var Buffer; Count: size_t): ssize_t; cdecl;external clib name 'read';
  152. function __write(Handle: Integer; const Buffer; Count: size_t): ssize_t; cdecl;external clib name 'write';
  153. function __close(Handle: Integer): Integer; cdecl;external clib name 'close';