mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-29 01:21:36 +01:00
* remove sysutils
This commit is contained in:
parent
4a4c940fc4
commit
5ef188da6f
@ -66,7 +66,7 @@ Procedure AddDisk(const path:string);
|
|||||||
Implementation
|
Implementation
|
||||||
|
|
||||||
Uses
|
Uses
|
||||||
Strings,SysUtils,Unix,BaseUnix,Syscall;
|
Strings,Unix,BaseUnix,Syscall;
|
||||||
|
|
||||||
|
|
||||||
{$i sysnr.inc}
|
{$i sysnr.inc}
|
||||||
@ -227,15 +227,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure GetDate(Var Year, Month, MDay, WDay: Word);
|
Procedure GetDate(Var Year, Month, MDay, WDay: Word);
|
||||||
|
var
|
||||||
var t :TSystemtime;
|
tz:timeval;
|
||||||
|
hour,min,sec : word;
|
||||||
Begin
|
begin
|
||||||
sysutils.getlocaltime(t);
|
fpgettimeofday(@tz,nil);
|
||||||
mday:=t.day;
|
EpochToLocal(tz.tv_sec,year,month,mday,hour,min,sec);
|
||||||
month:=t.month;
|
|
||||||
year:=t.year;
|
|
||||||
Wday:=weekday(Year,Month,MDay);
|
Wday:=weekday(Year,Month,MDay);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -270,15 +269,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure GetTime(Var Hour, Minute, Second, Sec100: Word);
|
Procedure GetTime(Var Hour, Minute, Second, Sec100: Word);
|
||||||
|
var
|
||||||
var t :TSystemtime;
|
tz:timeval;
|
||||||
|
year,month,day : word;
|
||||||
Begin
|
begin
|
||||||
sysutils.getlocaltime(t);
|
fpgettimeofday(@tz,nil);
|
||||||
sec100:=0;
|
EpochToLocal(tz.tv_sec,year,month,day,hour,minute,second);
|
||||||
second:=t.second;
|
sec100:=tz.tv_usec div 10000;
|
||||||
minute:=t.minute;
|
|
||||||
hour :=t.hour;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure packtime(var t : datetime;var p : longint);
|
Procedure packtime(var t : datetime;var p : longint);
|
||||||
@ -378,10 +375,10 @@ Begin
|
|||||||
cmdline2^:=pchar(realPath);
|
cmdline2^:=pchar(realPath);
|
||||||
cmdline2[1]:=nil;
|
cmdline2[1]:=nil;
|
||||||
end;
|
end;
|
||||||
{The child does the actual exec, and then exits}
|
{The child does the actual exec, and then exits}
|
||||||
fpExecv(pchar(realPath),cmdline2);
|
fpExecv(pchar(realPath),cmdline2);
|
||||||
{If the execve fails, we return an exitvalue of 127, to let it be known}
|
{If the execve fails, we return an exitvalue of 127, to let it be known}
|
||||||
fpExit(127);
|
fpExit(127);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if pid=-1 then {Fork failed}
|
if pid=-1 then {Fork failed}
|
||||||
@ -389,12 +386,12 @@ Begin
|
|||||||
DosError:=8;
|
DosError:=8;
|
||||||
exit
|
exit
|
||||||
end;
|
end;
|
||||||
{We're in the parent, let's wait.}
|
{We're in the parent, let's wait.}
|
||||||
LastDosExitCode:=WaitProcess(pid); // WaitPid and result-convert
|
LastDosExitCode:=WaitProcess(pid); // WaitPid and result-convert
|
||||||
if (LastDosExitCode>=0) and (LastDosExitCode<>127) then
|
if (LastDosExitCode>=0) and (LastDosExitCode<>127) then
|
||||||
DosError:=0
|
DosError:=0
|
||||||
else
|
else
|
||||||
DosError:=8; // perhaps one time give an better error
|
DosError:=8; // perhaps one time give an better error
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
@ -1047,7 +1044,10 @@ End.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.36 2004-10-30 20:55:54 marco
|
Revision 1.37 2004-10-31 16:20:58 peter
|
||||||
|
* remove sysutils
|
||||||
|
|
||||||
|
Revision 1.36 2004/10/30 20:55:54 marco
|
||||||
* unix interface cleanup
|
* unix interface cleanup
|
||||||
|
|
||||||
Revision 1.35 2004/09/25 15:09:57 peter
|
Revision 1.35 2004/09/25 15:09:57 peter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user