unxsysc.inc 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2001 by Free Pascal development team
  4. Some calls for the unix unit.
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. ***********************************************************************}
  11. Function fsync (fd : cint) : cint;
  12. begin
  13. fsync := do_SysCall(syscall_nr_fsync, fd);
  14. end;
  15. Function fpFlock (fd,mode : cint) : cint;
  16. begin
  17. fpflock:=do_Syscall(Syscall_nr_flock,fd,mode);
  18. end;
  19. Function StatFS(Path:Pchar;Var Info:tstatfs):cint;
  20. {
  21. Get all information on a fileSystem, and return it in Info.
  22. Path is the name of a file/directory on the fileSystem you wish to
  23. investigate.
  24. }
  25. begin
  26. StatFS:=(do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(@Info)));
  27. end;
  28. Function fStatFS(Fd:cint;Var Info:tstatfs):cint;
  29. {
  30. Get all information on a fileSystem, and return it in Info.
  31. Fd is the file descriptor of a file/directory on the fileSystem
  32. you wish to investigate.
  33. }
  34. begin
  35. fStatFS:=(do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(@info)));
  36. end;
  37. {--------------------------------
  38. Port IO functions
  39. --------------------------------}
  40. {$ifdef cpui386}
  41. Function IOperm (From,Num : cuint; Value : cint) : boolean;
  42. {
  43. Set permissions on NUM ports starting with port FROM to VALUE
  44. this works ONLY as root.
  45. }
  46. begin
  47. IOPerm:=do_Syscall(Syscall_nr_ioperm,from,num,value)=0;
  48. end;
  49. Function IoPL(Level : cint) : Boolean;
  50. begin
  51. IOPL:=do_Syscall(Syscall_nr_iopl,level)=0;
  52. end;
  53. {$endif cpui386}