mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 23:29:13 +02:00
* Enhancements to make the compiler baseunix using.
This commit is contained in:
parent
ca54415fb0
commit
0525a73548
@ -86,6 +86,7 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
|
|||||||
Function FpLseek (fd : cInt; offset : TOff; whence : cInt): TOff;
|
Function FpLseek (fd : cInt; offset : TOff; whence : cInt): TOff;
|
||||||
Function FpTime (var tloc : TTime): TTime;
|
Function FpTime (var tloc : TTime): TTime;
|
||||||
Function FpFtruncate (fd : cInt; flength : TOff): cInt;
|
Function FpFtruncate (fd : cInt; flength : TOff): cInt;
|
||||||
|
Function FPSigaction (sig: cInt; act : pSigActionRec; oact : pSigActionRec): cint;
|
||||||
|
|
||||||
Function FpGetEnv (name : pChar): pChar;
|
Function FpGetEnv (name : pChar): pChar;
|
||||||
Function FpGetEnv (name : String): pChar;
|
Function FpGetEnv (name : String): pChar;
|
||||||
@ -106,7 +107,10 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2003-01-05 19:11:32 marco
|
Revision 1.3 2003-06-01 16:28:41 marco
|
||||||
|
* Enhancements to make the compiler baseunix using.
|
||||||
|
|
||||||
|
Revision 1.2 2003/01/05 19:11:32 marco
|
||||||
* small changes originating from introduction of Baseunix to FreeBSD
|
* small changes originating from introduction of Baseunix to FreeBSD
|
||||||
|
|
||||||
Revision 1.1 2002/12/18 16:49:02 marco
|
Revision 1.1 2002/12/18 16:49:02 marco
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
|
|
||||||
|
{$I textrec.inc}
|
||||||
|
{$I filerec.inc}
|
||||||
|
|
||||||
Function FpLink (existing : AnsiString; newone : AnsiString): cInt;
|
Function FpLink (existing : AnsiString; newone : AnsiString): cInt;
|
||||||
Begin
|
Begin
|
||||||
@ -100,12 +102,51 @@ Begin
|
|||||||
FpAccess:=FpAccess(pchar(pathname),amode);
|
FpAccess:=FpAccess(pchar(pathname),amode);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
Function FPFStat(var F:Text;Var Info:stat):Boolean;
|
||||||
|
{
|
||||||
|
Get all information on a text file, and return it in info.
|
||||||
|
}
|
||||||
|
begin
|
||||||
|
FPFStat:=FPFstat(TextRec(F).Handle,INfo)>0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function FPFStat(var F:File;Var Info:stat):Boolean;
|
||||||
|
{
|
||||||
|
Get all information on a untyped file, and return it in info.
|
||||||
|
}
|
||||||
|
begin
|
||||||
|
FPFStat:=FPFstat(FileRec(F).Handle,Info)>0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function FpSignal(signum:longint;Handler:signalhandler):signalhandler;
|
||||||
|
|
||||||
|
var sa,osa : sigactionrec;
|
||||||
|
|
||||||
|
begin
|
||||||
|
sa.sa_handler:=handler;
|
||||||
|
FillChar(sa.sa_mask,sizeof(sigset),#0);
|
||||||
|
sa.sa_flags := 0;
|
||||||
|
{ if (sigintr and signum) =0 then
|
||||||
|
{restart behaviour needs libc}
|
||||||
|
sa.sa_flags :=sa.sa_flags or SA_RESTART;
|
||||||
|
}
|
||||||
|
FPSigaction(signum,@sa,@osa);
|
||||||
|
if getErrNo<>0 then
|
||||||
|
fpsignal:=NIL
|
||||||
|
else
|
||||||
|
fpsignal:=osa.sa_handler;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2002-12-18 16:49:02 marco
|
Revision 1.2 2003-06-01 16:28:41 marco
|
||||||
|
* Enhancements to make the compiler baseunix using.
|
||||||
|
|
||||||
|
Revision 1.1 2002/12/18 16:49:02 marco
|
||||||
* New RTL. Linux system unit and baseunix operational.
|
* New RTL. Linux system unit and baseunix operational.
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -32,9 +32,20 @@ Function FpRename (old : AnsiString;newpath: AnsiString): cInt;
|
|||||||
Function FpStat (path: AnsiString; var buf : stat): cInt;
|
Function FpStat (path: AnsiString; var buf : stat): cInt;
|
||||||
Function FpAccess (pathname : AnsiString; aMode : cInt): cInt;
|
Function FpAccess (pathname : AnsiString; aMode : cInt): cInt;
|
||||||
|
|
||||||
|
Function FPFStat(var F:Text;Var Info:stat):Boolean;
|
||||||
|
Function FPFStat(var F:File;Var Info:stat):Boolean;
|
||||||
|
|
||||||
|
// added. Is a depreciated POSIX function that can be considered alias to
|
||||||
|
// sigaction
|
||||||
|
Function FpSignal(signum:longint;Handler:signalhandler):signalhandler;
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2002-12-18 16:49:02 marco
|
Revision 1.2 2003-06-01 16:28:41 marco
|
||||||
|
* Enhancements to make the compiler baseunix using.
|
||||||
|
|
||||||
|
Revision 1.1 2002/12/18 16:49:02 marco
|
||||||
* New RTL. Linux system unit and baseunix operational.
|
* New RTL. Linux system unit and baseunix operational.
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
|
|
||||||
function fpsigaddset(var nset : sigset_t;signo:cint): cint;
|
function fpsigaddset(var nset : tsigset;signo:cint): cint;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
if (signo<=0) or (signo > SIG_MAXSIG) Then
|
if (signo<=0) or (signo > SIG_MAXSIG) Then
|
||||||
@ -27,7 +27,7 @@ Begin
|
|||||||
fpsigaddset:=0;
|
fpsigaddset:=0;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
function fpsigdelset(var nset : sigset_t;signo:cint): cint;
|
function fpsigdelset(var nset : tsigset;signo:cint): cint;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
if (signo<=0) or (signo > SIG_MAXSIG) Then
|
if (signo<=0) or (signo > SIG_MAXSIG) Then
|
||||||
@ -39,7 +39,7 @@ Begin
|
|||||||
fpsigdelset:=0;
|
fpsigdelset:=0;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
function fpsigemptyset(var nset : sigset_t):cint;
|
function fpsigemptyset(var nset : tsigset):cint;
|
||||||
|
|
||||||
var i :longint;
|
var i :longint;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ Begin
|
|||||||
fpsigemptyset:=0;
|
fpsigemptyset:=0;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
function fpsigfillset(var nset : sigset_t):cint;
|
function fpsigfillset(var nset : tsigset):cint;
|
||||||
|
|
||||||
var i :longint;
|
var i :longint;
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ Begin
|
|||||||
fpsigfillset:=0;
|
fpsigfillset:=0;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
function fpsigismember(const nset : sigset_t;signo:cint): cint;
|
function fpsigismember(const nset : tsigset;signo:cint): cint;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
if (signo<=0) or (signo > SIG_MAXSIG) Then
|
if (signo<=0) or (signo > SIG_MAXSIG) Then
|
||||||
@ -73,7 +73,10 @@ End;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2002-12-18 16:50:39 marco
|
Revision 1.3 2003-06-01 16:28:41 marco
|
||||||
|
* Enhancements to make the compiler baseunix using.
|
||||||
|
|
||||||
|
Revision 1.2 2002/12/18 16:50:39 marco
|
||||||
* Unix RTL generic parts. Linux working, *BSD will follow shortly
|
* Unix RTL generic parts. Linux working, *BSD will follow shortly
|
||||||
|
|
||||||
Revision 1.1 2002/11/14 12:20:30 marco
|
Revision 1.1 2002/11/14 12:20:30 marco
|
||||||
|
Loading…
Reference in New Issue
Block a user