settimeo.inc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2004 by Michael Van Canneyt,
  4. member of the Free Pascal development team.
  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. {$ifdef beos}
  12. {$ifdef i386}
  13. {$define usestime}
  14. {$endif}
  15. {$endif}
  16. {$ifdef usestime}
  17. {$ifdef FPC_USE_LIBC}
  18. function stime (t:ptime_t):cint; cdecl; external name 'stime';
  19. {$else}
  20. function stime (t:ptime_t):cint;
  21. begin
  22. stime:=do_SysCall(Syscall_nr_stime,TSysParam(t));
  23. end;
  24. {$endif}
  25. function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
  26. begin
  27. settimeofday:=stime(@tp^.tv_sec);
  28. end;
  29. {$else}
  30. {$ifdef FPC_USE_LIBC}
  31. function settimeofday(tp:ptimeval;tzp:ptimezone):cint; cdecl; external clib name 'settimeofday';
  32. {$else}
  33. function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
  34. begin
  35. settimeofday:=do_SysCall(Syscall_nr_settimeofday,TSysParam(@tp),TSysParam(tzp));
  36. end;
  37. {$endif}
  38. {$endif}