mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 09:29:26 +02:00
+ Added some calls to make common API more efficient
This commit is contained in:
parent
14c5da0a9a
commit
2856256cb3
@ -497,13 +497,18 @@ Function GetEGid:Longint;
|
|||||||
|
|
||||||
Function fdOpen(pathname:string;flags:longint):longint;
|
Function fdOpen(pathname:string;flags:longint):longint;
|
||||||
Function fdOpen(pathname:string;flags,mode:longint):longint;
|
Function fdOpen(pathname:string;flags,mode:longint):longint;
|
||||||
|
Function fdOpen(pathname:pchar;flags:longint):longint;
|
||||||
|
Function fdOpen(pathname:pchar;flags,mode:longint):longint;
|
||||||
Function fdClose(fd:longint):boolean;
|
Function fdClose(fd:longint):boolean;
|
||||||
Function fdRead(fd:longint;var buf;size:longint):longint;
|
Function fdRead(fd:longint;var buf;size:longint):longint;
|
||||||
Function fdWrite(fd:longint;var buf;size:longint):longint;
|
Function fdWrite(fd:longint;var buf;size:longint):longint;
|
||||||
Function fdTruncate(fd,size:longint):boolean;
|
Function fdTruncate(fd,size:longint):boolean;
|
||||||
|
Function fdSeek (fd,pos,seektype :longint): longint;
|
||||||
|
Function fdFlush (fd : Longint) : Boolean;
|
||||||
Function Link(OldPath,NewPath:pathstr):boolean;
|
Function Link(OldPath,NewPath:pathstr):boolean;
|
||||||
Function SymLink(OldPath,NewPath:pathstr):boolean;
|
Function SymLink(OldPath,NewPath:pathstr):boolean;
|
||||||
Function UnLink(Path:pathstr):boolean;
|
Function UnLink(Path:pathstr):boolean;
|
||||||
|
Function UnLink(Path:pchar):Boolean;
|
||||||
Function Chown(path:pathstr;NewUid,NewGid:longint):boolean;
|
Function Chown(path:pathstr;NewUid,NewGid:longint):boolean;
|
||||||
Function Chmod(path:pathstr;Newmode:longint):boolean;
|
Function Chmod(path:pathstr;Newmode:longint):boolean;
|
||||||
Function Utime(path:pathstr;utim:utimbuf):boolean;
|
Function Utime(path:pathstr;utim:utimbuf):boolean;
|
||||||
@ -1215,6 +1220,25 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Function fdOpen(pathname:pchar;flags:longint):longint;
|
||||||
|
|
||||||
|
begin
|
||||||
|
fdOpen:=Sys_Open(pathname,flags,0);
|
||||||
|
LinuxError:=Errno;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Function fdOpen(pathname:pchar;flags,mode:longint):longint;
|
||||||
|
|
||||||
|
begin
|
||||||
|
fdOpen:=Sys_Open(pathname,flags,mode);
|
||||||
|
LinuxError:=Errno;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function fdClose(fd:longint):boolean;
|
Function fdClose(fd:longint):boolean;
|
||||||
begin
|
begin
|
||||||
fdClose:=(Sys_Close(fd)=0);
|
fdClose:=(Sys_Close(fd)=0);
|
||||||
@ -1251,6 +1275,31 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Function fdSeek (fd,pos,seektype :longint): longint;
|
||||||
|
{
|
||||||
|
Do a Seek on a file descriptor fd to position pos, starting from seektype
|
||||||
|
}
|
||||||
|
begin
|
||||||
|
fdseek:=Sys_LSeek (fd,pos,seektype);
|
||||||
|
LinuxError:=Errno;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Function fdFlush (fd : Longint) : Boolean;
|
||||||
|
|
||||||
|
|
||||||
|
var
|
||||||
|
SR: SysCallRegs;
|
||||||
|
|
||||||
|
begin
|
||||||
|
SR.reg2 := fd;
|
||||||
|
fdFlush := (SysCall(syscall_nr_fsync, SR)=0);
|
||||||
|
LinuxError:=Errno;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function Fcntl(Fd:Text;Cmd:integer):integer;
|
Function Fcntl(Fd:Text;Cmd:integer):integer;
|
||||||
{
|
{
|
||||||
Read or manipulate a file.(See also fcntl (2) )
|
Read or manipulate a file.(See also fcntl (2) )
|
||||||
@ -1530,6 +1579,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Function UnLink(Path:pchar):Boolean;
|
||||||
|
{
|
||||||
|
Removes the file in 'Path' (that is, it decreases the link count with one.
|
||||||
|
if the link count is zero, the file is removed from the disk.
|
||||||
|
}
|
||||||
|
begin
|
||||||
|
Unlink:=(Sys_unlink(path)=0);
|
||||||
|
linuxerror:=errno;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function Umask(Mask:Integer):integer;
|
Function Umask(Mask:Integer):integer;
|
||||||
{
|
{
|
||||||
@ -3162,7 +3221,10 @@ End.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.5 1998-04-10 15:23:03 michael
|
Revision 1.6 1998-04-15 11:23:53 michael
|
||||||
|
+ Added some calls to make common API more efficient
|
||||||
|
|
||||||
|
Revision 1.5 1998/04/10 15:23:03 michael
|
||||||
+ Pclose now returns exit status of process
|
+ Pclose now returns exit status of process
|
||||||
|
|
||||||
Revision 1.4 1998/04/07 13:08:29 michael
|
Revision 1.4 1998/04/07 13:08:29 michael
|
||||||
|
Loading…
Reference in New Issue
Block a user