settimeo.inc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2004 by Michael Van Canneyt,
  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. {$ifdef linux}
  13. {$ifdef i386}
  14. {$define usestime}
  15. {$endif}
  16. {$endif}
  17. {$ifdef usestime}
  18. {$ifdef FPC_USE_LIBC}
  19. function stime (t:ptime_t):cint; cdecl; external name 'stime';
  20. {$else}
  21. function stime (t:ptime_t):cint;
  22. begin
  23. stime:=do_SysCall(Syscall_nr_stime,TSysParam(t));
  24. end;
  25. {$endif}
  26. function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
  27. begin
  28. fpsettimeofday:=stime(@tp^.tv_sec);
  29. end;
  30. {$else}
  31. {$ifdef FPC_USE_LIBC}
  32. //function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint; cdecl; external clib name 'settimeofday';
  33. {$else}
  34. function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
  35. begin
  36. fpsettimeofday:=do_SysCall(Syscall_nr_settimeofday,TSysParam(@tp),TSysParam(tzp));
  37. end;
  38. {$endif}
  39. {$endif}
  40. {
  41. $Log$
  42. Revision 1.6 2004-12-02 18:24:35 marco
  43. * fpsettimeofday.
  44. Revision 1.5 2004/10/31 18:49:02 marco
  45. * cdecl for FPC_USE_LIBC
  46. Revision 1.4 2004/10/30 21:18:23 marco
  47. * more commits from unix interface cleanup
  48. Revision 1.3 2004/10/27 04:22:29 marco
  49. *** empty log message ***
  50. Revision 1.2 2004/10/27 04:22:04 marco
  51. * cvs log and extra endif
  52. }