unxsysc.inc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 fpFlock (fd,mode : cint) : cint;
  12. begin
  13. fpflock:=do_Syscall(Syscall_nr_flock,fd,mode);
  14. end;
  15. Function fpfStatFS (Fd: cint; Info:pstatfs):cint;
  16. begin
  17. {$ifdef android}
  18. fpfstatfs:=-1;
  19. {$else}
  20. fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
  21. {$endif android}
  22. end;
  23. Function fpStatFS (Path:pchar; Info:pstatfs):cint;
  24. begin
  25. {$ifdef android}
  26. fpStatFS:=-1;
  27. {$else}
  28. fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
  29. {$endif android}
  30. end;
  31. Function fpfsync (fd : cint) : cint;
  32. begin
  33. fpfsync:=do_SysCall(syscall_nr_fsync, fd);
  34. end;
  35. {$ifndef android}
  36. {--------------------------------
  37. Port IO functions
  38. --------------------------------}
  39. {$ifdef cpui386}
  40. Function IOperm (From,Num : cuint; Value : cint) : boolean;
  41. {
  42. Set permissions on NUM ports starting with port FROM to VALUE
  43. this works ONLY as root.
  44. }
  45. begin
  46. IOPerm:=do_Syscall(Syscall_nr_ioperm,from,num,value)=0;
  47. end;
  48. Function IoPL(Level : cint) : Boolean;
  49. begin
  50. IOPL:=do_Syscall(Syscall_nr_iopl,level)=0;
  51. end;
  52. {$endif cpui386}
  53. {$endif android}