bsdsysca.inc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2000 by Marco van de Voort
  5. member of the Free Pascal development team.
  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. Function Fork:longint;
  13. {
  14. This function issues the 'fork' System call. the program is duplicated in memory
  15. and Execution continues in parent and child process.
  16. In the parent process, fork returns the PID of the child. In the child process,
  17. zero is returned.
  18. A negative value indicates that an error has occurred, the error is returned in
  19. LinuxError.
  20. }
  21. Begin
  22. fork:=Do_syscall(SysCall_nr_fork);
  23. LinuxError:=ErrNo;
  24. End;
  25. {
  26. function clone(func:TCloneFunc;sp:pointer;flags:longint;args:pointer):longint;
  27. {NOT IMPLEMENTED YET UNDER BSD}
  28. begin
  29. HALT;
  30. END;
  31. if (pointer(func)=nil) or (sp=nil) then
  32. begin
  33. LinuxError:=Sys_EInval;
  34. exit;
  35. end;
  36. asm
  37. { Insert the argument onto the new stack. }
  38. movl sp,%ecx
  39. subl $8,%ecx
  40. movl args,%eax
  41. movl %eax,4(%ecx)
  42. { Save the function pointer as the zeroth argument.
  43. It will be popped off in the child in the ebx frobbing below. }
  44. movl func,%eax
  45. movl %eax,0(%ecx)
  46. { Do the system call }
  47. pushl %ebx
  48. pushl %ebx
  49. // movl flags,%ebx
  50. movl $251,%eax
  51. int $0x80
  52. popl %ebx
  53. popl %ebx
  54. test %eax,%eax
  55. jnz .Lclone_end
  56. { We're in the new thread }
  57. subl %ebp,%ebp { terminate the stack frame }
  58. call *%ebx
  59. { exit process }
  60. movl %eax,%ebx
  61. movl $1,%eax
  62. int $0x80
  63. .Lclone_end:
  64. movl %eax,__RESULT
  65. end;
  66. end;
  67. }
  68. Procedure Execve(path:pathstr;args:ppchar;ep:ppchar);
  69. {
  70. Replaces the current program by the program specified in path,
  71. arguments in args are passed to Execve.
  72. environment specified in ep is passed on.
  73. }
  74. Begin
  75. path:=path+#0;
  76. do_syscall(syscall_nr_Execve,longint(@path[1]),longint(Args),longint(ep));
  77. LinuxError:=ErrNo;
  78. End;
  79. Function Umask(Mask:Integer):integer;
  80. {
  81. Sets file creation mask to (Mask and 0777 (octal) ), and returns the
  82. previous value.
  83. }
  84. begin
  85. UMask:=Do_syscall(syscall_nr_umask,mask);
  86. LinuxError:=0;
  87. end;
  88. Procedure Nice(N:integer);
  89. {
  90. Set process priority. A positive N means a lower priority.
  91. A negative N decreases priority.
  92. Doesn't exist in BSD. Linux emu uses setpriority in a construct as below:
  93. }
  94. begin
  95. SetPriority(Prio_Process,0,N);
  96. end;
  97. Procedure Execve(path:pchar;args:ppchar;ep:ppchar);
  98. {
  99. Replaces the current program by the program specified in path,
  100. arguments in args are passed to Execve.
  101. environment specified in ep is passed on.
  102. }
  103. {
  104. Replaces the current program by the program specified in path,
  105. arguments in args are passed to Execve.
  106. environment specified in ep is passed on.
  107. }
  108. Begin
  109. do_syscall(syscall_nr_Execve,longint(path),longint(Args),longint(ep));
  110. LinuxError:=ErrNo;
  111. End;
  112. Procedure ExitProcess(val:longint);
  113. begin
  114. do_syscall(Syscall_nr_exit,val);
  115. LinuxError:=ErrNo;
  116. end;
  117. Function WaitPid(Pid:longint;Status:pointer;Options:longint):Longint;
  118. {
  119. Waits until a child with PID Pid exits, or returns if it is exited already.
  120. Any resources used by the child are freed.
  121. The exit status is reported in the adress referred to by Status. It should
  122. be a longint.
  123. }
  124. begin
  125. WaitPID:=do_syscall(syscall_nr_WaitPID,PID,longint(Status),options,0);
  126. LinuxError:=ErrNo;
  127. end;
  128. Function GetPriority(Which,Who:longint):longint;
  129. {
  130. Get Priority of process, process group, or user.
  131. Which : selects what kind of priority is used.
  132. can be one of the following predefined Constants :
  133. Prio_User.
  134. Prio_PGrp.
  135. Prio_Process.
  136. Who : depending on which, this is , respectively :
  137. Uid
  138. Pid
  139. Process Group id
  140. Errors are reported in linuxerror _only_. (priority can be negative)
  141. }
  142. begin
  143. errno:=0;
  144. if (which<prio_process) or (which>prio_user) then
  145. begin
  146. { We can save an interrupt here }
  147. getpriority:=0;
  148. linuxerror:=Sys_einval;
  149. end
  150. else
  151. begin
  152. GetPriority:=do_syscall(syscall_nr_GetPriority,which,who);
  153. LinuxError:=ErrNo;
  154. end;
  155. end;
  156. Procedure SetPriority(Which,Who,What:longint);
  157. {
  158. Set Priority of process, process group, or user.
  159. Which : selects what kind of priority is used.
  160. can be one of the following predefined Constants :
  161. Prio_User.
  162. Prio_PGrp.
  163. Prio_Process.
  164. Who : depending on value of which, this is, respectively :
  165. Uid
  166. Pid
  167. Process Group id
  168. what : A number between -20 and 20. -20 is most favorable, 20 least.
  169. 0 is the default.
  170. }
  171. begin
  172. errno:=0;
  173. if ((which<prio_process) or (which>prio_user)) or ((what<-20) or (what>20)) then
  174. linuxerror:=Sys_einval { We can save an interrupt here }
  175. else
  176. begin
  177. do_syscall(Syscall_nr_Setpriority,which,who,what);
  178. LinuxError:=ErrNo;
  179. end;
  180. end;
  181. Function GetPid:LongInt;
  182. {
  183. Get Process ID.
  184. }
  185. begin
  186. GetPID:=do_syscall(Syscall_nr_GetPID);
  187. LinuxError:=errno;
  188. end;
  189. Function GetPPid:LongInt;
  190. {
  191. Get Process ID of parent process.
  192. }
  193. begin
  194. GetPPid:=do_syscall(Syscall_nr_GetPPid);
  195. LinuxError:=errno;
  196. end;
  197. Function GetUid:Longint;
  198. {
  199. Get User ID.
  200. }
  201. begin
  202. GetUID:=do_syscall(Syscall_nr_GetUID);
  203. LinuxError:=ErrNo;
  204. end;
  205. Function GetEUid:Longint;
  206. {
  207. Get _effective_ User ID.
  208. }
  209. begin
  210. GetEUID:=do_syscall(Syscall_nr_GetEUID);
  211. LinuxError:=ErrNo;
  212. end;
  213. Function GetGid:Longint;
  214. {
  215. Get Group ID.
  216. }
  217. begin
  218. GetGID:=do_syscall(Syscall_nr_getgid);
  219. LinuxError:=ErrNo;
  220. end;
  221. Function GetEGid:Longint;
  222. {
  223. Get _effective_ Group ID.
  224. }
  225. begin
  226. GetEGID:=do_syscall(syscall_nr_getegid);
  227. LinuxError:=ErrNo;
  228. end;
  229. Procedure GetTimeOfDay(var tv:timeval);
  230. {
  231. Get the number of seconds since 00:00, January 1 1970, GMT
  232. the time NOT corrected any way
  233. }
  234. var tz : timezone;
  235. begin
  236. do_syscall(syscall_nr_gettimeofday,longint(@tv),longint(@tz));
  237. LinuxError:=Errno;
  238. end;
  239. Function GetTimeOfDay: longint;
  240. {
  241. Get the number of seconds since 00:00, January 1 1970, GMT
  242. the time NOT corrected any way
  243. }
  244. begin
  245. GetTimeOfDay:=Sys_time;
  246. LinuxError:=Errno;
  247. end;
  248. Function fdTruncate(fd,size:longint):boolean;
  249. begin
  250. fdtruncate:=do_syscall(syscall_nr_ftruncate,fd,size,0)=0;
  251. LinuxError:=Errno;
  252. end;
  253. Function fdFlush (fd : Longint) : Boolean;
  254. begin
  255. fdflush:=do_syscall(syscall_nr_fsync,fd)=0;
  256. LinuxError:=Errno;
  257. end;
  258. function sys_fcntl(Fd:longint;Cmd:longint;Arg:Longint):longint;
  259. begin
  260. sys_fcntl:=do_syscall(syscall_nr_fcntl,fd,cmd,arg);
  261. LinuxError:=Errno;
  262. end;
  263. Function Chmod(path:pathstr;Newmode:longint):Boolean;
  264. {
  265. Changes the permissions of a file.
  266. }
  267. begin
  268. path:=path+#0;
  269. chmod:=do_syscall(syscall_nr_chmod,longint(@path[1]),newmode)=0;
  270. LinuxError:=Errno;
  271. end;
  272. Function Chown(path:pathstr;NewUid,NewGid:longint):boolean;
  273. {
  274. Change the owner and group of a file.
  275. A user can only change the group to a group of which he is a member.
  276. The super-user can change uid and gid of any file.
  277. }
  278. begin
  279. path:=path+#0;
  280. ChOwn:=do_syscall(syscall_nr_chown,longint(@path[1]),newuid,newgid)=0;
  281. LinuxError:=Errno;
  282. end;
  283. Function Utime(path:pathstr;utim:utimebuf):boolean;
  284. begin
  285. UTime:=do_syscall(syscall_nr_utimes,longint(@path[1]),longint(@utim))=0;
  286. LinuxError:=Errno;
  287. end;
  288. Function Flock (fd,mode : longint) : boolean;
  289. begin
  290. Flock:=do_syscall(syscall_nr_flock,fd,mode)=0;
  291. LinuxError:=Errno;
  292. end;
  293. Function Lstat(Filename: PathStr;var Info:stat):Boolean;
  294. {
  295. Get all information on a link (the link itself), and return it in info.
  296. }
  297. begin
  298. FileName:=FileName+#0;
  299. LStat:=do_syscall(syscall_nr_lstat,longint(@filename[1]),longint(@info))=0;
  300. LinuxError:=Errno;
  301. end;
  302. Function Fstat(Fd:Longint;var Info:stat):Boolean;
  303. {
  304. Get all information on a file descriptor, and return it in info.
  305. }
  306. begin
  307. FStat:=do_syscall(syscall_nr_fstat,fd,longint(@info))=0;
  308. LinuxError:=Errno;
  309. end;
  310. Function FSStat(Path:Pathstr;Var Info:statfs):Boolean;
  311. {
  312. Get all information on a fileSystem, and return it in Info.
  313. Path is the name of a file/directory on the fileSystem you wish to
  314. investigate.
  315. }
  316. begin
  317. path:=path+#0;
  318. FSStat:=Do_Syscall(syscall_nr_statfs,longint(@path[1]),longint(@info))=0;
  319. LinuxError:=Errno;
  320. end;
  321. Function FSStat(Fd:Longint;Var Info:statfs):Boolean;
  322. {
  323. Get all information on a fileSystem, and return it in Info.
  324. Fd is the file descriptor of a file/directory on the fileSystem
  325. you wish to investigate.
  326. }
  327. begin
  328. FSStat:=do_syscall(syscall_nr_fstatfs,fd,longint(@info))=0;
  329. LinuxError:=Errno;
  330. end;
  331. Function Link(OldPath,NewPath:pathstr):boolean;
  332. {
  333. Proceduces a hard link from new to old.
  334. In effect, new will be the same file as old.
  335. }
  336. begin
  337. oldpath:=oldpath+#0;
  338. newpath:=newpath+#0;
  339. Link:=Do_Syscall(syscall_nr_link,longint(@oldpath[1]),longint(@newpath[1]))=0;
  340. LinuxError:=Errno;
  341. end;
  342. {
  343. Function SymLink(OldPath,newPath:pathstr):boolean;
  344. {
  345. Proceduces a soft link from new to old.
  346. }
  347. begin
  348. oldpath:=oldpath+#0;
  349. newpath:=newpath+#0;
  350. SymLink:=Do_Syscall(syscall_nr_symlink,longint(@oldpath[1]),longint(@newpath[1]))=0;
  351. LinuxError:=Errno;
  352. end;
  353. }
  354. Function Access(Path:Pathstr ;mode:longint):boolean;
  355. {
  356. Test users access rights on the specified file.
  357. Mode is a mask xosisting of one or more of R_OK, W_OK, X_OK, F_OK.
  358. R,W,X stand for read,write and Execute access, simultaneously.
  359. F_OK checks whether the test would be allowed on the file.
  360. i.e. It checks the search permissions in all directory components
  361. of the path.
  362. The test is done with the real user-ID, instead of the effective.
  363. If access is denied, or an error occurred, false is returned.
  364. If access is granted, true is returned.
  365. Errors other than no access,are reported in linuxerror.
  366. }
  367. begin
  368. path:=path+#0;
  369. Access:=do_syscall(syscall_nr_access,mode,longint(@path[1]))=0;
  370. LinuxError:=Errno;
  371. end;
  372. Function Dup(oldfile:longint;var newfile:longint):Boolean;
  373. {
  374. Copies the filedescriptor oldfile to newfile
  375. }
  376. begin
  377. newfile:=Do_syscall(syscall_nr_dup,oldfile);
  378. LinuxError:=Errno;
  379. Dup:=(LinuxError=0);
  380. end;
  381. Function Dup2(oldfile,newfile:longint):Boolean;
  382. {
  383. Copies the filedescriptor oldfile to newfile
  384. }
  385. begin
  386. do_syscall(syscall_nr_dup2,oldfile,newfile);
  387. LinuxError:=Errno;
  388. Dup2:=(LinuxError=0);
  389. end;
  390. Function Select(N:longint;readfds,writefds,exceptfds:PFDSet;TimeOut:PTimeVal):longint;
  391. {
  392. Select checks whether the file descriptor sets in readfs/writefs/exceptfs
  393. have changed.
  394. }
  395. begin
  396. Select:=do_syscall(syscall_nr_select,n,longint(readfds),longint(writefds),longint(exceptfds),longint(timeout));
  397. LinuxError:=Errno;
  398. end;
  399. Function AssignPipe(var pipe_in,pipe_out:longint):boolean;
  400. {
  401. Sets up a pair of file variables, which act as a pipe. The first one can
  402. be read from, the second one can be written to.
  403. If the operation was unsuccesful, linuxerror is set.
  404. }
  405. var
  406. pip : tpipe;
  407. begin
  408. do_syscall(syscall_nr_pipe,longint(@pip));
  409. LinuxError:=Errno;
  410. pipe_in:=pip[1];
  411. pipe_out:=pip[2];
  412. AssignPipe:=(LinuxError=0);
  413. end;
  414. Function PClose(Var F:text) :longint;
  415. var
  416. pl : ^longint;
  417. res : longint;
  418. begin
  419. do_syscall(syscall_nr_close,Textrec(F).Handle);
  420. { closed our side, Now wait for the other - this appears to be needed ?? }
  421. pl:=@(textrec(f).userdata[2]);
  422. waitpid(pl^,@res,0);
  423. pclose:=res shr 8;
  424. end;
  425. Function PClose(Var F:file) : longint;
  426. var
  427. pl : ^longint;
  428. res : longint;
  429. begin
  430. do_syscall(syscall_nr_close,filerec(F).Handle);
  431. { closed our side, Now wait for the other - this appears to be needed ?? }
  432. pl:=@(filerec(f).userdata[2]);
  433. waitpid(pl^,@res,0);
  434. pclose:=res shr 8;
  435. end;
  436. Function mkFifo(pathname:string;mode:longint):boolean;
  437. begin
  438. pathname:=pathname+#0;
  439. mkfifo:=do_syscall(syscall_nr_mknod,longint(@pathname[1]),mode or STAT_IFIFO,0)=0;
  440. LinuxError:=Errno;
  441. end;
  442. Function Kill(Pid:longint;Sig:longint):integer;
  443. {
  444. Send signal 'sig' to a process, or a group of processes.
  445. If Pid > 0 then the signal is sent to pid
  446. pid=-1 to all processes except process 1
  447. pid < -1 to process group -pid
  448. Return value is zero, except for case three, where the return value
  449. is the number of processes to which the signal was sent.
  450. }
  451. begin
  452. kill:=do_syscall(syscall_nr_kill,pid,sig);
  453. if kill<0 THEN
  454. Kill:=0;
  455. LinuxError:=Errno;
  456. end;
  457. Procedure SigProcMask(How:longint;SSet,OldSSet:PSigSet);
  458. {
  459. Change the list of currently blocked signals.
  460. How determines which signals will be blocked :
  461. SigBlock : Add SSet to the current list of blocked signals
  462. SigUnBlock : Remove the signals in SSet from the list of blocked signals.
  463. SigSetMask : Set the list of blocked signals to SSet
  464. if OldSSet is non-null, the old set will be saved there.
  465. }
  466. begin
  467. do_syscall(syscall_nr_sigprocmask,longint(how),longint(sset),longint(oldsset));
  468. LinuxError:=Errno;
  469. end;
  470. Function SigPending:SigSet;
  471. {
  472. Allows examination of pending signals. The signal mask of pending
  473. signals is set in SSet
  474. }
  475. Var
  476. dummy : Sigset;
  477. begin
  478. do_syscall(syscall_nr_sigpending,longint(@dummy));
  479. LinuxError:=Errno;
  480. sigpending:=dummy;
  481. end;
  482. Procedure SigSuspend(Mask:Sigset);
  483. {
  484. Set the signal mask with Mask, and suspend the program until a signal
  485. is received.
  486. }
  487. begin
  488. do_syscall(syscall_nr_sigsuspend,longint(@mask));
  489. LinuxError:=Errno;
  490. end;
  491. Function NanoSleep(const req : timespec;var rem : timespec) : longint;
  492. begin
  493. NanoSleep:=Do_SysCall(syscall_nr_nanosleep,longint(@req),longint(@rem));
  494. LinuxError:=Errno;
  495. end;
  496. Function IOCtl(Handle,Ndx: Longint;Data: Pointer):boolean;
  497. {
  498. Interface to Unix ioctl call.
  499. Performs various operations on the filedescriptor Handle.
  500. Ndx describes the operation to perform.
  501. Data points to data needed for the Ndx function. The structure of this
  502. data is function-dependent.
  503. }
  504. begin
  505. IOCtl:=Do_Syscall(syscall_nr_ioctl,handle,ndx,longint(data))=0;
  506. LinuxError:=Errno;
  507. end;
  508. function MMap(const m:tmmapargs):longint;
  509. begin
  510. {Last argument (offset) is actually 64-bit under BSD. Therefore extra 0}
  511. MMap:=do_syscall(syscall_nr_mmap,m.address,m.size,m.prot,m.flags,m.fd,m.offset,0);
  512. LinuxError:=Errno;
  513. end;
  514. function MUnMap (P : Pointer; Size : Longint) : Boolean;
  515. begin
  516. MUnMap:=do_syscall(syscall_nr_munmap,longint(P),Size)=0;
  517. LinuxError:=Errno;
  518. end;
  519. function signal(signum:longint;Handler:signalhandler):signalhandler;
  520. var sa,osa : sigactionrec;
  521. begin
  522. sa.handler.sh:=handler;
  523. FillChar(sa.sa_mask,sizeof(sigset),#0);
  524. sa.sa_flags := 0;
  525. { if (sigintr and signum) =0 then {restart behaviour needs libc}
  526. sa.sa_flags :=sa.sa_flags or SA_RESTART;}
  527. sigaction(signum,@sa,@osa);
  528. if ErrNo<>0 then
  529. signal:=NIL
  530. else
  531. signal:=osa.handler.sh;
  532. LinuxError:=Errno;
  533. end;
  534. function Clone(func:TCloneFunc;sp:pointer;flags:longint;args:pointer):longint; assembler;
  535. asm
  536. pushl %esi
  537. movl 12(%ebp), %esi // get stack addr
  538. subl $4, %esi
  539. movl 20(%ebp), %eax // get __arg
  540. movl %eax, (%esi)
  541. subl $4, %esi
  542. movl 8(%ebp), %eax // get __fn
  543. movl %eax, (%esi)
  544. pushl 16(%ebp)
  545. pushl %esi
  546. mov syscall_nr_rfork, %eax
  547. int $0x80 // call actualsyscall
  548. jb .L2
  549. test %edx, %edx
  550. jz .L1
  551. movl %esi,%esp
  552. popl %eax
  553. call %eax
  554. addl $8, %esp
  555. call halt // Does not return
  556. .L2:
  557. mov %eax,ErrNo
  558. mov $-1,%eax
  559. jmp .L1
  560. // jmp PIC_PLT(HIDENAME(cerror))
  561. .L1:
  562. addl $8, %esp
  563. popl %esi
  564. end;
  565. {
  566. * Architecture specific syscalls (i386) using the SYSARCH pseudo call
  567. }
  568. {$packrecords C}
  569. TYPE uint=CARDINAL;
  570. CONST
  571. I386_GET_LDT =0;
  572. I386_SET_LDT =1;
  573. { I386_IOPL }
  574. I386_GET_IOPERM =3;
  575. I386_SET_IOPERM =4;
  576. { xxxxx }
  577. I386_VM86 =6;
  578. {
  579. type i386_ldt_args = record
  580. int start : longint;
  581. union descriptor *descs;
  582. int num;
  583. end;
  584. }
  585. type
  586. i386_ioperm_args = record
  587. start : uint;
  588. length : uint;
  589. enable : longint;
  590. end;
  591. i386_vm86_args = record
  592. sub_op : longint; { sub-operation to perform }
  593. sub_args : pchar; { args }
  594. end;
  595. sysarch_args = record
  596. op : longint;
  597. parms : pchar;
  598. end;
  599. {
  600. int i386_get_ldt __P((int, union descriptor *, int));
  601. int i386_set_ldt __P((int, union descriptor *, int));
  602. int i386_get_ioperm __P((unsigned int, unsigned int *, int *));
  603. int i386_set_ioperm __P((unsigned int, unsigned int, int));
  604. int i386_vm86 __P((int, void *));
  605. int i386_set_watch __P((int watchnum, unsigned int watchaddr, int size,
  606. int access, struct dbreg * d));
  607. int i386_clr_watch __P((int watchnum, struct dbreg * d));
  608. }
  609. Function IOPerm(From,Num:CARDINAL;Value:Longint):boolean;
  610. var sg : i386_ioperm_args;
  611. sa : sysarch_args;
  612. begin
  613. sg.start:=From;
  614. sg.length:=Num;
  615. sg.enable:=value;
  616. sa.op:=i386_SET_IOPERM;
  617. sa.parms:=@sg;
  618. IOPerm:=do_syscall(syscall_nr_sysarch,longint(@sa))=0;
  619. LinuxError:=ErrNo;
  620. end;
  621. {
  622. $Log$
  623. Revision 1.4 2001-01-22 07:25:10 marco
  624. * IOPERM for FreeBSD. Port routines moved from linsysca to Unix again .
  625. Revision 1.3 2000/10/26 22:51:12 peter
  626. * nano sleep (merged)
  627. Revision 1.2 2000/09/18 13:14:50 marco
  628. * Global Linux +bsd to (rtl/freebsd rtl/unix rtl/linux structure)
  629. Revision 1.3 2000/09/11 14:05:31 marco
  630. * FreeBSD support and removed old signalhandling
  631. Revision 1.2 2000/07/13 11:33:47 michael
  632. + removed logs
  633. }