mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-03 08:09:53 +01:00
* time routines extracted
This commit is contained in:
parent
6cf4c07167
commit
f1e1a829ce
34
rtl/unix/settimeo.inc
Normal file
34
rtl/unix/settimeo.inc
Normal file
@ -0,0 +1,34 @@
|
||||
|
||||
{$ifdef linux}
|
||||
{$ifdef i386}
|
||||
{$define usestime}
|
||||
{$endif}
|
||||
{$endif}
|
||||
|
||||
{$ifdef usestime}
|
||||
|
||||
{$ifdef FPC_USE_LIBC}
|
||||
function stime (t:ptime_t):cint; external name 'stime';
|
||||
{$else}
|
||||
function stime (t:ptime_t):cint;
|
||||
begin
|
||||
stime:=do_SysCall(Syscall_nr_stime,TSysParam(t));
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
|
||||
|
||||
begin
|
||||
result:=stime(@tp^.tv_sec);
|
||||
end;
|
||||
{$else}
|
||||
|
||||
{$ifdef FPC_USE_LIBC}
|
||||
function settimeofday(tp:ptimeval;tzp:ptimezone):cint; external clib name 'settimeofday';
|
||||
{$else}
|
||||
function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
|
||||
|
||||
begin
|
||||
settimeofday:=do_SysCall(Syscal_nr_settimeofday,TSysParam(@tp),tzp);
|
||||
end;
|
||||
{$endif}
|
||||
Loading…
Reference in New Issue
Block a user