2
0

ossysc.inc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. {
  2. Copyright (c) 2002 by Marco van de Voort
  3. The base Linux syscalls required to implement the system unit. These
  4. are aliased for use in other units (to avoid poluting the system units
  5. interface)
  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. }
  13. {*****************************************************************************
  14. --- Main:The System Call Self ---
  15. *****************************************************************************}
  16. function Fptime(tloc:pTime): TTime; [public, alias : 'FPC_SYSC_TIME'];
  17. begin
  18. Fptime:=do_syscall(syscall_nr_time,TSysParam(tloc));
  19. End;
  20. {*****************************************************************************
  21. --- File:File handling related calls ---
  22. *****************************************************************************}
  23. function Fpopen(path: pchar; flags : cint; mode: mode_t):cint; [public, alias : 'FPC_SYSC_OPEN'];
  24. Begin
  25. Fpopen:=do_syscall(syscall_nr_open,TSysParam(path),TSysParam(flags or O_LARGEFILE),TSysParam(mode));
  26. End;
  27. function Fpclose(fd : cint): cint; [public, alias : 'FPC_SYSC_CLOSE'];
  28. begin
  29. Fpclose:=do_syscall(syscall_nr_close,fd);
  30. end;
  31. function Fplseek(fd : cint; offset : off_t; whence : cint): off_t; [public, alias : 'FPC_SYSC_LSEEK'];
  32. begin
  33. {$if defined(cpu64)}
  34. result:=do_syscall(syscall_nr_lseek,tsysparam(fd),tsysparam(offset),tsysparam(whence));
  35. {$else}
  36. if do_syscall(syscall_nr__llseek,tsysparam(fd),tsysparam(hi(offset)),tsysparam(lo(offset)),
  37. tsysparam(@result), tsysparam(whence)) = -1 then
  38. result:=off_t(-1);
  39. {$endif}
  40. end;
  41. function Fpread(fd: cint; buf: pchar; nbytes : size_t): ssize_t; [public, alias : 'FPC_SYSC_READ'];
  42. begin
  43. Fpread:=do_syscall(syscall_nr_read,Fd,TSysParam(buf),nbytes);
  44. end;
  45. function Fpwrite(fd: cint;buf:pchar; nbytes : size_t): ssize_t; [public, alias : 'FPC_SYSC_WRITE'];
  46. begin
  47. Fpwrite:=do_syscall(syscall_nr_write,Fd,TSysParam(buf),nbytes);
  48. end;
  49. {
  50. function Fppread(fd: cint; buf: pchar; nbytes : size_t; offset:Toff): ssize_t; [public, alias : 'FPC_SYSC_PREAD'];
  51. !! check 64 bit off_t sycall
  52. begin
  53. Fpread:=do_syscall(syscall_nr_pread,Fd,TSysParam(buf),nbytes,offset);
  54. end;
  55. function Fppwrite(fd: cint;buf:pchar; nbytes : size_t; offset:Toff): ssize_t; [public, alias : 'FPC_SYSC_PWRITE'];
  56. !! check 64 bit off_t sycall
  57. begin
  58. Fpwrite:=do_syscall(syscall_nr_pwrite,Fd,TSysParam(buf),nbytes,offset);
  59. end;
  60. }
  61. function Fpunlink(path: pchar): cint; [public, alias : 'FPC_SYSC_UNLINK'];
  62. begin
  63. Fpunlink:=do_syscall(syscall_nr_unlink,TSysParam(path));
  64. end;
  65. function Fprename(old : pchar; newpath: pchar): cint; [public, alias : 'FPC_SYSC_RENAME'];
  66. begin
  67. Fprename:=do_syscall(syscall_nr_rename,TSysParam(old),TSysParam(newpath));
  68. end;
  69. function Fpstat(path: pchar; var buf: stat):cint; [public, alias : 'FPC_SYSC_STAT'];
  70. begin
  71. {$if defined(cpu64)}
  72. Fpstat:=do_syscall(syscall_nr_stat,TSysParam(path),TSysParam(@buf));
  73. {$else}
  74. Fpstat:=do_syscall(syscall_nr_stat64,TSysParam(path),TSysParam(@buf));
  75. {$endif}
  76. end;
  77. {*****************************************************************************
  78. --- Directory:Directory related calls ---
  79. *****************************************************************************}
  80. function Fpchdir(path : pchar): cint; [public, alias : 'FPC_SYSC_CHDIR'];
  81. begin
  82. Fpchdir:=do_syscall(syscall_nr_chdir,TSysParam(path));
  83. end;
  84. function Fpmkdir(path : pchar; mode: mode_t):cint; [public, alias : 'FPC_SYSC_MKDIR'];
  85. begin
  86. Fpmkdir:=do_syscall(syscall_nr_mkdir,TSysParam(path),TSysParam(mode));
  87. end;
  88. function Fprmdir(path : pchar): cint; [public, alias : 'FPC_SYSC_RMDIR'];
  89. begin
  90. Fprmdir:=do_syscall(syscall_nr_rmdir,TSysParam(path));
  91. end;
  92. function Fpopendir(dirname : pchar): pdir; [public, alias : 'FPC_SYSC_OPENDIR'];
  93. var
  94. fd:integer;
  95. st:stat;
  96. ptr:pdir;
  97. begin
  98. Fpopendir:=nil;
  99. if Fpstat(dirname,st)<0 then
  100. exit;
  101. { Is it a dir ? }
  102. if not((st.st_mode and $f000)=$4000)then
  103. begin
  104. errno:=ESysENOTDIR;
  105. exit
  106. end;
  107. { Open it}
  108. fd:=Fpopen(dirname,O_RDONLY,438);
  109. if fd<0 then
  110. exit;
  111. new(ptr);
  112. if ptr=nil then
  113. exit;
  114. new(ptr^.dd_buf);
  115. if ptr^.dd_buf=nil then
  116. exit;
  117. ptr^.dd_fd:=fd;
  118. ptr^.dd_loc:=0;
  119. ptr^.dd_size:=0;
  120. ptr^.dd_nextoff:=0;
  121. ptr^.dd_max:=sizeof(ptr^.dd_buf^);
  122. Fpopendir:=ptr;
  123. end;
  124. function Fpclosedir(dirp : pdir): cint; [public, alias : 'FPC_SYSC_CLOSEDIR'];
  125. begin
  126. Fpclosedir:=Fpclose(dirp^.dd_fd);
  127. dispose(dirp^.dd_buf);
  128. dispose(dirp);
  129. end;
  130. Function Fpreaddir(dirp : pdir) : pdirent; [public, alias: 'FPC_SYSC_READDIR'];
  131. var bytes : longint;
  132. dp : pdirent;
  133. begin
  134. repeat
  135. if dirp^.dd_nextoff >= dirp^.dd_size then
  136. begin
  137. bytes := do_SysCall(SysCall_nr_getdents64,TSysParam(dirp^.dd_fd),TSysParam(dirp^.dd_buf),TSysParam(dirp^.dd_max));
  138. if bytes <= 0 then
  139. begin
  140. fpreaddir := nil;
  141. exit;
  142. end;
  143. dirp^.dd_size := bytes;
  144. dirp^.dd_nextoff := 0;
  145. end;
  146. dp := Pdirent(ptruint(dirp^.dd_buf)+dirp^.dd_nextoff);
  147. inc(dirp^.dd_nextoff,dp^.d_reclen);
  148. inc(dirp^.dd_loc,dp^.d_reclen);
  149. until dp^.d_fileno <> 0; // Don't show deleted files
  150. Fpreaddir := dp;
  151. end;
  152. {*****************************************************************************
  153. --- Process:Process & program handling - related calls ---
  154. *****************************************************************************}
  155. procedure Fpexit(status : cint); [public, alias : 'FPC_SYSC_EXIT'];
  156. begin
  157. do_syscall(syscall_nr_exit_group,status);
  158. end;
  159. {
  160. Change action of process upon receipt of a signal.
  161. Signum specifies the signal (all except SigKill and SigStop).
  162. If Act is non-nil, it is used to specify the new action.
  163. If OldAct is non-nil the previous action is saved there.
  164. }
  165. {$ifdef cpusparc}
  166. procedure Fprt_sigreturn_stub;assembler;nostackframe;
  167. asm
  168. mov syscall_nr_rt_sigreturn,%g1
  169. ta 0x10
  170. end;
  171. {$endif cpusparc}
  172. {$if defined(cpui386) or defined(cpuarm) or defined(cpux86_64)}
  173. {$define NEED_USER_TRAMPOLINE}
  174. {$endif}
  175. {$if defined(cpui386) or defined(cpuarm)}
  176. {$define NEED_USER_TRAMPOLINE_RT_DIFFERENT}
  177. {$endif}
  178. {$ifdef NEED_USER_TRAMPOLINE}
  179. procedure linux_restore; cdecl; nostackframe; assembler;
  180. {$ifdef cpuarm}
  181. asm
  182. swi syscall_nr_sigreturn
  183. end;
  184. {$endif}
  185. {$ifdef cpui386}
  186. asm
  187. popl %eax
  188. movl $syscall_nr_sigreturn, %eax
  189. int $0x80
  190. end;
  191. {$endif}
  192. {$ifdef cpux86_64}
  193. asm
  194. movq $syscall_nr_rt_sigreturn, %rax
  195. syscall
  196. end;
  197. {$endif}
  198. {$endif}
  199. {$ifdef NEED_USER_TRAMPOLINE_RT_DIFFERENT}
  200. procedure linux_restore_rt; cdecl; nostackframe; assembler;
  201. {$ifdef cpuarm}
  202. asm
  203. swi syscall_nr_rt_sigreturn
  204. end;
  205. {$endif}
  206. {$ifdef cpui386}
  207. asm
  208. movl $syscall_nr_rt_sigreturn, %eax
  209. int $0x80
  210. end;
  211. {$endif}
  212. {$endif}
  213. function Fpsigaction(sig: cint; new_action, old_action: psigactionrec): cint; [public, alias : 'FPC_SYSC_SIGACTION'];
  214. {
  215. Change action of process upon receipt of a signal.
  216. Signum specifies the signal (all except SigKill and SigStop).
  217. If Act is non-nil, it is used to specify the new action.
  218. If OldAct is non-nil the previous action is saved there.
  219. }
  220. begin
  221. {$ifdef cpusparc}
  222. { Sparc has an extra stub parameter }
  223. Fpsigaction:=do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(new_action),TSysParam(old_action),TSysParam(ptruint(@Fprt_sigreturn_stub)-8),TSysParam(8));
  224. {$else cpusparc}
  225. {$ifdef NEED_USER_TRAMPOLINE}
  226. if new_action <> nil then
  227. begin
  228. // a different stack (SA_ONSTACK) requires sa_restorer field
  229. if (new_action^.sa_flags and (SA_RESTORER or SA_ONSTACK)) = 0 then
  230. begin
  231. new_action^.sa_flags := new_action^.sa_flags or SA_RESTORER;
  232. {$ifdef NEED_USER_TRAMPOLINE_RT_DIFFERENT}
  233. if (new_action^.sa_flags and SA_SIGINFO) <> 0 then
  234. new_action^.sa_restorer := @linux_restore_rt
  235. else
  236. {$endif}
  237. new_action^.sa_restorer := @linux_restore;
  238. end;
  239. end;
  240. {$endif}
  241. Fpsigaction:=do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(new_action),TSysParam(old_action),TSysParam(8));
  242. {$endif cpusparc}
  243. end;
  244. function Fpftruncate(fd : cint; flength : off_t): cint; [public, alias : 'FPC_SYSC_FTRUNCATE'];
  245. { See notes lseek. This one is completely similar for the parameter (but
  246. doesn't have the returnvalue 64-bit problem)}
  247. begin
  248. {$if defined(cpu64)}
  249. Fpftruncate:=Do_syscall(syscall_nr_ftruncate,TSysParam(fd),TSysParam(flength));
  250. {$else}
  251. Fpftruncate:=Do_syscall(syscall_nr_ftruncate64,TSysParam(fd),TSysParam(lo(flength)),
  252. TSysParam(hi(flength)));
  253. {$endif}
  254. end;
  255. function Fpfstat(fd : cint; var sb : stat): cint; [public, alias : 'FPC_SYSC_FSTAT'];
  256. begin
  257. {$if defined(cpu64)}
  258. FpFStat:=do_SysCall(syscall_nr_fstat,TSysParam(fd),TSysParam(@sb));
  259. {$else}
  260. FpFStat:=do_SysCall(syscall_nr_fstat64,TSysParam(fd),TSysParam(@sb));
  261. {$endif}
  262. end;
  263. {$ifndef FPC_SYSTEM_HAS_FPFORK}
  264. function Fpfork : pid_t; [public, alias : 'FPC_SYSC_FORK'];
  265. {
  266. This function issues the 'fork' System call. the program is duplicated in memory
  267. and Execution continues in parent and child process.
  268. In the parent process, fork returns the PID of the child. In the child process,
  269. zero is returned.
  270. A negative value indicates that an error has occurred, the error is returned in
  271. LinuxError.
  272. }
  273. Begin
  274. Fpfork:=Do_syscall(SysCall_nr_fork);
  275. End;
  276. {$endif FPC_SYSTEM_HAS_FPFORK}
  277. // Look at execve variants later, when overloaded is determined.
  278. {
  279. function Fpexecve(path : pathstr; argv : ppchar; envp: ppchar): cint;
  280. }
  281. {
  282. Replaces the current program by the program specified in path,
  283. arguments in args are passed to Execve.
  284. environment specified in ep is passed on.
  285. }
  286. {
  287. Begin
  288. path:=path+#0;
  289. do_syscall(syscall_nr_Execve,TSysParam(@path[1]),TSysParam(Argv),TSysParam(envp));
  290. End;
  291. }
  292. {
  293. function Fpexecve(path : pchar; argv : ppchar; envp: ppchar): cint; [public, alias : 'FPC_SYSC_EXECVE'];
  294. }
  295. {
  296. Replaces the current program by the program specified in path,
  297. arguments in args are passed to Execve.
  298. environment specified in ep is passed on.
  299. }
  300. {
  301. Begin
  302. do_syscall(syscall_nr_Execve,TSysParam(path),TSysParam(Argv),TSysParam(envp));
  303. End;
  304. }
  305. {$ifdef CPUARM}
  306. {$define WAIT4}
  307. {$endif CPUARM}
  308. {$ifdef CPUx86_64}
  309. {$define WAIT4}
  310. {$endif CPUx86_64}
  311. {$ifdef CPUSPARC}
  312. {$define WAIT4}
  313. {$endif CPUSPARC}
  314. function Fpwaitpid(pid : pid_t; stat_loc : pcint; options: cint): pid_t; [public, alias : 'FPC_SYSC_WAITPID'];
  315. {
  316. Waits until a child with PID Pid exits, or returns if it is exited already.
  317. Any resources used by the child are freed.
  318. The exit status is reported in the adress referred to by Status. It should
  319. be a longint.
  320. }
  321. begin
  322. {$ifdef WAIT4}
  323. FpWaitPID:=do_syscall(syscall_nr_Wait4,PID,TSysParam(Stat_loc),options,0);
  324. {$else WAIT4}
  325. FpWaitPID:=do_syscall(syscall_nr_WaitPID,PID,TSysParam(Stat_loc),options);
  326. {$endif WAIT4}
  327. end;
  328. function Fpaccess(pathname : pchar; amode : cint): cint; [public, alias : 'FPC_SYSC_ACCESS'];
  329. {
  330. Test users access rights on the specified file.
  331. Mode is a mask xosisting of one or more of R_OK, W_OK, X_OK, F_OK.
  332. R,W,X stand for read,write and Execute access, simultaneously.
  333. F_OK checks whether the test would be allowed on the file.
  334. i.e. It checks the search permissions in all directory components
  335. of the path.
  336. The test is done with the real user-ID, instead of the effective.
  337. If access is denied, or an error occurred, false is returned.
  338. If access is granted, true is returned.
  339. Errors other than no access,are reported in unixerror.
  340. }
  341. begin
  342. FpAccess:=do_syscall(syscall_nr_access,TSysParam(pathname),amode);
  343. end;
  344. (* overloaded
  345. function Fpaccess(pathname : pathstr; amode : cint): cint;
  346. {
  347. Test users access rights on the specified file.
  348. Mode is a mask xosisting of one or more of R_OK, W_OK, X_OK, F_OK.
  349. R,W,X stand for read,write and Execute access, simultaneously.
  350. F_OK checks whether the test would be allowed on the file.
  351. i.e. It checks the search permissions in all directory components
  352. of the path.
  353. The test is done with the real user-ID, instead of the effective.
  354. If access is denied, or an error occurred, false is returned.
  355. If access is granted, true is returned.
  356. Errors other than no access,are reported in unixerror.
  357. }
  358. begin
  359. pathname:=pathname+#0;
  360. Access:=do_syscall(syscall_nr_access, TSysParam(@pathname[1]),mode)=0;
  361. end;
  362. *)
  363. Function FpDup(fildes:cint):cint; [public, alias : 'FPC_SYSC_DUP'];
  364. begin
  365. Fpdup:=Do_syscall(syscall_nr_dup,TSysParam(fildes));
  366. end;
  367. Function FpDup2(fildes,fildes2:cint):cint; [public, alias : 'FPC_SYSC_DUP2'];
  368. begin
  369. Fpdup2:=do_syscall(syscall_nr_dup2,TSysParam(fildes),TSysParam(fildes2));
  370. end;
  371. type
  372. tmmapargs = packed record
  373. address : TSysParam;
  374. size : TSysParam;
  375. prot : TSysParam;
  376. flags : TSysParam;
  377. fd : TSysParam;
  378. offset : TSysParam;
  379. end;
  380. {$ifdef cpui386}
  381. {$define OLDMMAP}
  382. {$endif cpui386}
  383. {$ifdef cpum68k}
  384. {$define OLDMMAP}
  385. {$endif cpum68k}
  386. {$ifdef cpuarm}
  387. {$define OLDMMAP}
  388. {$endif cpuarm}
  389. Function Fpmmap(adr:pointer;len:size_t;prot:cint;flags:cint;fd:cint;off:off_t):pointer; [public, alias : 'FPC_SYSC_MMAP'];
  390. // OFF_T procedure, and returns a pointer, NOT cint.
  391. {$ifdef OLDMMAP}
  392. var
  393. mmapargs : tmmapargs;
  394. begin
  395. mmapargs.address:=TSysParam(adr);
  396. mmapargs.size:=TSysParam(len);
  397. mmapargs.prot:=TSysParam(prot);
  398. mmapargs.flags:=TSysParam(flags);
  399. mmapargs.fd:=TSysParam(fd);
  400. mmapargs.offset:=TSysParam(off);
  401. Fpmmap:=pointer(do_syscall(syscall_nr_mmap,TSysParam(@MMapArgs)));
  402. end;
  403. {$else OLDMMAP}
  404. begin
  405. {$message warning need mmap64 syscall, hi(off) not used}
  406. Fpmmap:= pointer(do_syscall(syscall_nr_mmap,TSysParam(adr),TSysParam(len),
  407. TSysParam(prot),TSysParam(flags),TSysParam(fd),TSysParam(lo(off))));
  408. end;
  409. {$endif OLDMMAP}
  410. Function Fpmunmap(adr:pointer;len:size_t):cint; [public, alias :'FPC_SYSC_MUNMAP'];
  411. begin
  412. Fpmunmap:=do_syscall(syscall_nr_munmap,TSysParam(Adr),TSysParam(Len));
  413. end;
  414. {
  415. Interface to Unix ioctl call.
  416. Performs various operations on the filedescriptor Handle.
  417. Ndx describes the operation to perform.
  418. Data points to data needed for the Ndx function. The structure of this
  419. data is function-dependent.
  420. }
  421. // prototype is cint __P(cint,culong,....)
  422. // actual meaning of return value depends on request.
  423. Function FpIOCtl(fd:cint;request:culong;Data: Pointer):cint; [public, alias : 'FPC_SYSC_IOCTL'];
  424. // This was missing here, instead hardcoded in Do_IsDevice
  425. begin
  426. FpIOCtl:=do_SysCall(syscall_nr_ioctl,tsysparam(fd),tsysparam(Request),TSysParam(data));
  427. end;
  428. Function FpGetPid:pid_t; [public, alias : 'FPC_SYSC_GETPID'];
  429. {
  430. Get Process ID.
  431. }
  432. begin
  433. FpGetPID:=do_syscall(syscall_nr_getpid);
  434. end;
  435. Function FpReadLink(name,linkname:pchar;maxlen:size_t):cint; [public, alias : 'FPC_SYSC_READLINK'];
  436. begin
  437. Fpreadlink:=do_syscall(syscall_nr_readlink, TSysParam(name),TSysParam(linkname),maxlen);
  438. end;
  439. function FPSigProcMask(how:cint;nset : psigset;oset : psigset):cint; [public, alias : 'FPC_SYSC_SIGPROCMASK'];
  440. {
  441. Change the list of currently blocked signals.
  442. How determines which signals will be blocked :
  443. SigBlock : Add SSet to the current list of blocked signals
  444. SigUnBlock : Remove the signals in SSet from the list of blocked signals.
  445. SigSetMask : Set the list of blocked signals to SSet
  446. if OldSSet is non-null, the old set will be saved there.
  447. }
  448. begin
  449. FPsigprocmask:=do_syscall(syscall_nr_rt_sigprocmask,TSysParam(how),TSysParam(nset),TSysParam(oset),TSysParam(8));
  450. end;
  451. Function FpNanoSleep(req : ptimespec;rem : ptimespec):cint; [public, alias : 'FPC_SYSC_NANOSLEEP'];
  452. begin
  453. FpNanoSleep:=Do_SysCall(syscall_nr_nanosleep,TSysParam(req),TSysParam(rem));
  454. end;
  455. function fpgetcwd(path : pchar; siz:tsize):pchar; [public, alias : 'FPC_SYSC_GETCWD'];
  456. begin
  457. fpgetcwd:=pchar(Do_Syscall(Syscall_nr_getcwd,TSysParam(Path),TSysParam(siz)));
  458. end;
  459. function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; [public, alias: 'FPC_SYSC_GETTIMEOFDAY'];
  460. begin
  461. fpgettimeofday:=do_syscall(syscall_nr_gettimeofday,TSysParam(tp),TSysParam(tzp));
  462. end;
  463. function FpGetRLimit(resource : cInt; rlim : PRLimit) : cInt;
  464. begin
  465. FpGetRLimit := do_syscall(syscall_nr_getrlimit,
  466. TSysParam(resource), TSysParam(rlim));
  467. end;
  468. {$ifdef HAS_UGETRLIMIT}
  469. function fpugetrlimit(resource : cInt; rlim : PRLimit) : cInt;
  470. begin
  471. FpUGetRLimit := do_syscall(syscall_nr_ugetrlimit,
  472. TSysParam(resource), TSysParam(rlim));
  473. end;
  474. {$endif}
  475. {$if defined(cpupowerpc)}
  476. { fpprctl() call }
  477. function fpprctl(option : cint; const arg : ptruint) : cint;
  478. begin
  479. fpprctl := do_syscall(syscall_nr_prctl, option, arg);
  480. end;
  481. {$endif}