unxsysc.inc 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2001 by Free Pascal development team
  5. Some calls for the unix unit.
  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 fsync (fd : cint) : cint;
  13. begin
  14. fsync := do_SysCall(syscall_nr_fsync, fd);
  15. end;
  16. Function fpFlock (fd,mode : cint) : cint;
  17. begin
  18. fpflock:=do_Syscall(Syscall_nr_flock,fd,mode);
  19. end;
  20. Function StatFS(Path:Pchar;Var Info:tstatfs):cint;
  21. {
  22. Get all information on a fileSystem, and return it in Info.
  23. Path is the name of a file/directory on the fileSystem you wish to
  24. investigate.
  25. }
  26. begin
  27. StatFS:=(do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(@Info)));
  28. end;
  29. Function fStatFS(Fd:cint;Var Info:tstatfs):cint;
  30. {
  31. Get all information on a fileSystem, and return it in Info.
  32. Fd is the file descriptor of a file/directory on the fileSystem
  33. you wish to investigate.
  34. }
  35. begin
  36. fStatFS:=(do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(@info)));
  37. end;
  38. {--------------------------------
  39. Port IO functions
  40. --------------------------------}
  41. {$ifdef cpui386}
  42. Function IOperm (From,Num : cuint; Value : cint) : boolean;
  43. {
  44. Set permissions on NUM ports starting with port FROM to VALUE
  45. this works ONLY as root.
  46. }
  47. begin
  48. IOPerm:=do_Syscall(Syscall_nr_ioperm,from,num,value)=0;
  49. end;
  50. Function IoPL(Level : cint) : Boolean;
  51. begin
  52. IOPL:=do_Syscall(Syscall_nr_iopl,level)=0;
  53. end;
  54. {$endif cpui386}
  55. {
  56. $Log$
  57. Revision 1.8 2005-02-13 20:01:38 peter
  58. * include file cleanup
  59. Revision 1.7 2004/11/14 12:21:08 marco
  60. * moved some calls from unix to baseunix. Darwin untested.
  61. Revision 1.6 2004/11/03 15:00:43 marco
  62. * Pathstr eliminated
  63. Revision 1.5 2004/04/22 17:17:23 peter
  64. * x86-64 fixes
  65. Revision 1.4 2004/01/01 16:10:23 marco
  66. * fpreadlink(pathstr) moved to unxovl (since not platform specific),
  67. small fixes for "make all OPT='-dFPC_USE_LIBC'
  68. Revision 1.3 2003/11/13 13:11:55 marco
  69. * Linuxerror remove + hdr+log added
  70. }