mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 04:52:17 +02:00
* fpsettimeofday.
This commit is contained in:
parent
d3b001f8a4
commit
0d1d1a2c1b
@ -58,9 +58,9 @@ property errno : cint read fpgeterrno write fpseterrno;
|
|||||||
{$i bunxovlh.inc}
|
{$i bunxovlh.inc}
|
||||||
|
|
||||||
{$ifdef FPC_USE_LIBC}
|
{$ifdef FPC_USE_LIBC}
|
||||||
function settimeofday(tp:ptimeval;tzp:ptimezone):cint; cdecl; external clib name 'settimeofday';
|
function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint; cdecl; external clib name 'settimeofday';
|
||||||
{$else}
|
{$else}
|
||||||
function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
|
function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -95,7 +95,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2004-12-02 15:11:42 marco
|
Revision 1.14 2004-12-02 18:24:35 marco
|
||||||
|
* fpsettimeofday.
|
||||||
|
|
||||||
|
Revision 1.13 2004/12/02 15:11:42 marco
|
||||||
* initial settimeofday
|
* initial settimeofday
|
||||||
|
|
||||||
Revision 1.12 2004/11/19 13:15:14 marco
|
Revision 1.12 2004/11/19 13:15:14 marco
|
||||||
|
@ -55,10 +55,17 @@ procedure fpseterrno(err:longint);
|
|||||||
property errno : cint read fpgeterrno write fpseterrno;
|
property errno : cint read fpgeterrno write fpseterrno;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
{$ifdef FPC_USE_LIBC}
|
||||||
|
function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint; cdecl; external clib name 'settimeofday';
|
||||||
|
{$else}
|
||||||
|
function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{$i bunxmain.inc} { implementation}
|
{$i bunxmain.inc} { implementation}
|
||||||
{$i bunxovl.inc} { redefs and overloads implementation}
|
{$i bunxovl.inc} { redefs and overloads implementation}
|
||||||
|
{$i settimeo.inc}
|
||||||
|
|
||||||
{$ifdef ver1_0}
|
{$ifdef ver1_0}
|
||||||
// MvdV 1.0 is buggy in calling externals it seems. dunno what exactly
|
// MvdV 1.0 is buggy in calling externals it seems. dunno what exactly
|
||||||
@ -82,7 +89,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.11 2004-11-19 13:15:14 marco
|
Revision 1.12 2004-12-02 18:24:35 marco
|
||||||
|
* fpsettimeofday.
|
||||||
|
|
||||||
|
Revision 1.11 2004/11/19 13:15:14 marco
|
||||||
* external rework. Mostly done.
|
* external rework. Mostly done.
|
||||||
|
|
||||||
Revision 1.10 2004/11/14 12:21:08 marco
|
Revision 1.10 2004/11/14 12:21:08 marco
|
||||||
|
@ -248,7 +248,7 @@ var
|
|||||||
begin
|
begin
|
||||||
GetDate (Year, Month, Day,dow);
|
GetDate (Year, Month, Day,dow);
|
||||||
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) ;
|
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) ;
|
||||||
Settimeofday(@tv,nil);
|
fpSettimeofday(@tv,nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetDate(Year,Month,Day:Word);
|
procedure SetDate(Year,Month,Day:Word);
|
||||||
@ -258,7 +258,7 @@ var
|
|||||||
begin
|
begin
|
||||||
GetTime ( Hour, Min, Sec, Sec100 );
|
GetTime ( Hour, Min, Sec, Sec100 );
|
||||||
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Min, Sec ) ;
|
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Min, Sec ) ;
|
||||||
Settimeofday(@tv,nil);
|
fpSettimeofday(@tv,nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function SetDateTime(Year,Month,Day,hour,minute,second:Word) : Boolean;
|
Function SetDateTime(Year,Month,Day,hour,minute,second:Word) : Boolean;
|
||||||
@ -266,7 +266,7 @@ var
|
|||||||
tv : timeval;
|
tv : timeval;
|
||||||
begin
|
begin
|
||||||
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) ;
|
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) ;
|
||||||
SetDatetime:=Settimeofday(@tv,nil)=0;
|
SetDatetime:=fpSettimeofday(@tv,nil)=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure GetTime(Var Hour, Minute, Second, Sec100: Word);
|
Procedure GetTime(Var Hour, Minute, Second, Sec100: Word);
|
||||||
@ -1045,7 +1045,10 @@ End.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.38 2004-10-31 17:11:52 marco
|
Revision 1.39 2004-12-02 18:24:35 marco
|
||||||
|
* fpsettimeofday.
|
||||||
|
|
||||||
|
Revision 1.38 2004/10/31 17:11:52 marco
|
||||||
* FPC_USE_LIBC fixes
|
* FPC_USE_LIBC fixes
|
||||||
|
|
||||||
Revision 1.37 2004/10/31 16:20:58 peter
|
Revision 1.37 2004/10/31 16:20:58 peter
|
||||||
|
@ -30,28 +30,31 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
|
function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
settimeofday:=stime(@tp^.tv_sec);
|
fpsettimeofday:=stime(@tp^.tv_sec);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$else}
|
{$else}
|
||||||
|
|
||||||
{$ifdef FPC_USE_LIBC}
|
{$ifdef FPC_USE_LIBC}
|
||||||
function settimeofday(tp:ptimeval;tzp:ptimezone):cint; cdecl; external clib name 'settimeofday';
|
//function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint; cdecl; external clib name 'settimeofday';
|
||||||
{$else}
|
{$else}
|
||||||
function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
|
function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
settimeofday:=do_SysCall(Syscall_nr_settimeofday,TSysParam(@tp),TSysParam(tzp));
|
fpsettimeofday:=do_SysCall(Syscall_nr_settimeofday,TSysParam(@tp),TSysParam(tzp));
|
||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.5 2004-10-31 18:49:02 marco
|
Revision 1.6 2004-12-02 18:24:35 marco
|
||||||
|
* fpsettimeofday.
|
||||||
|
|
||||||
|
Revision 1.5 2004/10/31 18:49:02 marco
|
||||||
* cdecl for FPC_USE_LIBC
|
* cdecl for FPC_USE_LIBC
|
||||||
|
|
||||||
Revision 1.4 2004/10/30 21:18:23 marco
|
Revision 1.4 2004/10/30 21:18:23 marco
|
||||||
|
Loading…
Reference in New Issue
Block a user