settimeo.inc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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; 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 settimeofday(tp:ptimeval;tzp:ptimezone):cint;
  27. begin
  28. result:=stime(@tp^.tv_sec);
  29. end;
  30. {$else}
  31. {$ifdef FPC_USE_LIBC}
  32. function settimeofday(tp:ptimeval;tzp:ptimezone):cint; external clib name 'settimeofday';
  33. {$else}
  34. function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
  35. begin
  36. settimeofday:=do_SysCall(Syscal_nr_settimeofday,TSysParam(@tp),tzp);
  37. end;
  38. {$endof}
  39. {$endif}
  40. {
  41. $Log$
  42. Revision 1.2 2004-10-27 04:22:04 marco
  43. * cvs log and extra endif
  44. }