* fpsettimeofday.

This commit is contained in:
marco 2004-12-02 18:24:35 +00:00
parent d3b001f8a4
commit 0d1d1a2c1b
4 changed files with 33 additions and 14 deletions

View File

@ -58,9 +58,9 @@ property errno : cint read fpgeterrno write fpseterrno;
{$i bunxovlh.inc}
{$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}
function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
{$endif}
implementation
@ -95,7 +95,10 @@ end.
{
$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
Revision 1.12 2004/11/19 13:15:14 marco

View File

@ -55,10 +55,17 @@ procedure fpseterrno(err:longint);
property errno : cint read fpgeterrno write fpseterrno;
{$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
{$i bunxmain.inc} { implementation}
{$i bunxovl.inc} { redefs and overloads implementation}
{$i settimeo.inc}
{$ifdef ver1_0}
// MvdV 1.0 is buggy in calling externals it seems. dunno what exactly
@ -82,7 +89,10 @@ end.
{
$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.
Revision 1.10 2004/11/14 12:21:08 marco

View File

@ -248,7 +248,7 @@ var
begin
GetDate (Year, Month, Day,dow);
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) ;
Settimeofday(@tv,nil);
fpSettimeofday(@tv,nil);
end;
procedure SetDate(Year,Month,Day:Word);
@ -258,7 +258,7 @@ var
begin
GetTime ( Hour, Min, Sec, Sec100 );
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Min, Sec ) ;
Settimeofday(@tv,nil);
fpSettimeofday(@tv,nil);
end;
Function SetDateTime(Year,Month,Day,hour,minute,second:Word) : Boolean;
@ -266,7 +266,7 @@ var
tv : timeval;
begin
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) ;
SetDatetime:=Settimeofday(@tv,nil)=0;
SetDatetime:=fpSettimeofday(@tv,nil)=0;
end;
Procedure GetTime(Var Hour, Minute, Second, Sec100: Word);
@ -1045,7 +1045,10 @@ End.
{
$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
Revision 1.37 2004/10/31 16:20:58 peter

View File

@ -30,28 +30,31 @@ begin
end;
{$endif}
function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
begin
settimeofday:=stime(@tp^.tv_sec);
fpsettimeofday:=stime(@tp^.tv_sec);
end;
{$else}
{$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}
function settimeofday(tp:ptimeval;tzp:ptimezone):cint;
function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
begin
settimeofday:=do_SysCall(Syscall_nr_settimeofday,TSysParam(@tp),TSysParam(tzp));
fpsettimeofday:=do_SysCall(Syscall_nr_settimeofday,TSysParam(@tp),TSysParam(tzp));
end;
{$endif}
{$endif}
{
$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
Revision 1.4 2004/10/30 21:18:23 marco