settimeo.inc 654 B

12345678910111213141516171819202122232425262728293031323334
  1. {$ifdef linux}
  2. {$ifdef i386}
  3. {$define usestime}
  4. {$endif}
  5. {$endif}
  6. {$ifdef usestime}
  7. {$ifdef FPC_USE_LIBC}
  8. function stime (t:ptime_t):cint; external name 'stime';
  9. {$else}
  10. function stime (t:ptime_t):cint;
  11. begin
  12. stime:=do_SysCall(Syscall_nr_stime,TSysParam(t));
  13. end;
  14. {$endif}
  15. function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
  16. begin
  17. result:=stime(@tp^.tv_sec);
  18. end;
  19. {$else}
  20. {$ifdef FPC_USE_LIBC}
  21. function settimeofday(tp:ptimeval;tzp:ptimezone):cint; external clib name 'settimeofday';
  22. {$else}
  23. function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
  24. begin
  25. settimeofday:=do_SysCall(Syscal_nr_settimeofday,TSysParam(@tp),tzp);
  26. end;
  27. {$endif}