bunxmain.inc 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {
  2. $Id$
  3. Copyright (c) 2002 by Marco van de Voort.
  4. Implementation of the baseunix unit for *BSD^H^H^Hlinux. In practice only
  5. includes other files, or specifies libc bindings.
  6. The conditional uselibc can be used to switch from libc to syscall
  7. usage for basic primitives, but it is best to use unit POSIX if
  8. possible. Note that the system unit must also be compiled using uselibc.
  9. See the file COPYING.FPC, included in this distribution,
  10. for details about the copyright.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. ****************************************************************************
  15. }
  16. { $I ostypes.inc}
  17. {$ifdef uselibc}
  18. {$I oscdecl.inc}
  19. {$else}
  20. function fptime (var tloc:time_t): time_t; external name 'FPC_SYSC_TIME';
  21. function fpopen (path: pchar; flags : cint; mode: TMode):cint; external name 'FPC_SYSC_OPEN';
  22. function fpclose (fd : cint): cint; external name 'FPC_SYSC_CLOSE';
  23. function fplseek (fd : cint; offset : TOff; whence : cint): TOff; external name 'FPC_SYSC_LSEEK';
  24. function fpread (fd: cint; buf: pchar; nbytes : TSize): TSSize; external name 'FPC_SYSC_READ';
  25. function fpwrite (fd: cint; buf:pchar; nbytes : TSize): TSSize; external name 'FPC_SYSC_WRITE';
  26. function fpunlink (path: pchar): cint; external name 'FPC_SYSC_UNLINK';
  27. function fprename (old : pchar; newpath: pchar): cint; external name 'FPC_SYSC_RENAME';
  28. function fpstat (path: pchar; var buf : stat):cint; external name 'FPC_SYSC_STAT';
  29. function fpchdir (path : pchar): cint; external name 'FPC_SYSC_CHDIR';
  30. function fpmkdir (path : pchar; mode: TMode):cint; external name 'FPC_SYSC_MKDIR';
  31. function fprmdir (path : pchar): cint; external name 'FPC_SYSC_RMDIR';
  32. function fpopendir (dirname : pchar): pdir; external name 'FPC_SYSC_OPENDIR';
  33. function fpclosedir (var dirp : dir): cint; external name 'FPC_SYSC_CLOSEDIR';
  34. function fpreaddir (var dirp : dir) : pdirent; external name 'FPC_SYSC_READDIR';
  35. procedure fpexit (status : cint); external name 'FPC_SYSC_EXIT';
  36. function fpsigaction (sig: cint; act : psigactionrec; oact : psigactionrec): cint; external name 'FPC_SYSC_SIGACTION';
  37. function fpftruncate (fd : cint; flength : TOff): cint; external name 'FPC_SYSC_FTRUNCATE';
  38. function fpfstat (fd : cint; var sb : stat): cint; external name 'FPC_SYSC_FSTAT';
  39. function fpfork : pid_t; external name 'FPC_SYSC_FORK';
  40. // function fpexecve (path : pchar; argv : ppchar;envp: ppchar): cint; external name 'FPC_SYSC_EXECVE';
  41. function fpwaitpid (pid : pid_t; var stat_loc : cint; options: cint): pid_t; external name 'FPC_SYSC_WAITPID';
  42. function fpaccess (pathname : pchar; amode : cint): cint;external name 'FPC_SYSC_ACCESS';
  43. function fpDup (fildes:cint):cint; external name 'FPC_SYSC_DUP';
  44. function fpDup2 (fildes:cint;fildes2:cint):cint; external name 'FPC_SYSC_DUP2';
  45. function geterrno : cint; external name 'FPC_SYS_GETERRNO';
  46. procedure seterrno (i:cint); external name 'FPC_SYS_SETERRNO';
  47. {$endif}
  48. {$I bunxfunc.inc}
  49. {$I genfuncs.inc}
  50. {
  51. $Log$
  52. Revision 1.2 2003-01-02 22:39:19 marco
  53. * posmacro.inc was still include while it was already moved to bunxmacr.inc
  54. fixed, will remove posmacro.inc shortly
  55. Revision 1.1 2002/12/18 16:43:26 marco
  56. * new unix rtl, linux part.....
  57. Revision 1.1 2002/11/12 14:37:59 marco
  58. * Parts of new unix rtl
  59. }