ossysc.inc 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. {
  2. $Id$
  3. Copyright (c) 2002 by Marco van de Voort
  4. The base Linux syscalls required to implement the system unit. These
  5. are aliased for use in other units (to avoid poluting the system units
  6. interface)
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. ****************************************************************************
  13. }
  14. {$if defined(CPUARM) or defined(CPUX86_64) or defined(CPUSPARC)}
  15. {$define RTSIGACTION}
  16. {$endif CPUARM}
  17. {$I syscallh.inc}
  18. {$I ostypes.inc}
  19. {$ifdef FPC_USE_LIBC}
  20. {$Linklib c}
  21. // Out of date atm.
  22. {$ifdef FPC_IS_SYSTEM}
  23. {$i oscdeclh.inc}
  24. {$endif}
  25. {$I bunxmacr.inc}
  26. {$else}
  27. {*****************************************************************************
  28. --- Main:The System Call Self ---
  29. *****************************************************************************}
  30. {$I syscall.inc}
  31. {$I sysnr.inc}
  32. {$I bunxmacr.inc}
  33. function Fptime(tloc:pTime): TTime; [public, alias : 'FPC_SYSC_TIME'];
  34. begin
  35. Fptime:=do_syscall(syscall_nr_time,TSysParam(tloc));
  36. End;
  37. {*****************************************************************************
  38. --- File:File handling related calls ---
  39. *****************************************************************************}
  40. function Fpopen(path: pchar; flags : cint; mode: mode_t):cint; [public, alias : 'FPC_SYSC_OPEN'];
  41. Begin
  42. Fpopen:=do_syscall(syscall_nr_open,TSysParam(path),TSysParam(flags),TSysParam(mode));
  43. End;
  44. function Fpclose(fd : cint): cint; [public, alias : 'FPC_SYSC_CLOSE'];
  45. begin
  46. Fpclose:=do_syscall(syscall_nr_close,fd);
  47. end;
  48. function Fplseek(fd : cint; offset : off_t; whence : cint): off_t; [public, alias : 'FPC_SYSC_LSEEK'];
  49. {
  50. Must be adapted/overloaded for 64-bit support, but that is a different call under
  51. Linux?
  52. }
  53. begin
  54. Fplseek:=do_syscall(syscall_nr_lseek,tsysparam(fd),tsysparam(offset),tsysparam(whence));
  55. end;
  56. function Fpread(fd: cint; buf: pchar; nbytes : size_t): ssize_t; [public, alias : 'FPC_SYSC_READ'];
  57. begin
  58. Fpread:=do_syscall(syscall_nr_read,Fd,TSysParam(buf),nbytes);
  59. end;
  60. function Fpwrite(fd: cint;buf:pchar; nbytes : size_t): ssize_t; [public, alias : 'FPC_SYSC_WRITE'];
  61. begin
  62. Fpwrite:=do_syscall(syscall_nr_write,Fd,TSysParam(buf),nbytes);
  63. end;
  64. function Fpunlink(path: pchar): cint; [public, alias : 'FPC_SYSC_UNLINK'];
  65. begin
  66. Fpunlink:=do_syscall(syscall_nr_unlink,TSysParam(path));
  67. end;
  68. function Fprename(old : pchar; newpath: pchar): cint; [public, alias : 'FPC_SYSC_RENAME'];
  69. begin
  70. Fprename:=do_syscall(syscall_nr_rename,TSysParam(old),TSysParam(newpath));
  71. end;
  72. function Fpstat(path: pchar; var buf : stat):cint; [public, alias : 'FPC_SYSC_STAT'];
  73. begin
  74. Fpstat:=do_syscall(syscall_nr_stat,TSysParam(path),TSysParam(@buf));
  75. end;
  76. {*****************************************************************************
  77. --- Directory:Directory related calls ---
  78. *****************************************************************************}
  79. function Fpchdir(path : pchar): cint; [public, alias : 'FPC_SYSC_CHDIR'];
  80. begin
  81. Fpchdir:=do_syscall(syscall_nr_chdir,TSysParam(path));
  82. end;
  83. function Fpmkdir(path : pchar; mode: mode_t):cint; [public, alias : 'FPC_SYSC_MKDIR'];
  84. begin
  85. Fpmkdir:=do_syscall(syscall_nr_mkdir,TSysParam(path),TSysParam(mode));
  86. end;
  87. function Fprmdir(path : pchar): cint; [public, alias : 'FPC_SYSC_RMDIR'];
  88. begin
  89. Fprmdir:=do_syscall(syscall_nr_rmdir,TSysParam(path));
  90. end;
  91. function Fpopendir(dirname : pchar): pdir; [public, alias : 'FPC_SYSC_OPENDIR'];
  92. var
  93. fd:integer;
  94. st:stat;
  95. ptr:pdir;
  96. begin
  97. Fpopendir:=nil;
  98. if Fpstat(dirname,st)<0 then
  99. exit;
  100. { Is it a dir ? }
  101. if not((st.st_mode and $f000)=$4000)then
  102. begin
  103. errno:=ESysENOTDIR;
  104. exit
  105. end;
  106. { Open it}
  107. fd:=Fpopen(dirname,O_RDONLY,438);
  108. if fd<0 then
  109. exit;
  110. new(ptr);
  111. if ptr=nil then
  112. exit;
  113. getmem(ptr^.dd_buf,sizeof(dirent));
  114. if ptr^.dd_buf=nil then
  115. exit;
  116. ptr^.dd_fd:=fd;
  117. ptr^.dd_loc:=0;
  118. ptr^.dd_size:=0;
  119. ptr^.dd_nextoff:=0;
  120. ptr^.dd_max:=sizeof(ptr^.dd_buf^);
  121. Fpopendir:=ptr;
  122. end;
  123. function Fpclosedir(dirp : pdir): cint; [public, alias : 'FPC_SYSC_CLOSEDIR'];
  124. begin
  125. Fpclosedir:=Fpclose(dirp^.dd_fd);
  126. freemem(dirp^.dd_buf,sizeof(dirent));
  127. dispose(dirp);
  128. end;
  129. Function Fpreaddir(dirp : pdir) : pdirent; [public, alias: 'FPC_SYSC_READDIR'];
  130. var bytes : longint;
  131. dp : pdirent;
  132. begin
  133. repeat
  134. if dirp^.dd_nextoff >= dirp^.dd_size then
  135. begin
  136. bytes := do_SysCall(SysCall_nr_getdents,TSysParam(dirp^.dd_fd),TSysParam(dirp^.dd_buf),TSysParam(dirp^.dd_max));
  137. if bytes <= 0 then
  138. begin
  139. fpreaddir := nil;
  140. exit;
  141. end;
  142. dirp^.dd_size := bytes;
  143. dirp^.dd_nextoff := 0;
  144. end;
  145. dp := pdirent(ptrint(dirp^.dd_buf)+dirp^.dd_nextoff);
  146. inc(dirp^.dd_nextoff,dp^.d_reclen);
  147. inc(dirp^.dd_loc,dp^.d_reclen);
  148. until dp^.d_fileno <> 0; // Don't show deleted files
  149. Fpreaddir := dp;
  150. end;
  151. {*****************************************************************************
  152. --- Process:Process & program handling - related calls ---
  153. *****************************************************************************}
  154. procedure Fpexit(status : cint); [public, alias : 'FPC_SYSC_EXIT'];
  155. begin
  156. do_syscall(syscall_nr_exit,status);
  157. end;
  158. {
  159. Change action of process upon receipt of a signal.
  160. Signum specifies the signal (all except SigKill and SigStop).
  161. If Act is non-nil, it is used to specify the new action.
  162. If OldAct is non-nil the previous action is saved there.
  163. }
  164. {$ifdef cpusparc}
  165. procedure Fprt_sigreturn_stub;assembler;nostackframe;
  166. asm
  167. mov syscall_nr_rt_sigreturn,%g1
  168. ta 0x10
  169. end;
  170. {$endif cpusparc}
  171. function Fpsigaction(sig: cint; act : psigactionrec; oact : psigactionrec): cint; [public, alias : 'FPC_SYSC_SIGACTION'];
  172. {
  173. Change action of process upon receipt of a signal.
  174. Signum specifies the signal (all except SigKill and SigStop).
  175. If Act is non-nil, it is used to specify the new action.
  176. If OldAct is non-nil the previous action is saved there.
  177. }
  178. begin
  179. {$ifdef RTSIGACTION}
  180. {$ifdef cpusparc}
  181. { Sparc has an extra stub parameter }
  182. Fpsigaction:=do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(act),TSysParam(oact),TSysParam(PtrInt(@Fprt_sigreturn_stub)-8),TSysParam(8));
  183. {$else cpusparc}
  184. Fpsigaction:=do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(act),TSysParam(oact),TSysParam(8));
  185. {$endif cpusparc}
  186. {$else RTSIGACTION}
  187. Fpsigaction:=do_syscall(syscall_nr_sigaction,TSysParam(sig),TSysParam(act),TSysParam(oact));
  188. {$endif RTSIGACTION}
  189. end;
  190. function Fpftruncate(fd : cint; flength : off_t): cint; [public, alias : 'FPC_SYSC_FTRUNCATE'];
  191. { See notes lseek. This one is completely similar for the parameter (but
  192. doesn't have the returnvalue 64-bit problem)}
  193. begin
  194. Fpftruncate:=Do_syscall(syscall_nr_ftruncate,TSysParam(fd),TSysParam(flength));
  195. end;
  196. function Fpfstat(fd : cint; var sb : stat): cint; [public, alias : 'FPC_SYSC_FSTAT'];
  197. begin
  198. FpFStat:=do_SysCall(syscall_nr_fstat,TSysParam(fd),TSysParam(@sb));
  199. end;
  200. function Fpfork : pid_t; [public, alias : 'FPC_SYSC_FORK'];
  201. {
  202. This function issues the 'fork' System call. the program is duplicated in memory
  203. and Execution continues in parent and child process.
  204. In the parent process, fork returns the PID of the child. In the child process,
  205. zero is returned.
  206. A negative value indicates that an error has occurred, the error is returned in
  207. LinuxError.
  208. }
  209. Begin
  210. Fpfork:=Do_syscall(SysCall_nr_fork);
  211. End;
  212. // Look at execve variants later, when overloaded is determined.
  213. {
  214. function Fpexecve(path : pathstr; argv : ppchar; envp: ppchar): cint;
  215. }
  216. {
  217. Replaces the current program by the program specified in path,
  218. arguments in args are passed to Execve.
  219. environment specified in ep is passed on.
  220. }
  221. {
  222. Begin
  223. path:=path+#0;
  224. do_syscall(syscall_nr_Execve,TSysParam(@path[1]),TSysParam(Argv),TSysParam(envp));
  225. End;
  226. }
  227. {
  228. function Fpexecve(path : pchar; argv : ppchar; envp: ppchar): cint; [public, alias : 'FPC_SYSC_EXECVE'];
  229. }
  230. {
  231. Replaces the current program by the program specified in path,
  232. arguments in args are passed to Execve.
  233. environment specified in ep is passed on.
  234. }
  235. {
  236. Begin
  237. do_syscall(syscall_nr_Execve,TSysParam(path),TSysParam(Argv),TSysParam(envp));
  238. End;
  239. }
  240. {$ifdef CPUARM}
  241. {$define WAIT4}
  242. {$endif CPUARM}
  243. {$ifdef CPUx86_64}
  244. {$define WAIT4}
  245. {$endif CPUx86_64}
  246. function Fpwaitpid(pid : pid_t; stat_loc : pcint; options: cint): pid_t; [public, alias : 'FPC_SYSC_WAITPID'];
  247. {
  248. Waits until a child with PID Pid exits, or returns if it is exited already.
  249. Any resources used by the child are freed.
  250. The exit status is reported in the adress referred to by Status. It should
  251. be a longint.
  252. }
  253. begin
  254. {$ifdef WAIT4}
  255. FpWaitPID:=do_syscall(syscall_nr_Wait4,PID,TSysParam(Stat_loc),options,0);
  256. {$else WAIT4}
  257. FpWaitPID:=do_syscall(syscall_nr_WaitPID,PID,TSysParam(Stat_loc),options);
  258. {$endif WAIT4}
  259. end;
  260. function Fpaccess(pathname : pchar; amode : cint): cint; [public, alias : 'FPC_SYSC_ACCESS'];
  261. {
  262. Test users access rights on the specified file.
  263. Mode is a mask xosisting of one or more of R_OK, W_OK, X_OK, F_OK.
  264. R,W,X stand for read,write and Execute access, simultaneously.
  265. F_OK checks whether the test would be allowed on the file.
  266. i.e. It checks the search permissions in all directory components
  267. of the path.
  268. The test is done with the real user-ID, instead of the effective.
  269. If access is denied, or an error occurred, false is returned.
  270. If access is granted, true is returned.
  271. Errors other than no access,are reported in unixerror.
  272. }
  273. begin
  274. FpAccess:=do_syscall(syscall_nr_access,TSysParam(pathname),amode);
  275. end;
  276. (* overloaded
  277. function Fpaccess(pathname : pathstr; amode : cint): cint;
  278. {
  279. Test users access rights on the specified file.
  280. Mode is a mask xosisting of one or more of R_OK, W_OK, X_OK, F_OK.
  281. R,W,X stand for read,write and Execute access, simultaneously.
  282. F_OK checks whether the test would be allowed on the file.
  283. i.e. It checks the search permissions in all directory components
  284. of the path.
  285. The test is done with the real user-ID, instead of the effective.
  286. If access is denied, or an error occurred, false is returned.
  287. If access is granted, true is returned.
  288. Errors other than no access,are reported in unixerror.
  289. }
  290. begin
  291. pathname:=pathname+#0;
  292. Access:=do_syscall(syscall_nr_access, TSysParam(@pathname[1]),mode)=0;
  293. end;
  294. *)
  295. Function FpDup(fildes:cint):cint; [public, alias : 'FPC_SYSC_DUP'];
  296. begin
  297. Fpdup:=Do_syscall(syscall_nr_dup,TSysParam(fildes));
  298. end;
  299. Function FpDup2(fildes,fildes2:cint):cint; [public, alias : 'FPC_SYSC_DUP2'];
  300. begin
  301. Fpdup2:=do_syscall(syscall_nr_dup2,TSysParam(fildes),TSysParam(fildes2));
  302. end;
  303. type
  304. tmmapargs = packed record
  305. address : TSysParam;
  306. size : TSysParam;
  307. prot : TSysParam;
  308. flags : TSysParam;
  309. fd : TSysParam;
  310. offset : TSysParam;
  311. end;
  312. {$ifdef cpui386}
  313. {$define OLDMMAP}
  314. {$endif cpui386}
  315. {$ifdef cpum68k}
  316. {$define OLDMMAP}
  317. {$endif cpum68k}
  318. {$ifdef cpuarm}
  319. {$define OLDMMAP}
  320. {$endif cpuarm}
  321. Function Fpmmap(adr:pointer;len:size_t;prot:cint;flags:cint;fd:cint;off:off_t):pointer; [public, alias : 'FPC_SYSC_MMAP'];
  322. // OFF_T procedure, and returns a pointer, NOT cint.
  323. {$ifdef OLDMMAP}
  324. var
  325. mmapargs : tmmapargs;
  326. begin
  327. mmapargs.address:=TSysParam(adr);
  328. mmapargs.size:=TSysParam(len);
  329. mmapargs.prot:=TSysParam(prot);
  330. mmapargs.flags:=TSysParam(flags);
  331. mmapargs.fd:=TSysParam(fd);
  332. mmapargs.offset:=TSysParam(off);
  333. Fpmmap:=pointer(do_syscall(syscall_nr_mmap,TSysParam(@MMapArgs)));
  334. end;
  335. {$else OLDMMAP}
  336. begin
  337. Fpmmap:= pointer(do_syscall(syscall_nr_mmap,TSysParam(adr),TSysParam(len),
  338. TSysParam(prot),TSysParam(flags),TSysParam(fd),TSysParam(off)));
  339. end;
  340. {$endif OLDMMAP}
  341. Function Fpmunmap(adr:pointer;len:size_t):cint; [public, alias :'FPC_SYSC_MUNMAP'];
  342. begin
  343. Fpmunmap:=do_syscall(syscall_nr_munmap,TSysParam(Adr),TSysParam(Len));
  344. end;
  345. {
  346. Interface to Unix ioctl call.
  347. Performs various operations on the filedescriptor Handle.
  348. Ndx describes the operation to perform.
  349. Data points to data needed for the Ndx function. The structure of this
  350. data is function-dependent.
  351. }
  352. // prototype is cint __P(cint,culong,....)
  353. // actual meaning of return value depends on request.
  354. Function FpIOCtl(fd:cint;request:culong;Data: Pointer):cint; [public, alias : 'FPC_SYSC_IOCTL'];
  355. // This was missing here, instead hardcoded in Do_IsDevice
  356. begin
  357. FpIOCtl:=do_SysCall(syscall_nr_ioctl,tsysparam(fd),tsysparam(Request),TSysParam(data));
  358. end;
  359. Function FpGetPid:pid_t; [public, alias : 'FPC_SYSC_GETPID'];
  360. {
  361. Get Process ID.
  362. }
  363. begin
  364. FpGetPID:=do_syscall(syscall_nr_getpid);
  365. end;
  366. Function FpReadLink(name,linkname:pchar;maxlen:size_t):cint; [public, alias : 'FPC_SYSC_READLINK'];
  367. begin
  368. Fpreadlink:=do_syscall(syscall_nr_readlink, TSysParam(name),TSysParam(linkname),maxlen);
  369. end;
  370. function FPSigProcMask(how:cint;nset : psigset;oset : psigset):cint; [public, alias : 'FPC_SYSC_SIGPROCMASK'];
  371. {
  372. Change the list of currently blocked signals.
  373. How determines which signals will be blocked :
  374. SigBlock : Add SSet to the current list of blocked signals
  375. SigUnBlock : Remove the signals in SSet from the list of blocked signals.
  376. SigSetMask : Set the list of blocked signals to SSet
  377. if OldSSet is non-null, the old set will be saved there.
  378. }
  379. begin
  380. {$ifdef RTSIGACTION}
  381. FPsigprocmask:=do_syscall(syscall_nr_rt_sigprocmask,TSysParam(how),TSysParam(nset),TSysParam(oset),TSysParam(8));
  382. {$else RTSIGACTION}
  383. FPsigprocmask:=do_syscall(syscall_nr_sigprocmask,TSysParam(how),TSysParam(nset),TSysParam(oset),TSysParam(8));
  384. {$endif RTSIGACTION}
  385. end;
  386. Function FpNanoSleep(req : ptimespec;rem : ptimespec):cint; [public, alias : 'FPC_SYSC_NANOSLEEP'];
  387. begin
  388. FpNanoSleep:=Do_SysCall(syscall_nr_nanosleep,TSysParam(req),TSysParam(rem));
  389. end;
  390. // The following belongs here, but this should be researched more.
  391. // function Fpgetcwd(pt:pchar; _size:size_t):pchar;[public, alias :'FPC_SYSC_GETCWD'];
  392. function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; [public, alias: 'FPC_SYSC_GETTIMEOFDAY'];
  393. begin
  394. fpgettimeofday:=do_syscall(syscall_nr_gettimeofday,TSysParam(tp),TSysParam(tzp));
  395. end;
  396. {$ENDIF}
  397. CONST
  398. { Constansts for MMAP }
  399. MAP_PRIVATE =2;
  400. MAP_ANONYMOUS =$20;
  401. {Constansts Termios/Ioctl (used in Do_IsDevice) }
  402. {$ifdef PowerPC}
  403. IOCtl_TCGETS=$402c7413;
  404. {$else}
  405. IOCtl_TCGETS=$5401; // TCGETS is also in termios.inc, but the sysunix needs only this
  406. {$endif}
  407. Function sbrk(size : longint) : pointer;
  408. begin
  409. sbrk:=Fpmmap(nil,Size,3,MAP_PRIVATE+MAP_ANONYMOUS,-1,0);
  410. if sbrk=pointer(-1) then
  411. sbrk:=nil
  412. else
  413. seterrno(0);
  414. end;
  415. Function Do_IsDevice(Handle:THandle):boolean;
  416. {
  417. Interface to Unix ioctl call.
  418. Performs various operations on the filedescriptor Handle.
  419. Ndx describes the operation to perform.
  420. Data points to data needed for the Ndx function. The structure of this
  421. data is function-dependent.
  422. }
  423. var
  424. Data : array[0..255] of byte; {Large enough for termios info}
  425. begin
  426. Do_IsDevice:=(Fpioctl(handle,IOCTL_TCGETS,@data)<>-1);
  427. end;
  428. {
  429. $Log$
  430. Revision 1.28 2004-05-31 20:25:04 peter
  431. * removed warnings
  432. Revision 1.27 2004/05/31 14:31:57 peter
  433. * remove comment warnings
  434. Revision 1.26 2004/05/31 09:22:42 peter
  435. * sigaction fixed for sparc
  436. Revision 1.25 2004/05/16 18:51:20 peter
  437. * use thandle in do_*
  438. Revision 1.24 2004/05/01 15:59:17 florian
  439. * x86_64 exception handling fixed
  440. Revision 1.23 2004/04/27 20:47:00 florian
  441. * tried to fix x86-64 signal handling
  442. Revision 1.22 2004/04/25 07:18:49 florian
  443. * mmap for x86-64 fixed
  444. Revision 1.21 2004/04/20 20:27:01 florian
  445. * x86_64 syscall numbers fixed
  446. Revision 1.20 2004/04/12 16:33:42 peter
  447. * readdir now uses getdents, patch from Joost van der Sluis
  448. Revision 1.19 2004/03/27 14:34:23 florian
  449. * use rt_sigaction syscall on arm
  450. Revision 1.18 2004/02/21 16:27:29 marco
  451. * hmprf, Linux has different ioctls kernel<->libc
  452. Revision 1.17 2004/02/21 15:14:55 marco
  453. * ppc ioctl nr fixed
  454. Revision 1.16 2004/02/06 15:58:21 florian
  455. * fixed x86-64 assembler problems
  456. Revision 1.15 2004/02/05 01:16:12 florian
  457. + completed x86-64/linux system unit
  458. Revision 1.14 2004/01/31 16:25:48 florian
  459. * use wait4 instead of waitpid on arm
  460. Revision 1.13 2004/01/23 00:00:06 florian
  461. * arm requires oldmmap call as well
  462. Revision 1.12 2003/12/30 16:26:10 marco
  463. * some more fixes. Testing on idefix
  464. Revision 1.11 2003/12/30 15:43:20 marco
  465. * linux now compiles with FPC_USE_LIBC
  466. Revision 1.10 2003/12/16 09:43:04 daniel
  467. * Use of 0 instead of nil fixed
  468. Revision 1.9 2003/10/17 20:56:24 olle
  469. * Changed m68k to cpum68k, i386 to cpui386
  470. Revision 1.8 2003/09/27 13:45:58 peter
  471. * fpnanosleep exported in baseunix
  472. * fpnanosleep has pointer arguments to be C compliant
  473. Revision 1.7 2003/09/27 12:58:23 peter
  474. * mmap returns -1 on error
  475. Revision 1.6 2003/09/27 11:52:35 peter
  476. * sbrk returns pointer
  477. Revision 1.5 2003/09/15 20:29:50 marco
  478. * small fix
  479. Revision 1.4 2003/09/14 20:15:01 marco
  480. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  481. Revision 1.3 2003/05/11 16:07:55 jonas
  482. * fixed mmap for non-i386 non-m68k architectures (not sure about
  483. x86-64)
  484. Revision 1.2 2002/12/18 17:38:01 marco
  485. * small fix, new rtl now cycles
  486. Revision 1.1 2002/12/18 16:43:26 marco
  487. * new unix rtl, linux part.....
  488. Revision 1.1 2002/11/12 14:40:18 marco
  489. * The syscall core of the new system unit.
  490. }