mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-07 23:58:31 +02:00
* fpreadlink(pathstr) moved to unxovl (since not platform specific),
small fixes for "make all OPT='-dFPC_USE_LIBC'
This commit is contained in:
parent
f9152c2c6b
commit
19c44b76f2
@ -103,36 +103,13 @@ begin
|
|||||||
fpsymlink:=do_syscall(syscall_nr_symlink,TSysParam(oldname),TSysParam(newname));
|
fpsymlink:=do_syscall(syscall_nr_symlink,TSysParam(oldname),TSysParam(newname));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
|
||||||
Function fpReadLink(name,linkname:pchar;maxlen:cint):cint;
|
|
||||||
|
|
||||||
begin
|
|
||||||
fpreadlink:=do_syscall(syscall_nr_readlink, TSysParam(name),TSysParam(linkname),maxlen);
|
|
||||||
end;
|
|
||||||
}
|
|
||||||
|
|
||||||
Function fpReadLink(Name:pathstr):pathstr;
|
|
||||||
{
|
|
||||||
Read a link (where it points to)
|
|
||||||
}
|
|
||||||
var
|
|
||||||
LinkName : pathstr;
|
|
||||||
i : cint;
|
|
||||||
begin
|
|
||||||
Name:=Name+#0;
|
|
||||||
i:=fpReadLink(@Name[1],@LinkName[1],high(linkname));
|
|
||||||
if i>0 then
|
|
||||||
begin
|
|
||||||
linkname[0]:=chr(i);
|
|
||||||
fpReadLink:=LinkName;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
fpReadLink:='';
|
|
||||||
end;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2003-11-13 13:11:55 marco
|
Revision 1.4 2004-01-01 16:10:23 marco
|
||||||
|
* fpreadlink(pathstr) moved to unxovl (since not platform specific),
|
||||||
|
small fixes for "make all OPT='-dFPC_USE_LIBC'
|
||||||
|
|
||||||
|
Revision 1.3 2003/11/13 13:11:55 marco
|
||||||
* Linuxerror remove + hdr+log added
|
* Linuxerror remove + hdr+log added
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,11 +25,14 @@ Function fpLstat(path:pchar;Info:pstat):cint;
|
|||||||
Function fpLstat(Filename: PathStr;Info:pstat):cint;
|
Function fpLstat(Filename: PathStr;Info:pstat):cint;
|
||||||
Function fpSymlink(oldname,newname:pchar):cint;
|
Function fpSymlink(oldname,newname:pchar):cint;
|
||||||
Function fpReadLink(name,linkname:pchar;maxlen:size_t):cint;
|
Function fpReadLink(name,linkname:pchar;maxlen:size_t):cint;
|
||||||
Function fpReadLink(name:PathStr):PathStr;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 2003-11-19 11:46:55 marco
|
Revision 1.5 2004-01-01 16:10:23 marco
|
||||||
|
* fpreadlink(pathstr) moved to unxovl (since not platform specific),
|
||||||
|
small fixes for "make all OPT='-dFPC_USE_LIBC'
|
||||||
|
|
||||||
|
Revision 1.4 2003/11/19 11:46:55 marco
|
||||||
* changes due to the previous *BSD changes. Mainly moving constants from
|
* changes due to the previous *BSD changes. Mainly moving constants from
|
||||||
unix to systypes.inc (which acts as unxtypes.inc)
|
unix to systypes.inc (which acts as unxtypes.inc)
|
||||||
|
|
||||||
|
@ -28,11 +28,8 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
|
|||||||
function FpAccess (pathname : pchar; amode : cint): cint; cdecl; external name 'access';
|
function FpAccess (pathname : pchar; amode : cint): cint; cdecl; external name 'access';
|
||||||
function FpChdir (path : pchar): cint; cdecl; external name 'chdir';
|
function FpChdir (path : pchar): cint; cdecl; external name 'chdir';
|
||||||
function FpClose (fd : cint): cint; cdecl; external name 'close';
|
function FpClose (fd : cint): cint; cdecl; external name 'close';
|
||||||
//{$ifndef FPC_IS_SYSTEM}
|
|
||||||
Function FpClosedir (var dirp : Dir): cInt; cdecl; external name 'closedir';
|
Function FpClosedir (var dirp : Dir): cInt; cdecl; external name 'closedir';
|
||||||
//{$else}
|
|
||||||
function FpClosedir (dirp : pdir): cint; cdecl; external name 'closedir';
|
function FpClosedir (dirp : pdir): cint; cdecl; external name 'closedir';
|
||||||
//{$endif}
|
|
||||||
function FpDup (oldd:cint):cint; cdecl; external name 'dup';
|
function FpDup (oldd:cint):cint; cdecl; external name 'dup';
|
||||||
function FpDup2 (oldd:cint;newd:cint):cint; cdecl; external name 'dup2';
|
function FpDup2 (oldd:cint;newd:cint):cint; cdecl; external name 'dup2';
|
||||||
function FpExecve (path : pchar; argv : ppchar; envp: ppchar): cint; cdecl; external name 'execve';
|
function FpExecve (path : pchar; argv : ppchar; envp: ppchar): cint; cdecl; external name 'execve';
|
||||||
@ -44,28 +41,22 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
|
|||||||
function FpOpen (path: pchar; flags : cint; mode: TMode):cint; cdecl; external name 'open';
|
function FpOpen (path: pchar; flags : cint; mode: TMode):cint; cdecl; external name 'open';
|
||||||
function FpOpendir (dirname : pchar): pdir; cdecl; external name 'opendir';
|
function FpOpendir (dirname : pchar): pdir; cdecl; external name 'opendir';
|
||||||
function FpRead (fd: cint; buf: pchar; nbytes : TSize): TSSize; cdecl; external name 'read';
|
function FpRead (fd: cint; buf: pchar; nbytes : TSize): TSSize; cdecl; external name 'read';
|
||||||
//{$ifdef FPC_IS_SYSTEM}
|
|
||||||
function FpReaddir (dirp : pdir) : pdirent;cdecl; external name 'readdir';
|
function FpReaddir (dirp : pdir) : pdirent;cdecl; external name 'readdir';
|
||||||
//{$ELSE}
|
|
||||||
Function FpReaddir (var dirp : Dir) : pDirent;cdecl; external name 'readdir';
|
Function FpReaddir (var dirp : Dir) : pDirent;cdecl; external name 'readdir';
|
||||||
//{$endif}
|
|
||||||
function FpRename (old : pchar; newpath: pchar): cint; cdecl;external name 'rename';
|
function FpRename (old : pchar; newpath: pchar): cint; cdecl;external name 'rename';
|
||||||
function FpRmdir (path : pchar): cint; cdecl; external name 'rmdir';
|
function FpRmdir (path : pchar): cint; cdecl; external name 'rmdir';
|
||||||
// {$ifdef FPC_IS_SYSTEM}
|
|
||||||
function FpSigaction (sig: cint;var act : sigactionrec; var oact : sigactionrec): cint; cdecl; external name 'sigaction';
|
function FpSigaction (sig: cint;var act : sigactionrec; var oact : sigactionrec): cint; cdecl; external name 'sigaction';
|
||||||
// {$else}
|
|
||||||
Function FPSigaction (sig: cInt; act :pSigActionRec;oact:pSigActionRec):cint;cdecl; external name 'sigaction';
|
Function FPSigaction (sig: cInt; act :pSigActionRec;oact:pSigActionRec):cint;cdecl; external name 'sigaction';
|
||||||
// {$endif}
|
|
||||||
|
|
||||||
{$ifdef BSD}
|
{$ifdef BSD}
|
||||||
function FPSigProcMask(how:cint;nset : psigset;oset : psigset):cint;cdecl; external name 'sigprocmask';
|
function FPSigProcMask(how:cint;nset : psigset;oset : psigset):cint;cdecl; external name 'sigprocmask';
|
||||||
{$endif}
|
{$endif}
|
||||||
function FpStat (path: pchar; var buf : stat): cint; cdecl; external name 'stat';
|
function FpStat (path: pchar; var buf : stat): cint; cdecl; external name 'stat';
|
||||||
{$ifdef FPC_IS_SYSTEM}
|
// {$ifdef FPC_IS_SYSTEM}
|
||||||
function FpTime (tloc:ptime_t): time_t; cdecl; external name 'time';
|
function FpTime (tloc:ptime_t): time_t; cdecl; external name 'time';
|
||||||
{$else}
|
// {$else}
|
||||||
Function FpTime (var tloc : TTime): TTime; cdecl; external name 'time';
|
Function FpTime (var tloc : TTime): TTime; cdecl; external name 'time';
|
||||||
{$endif}
|
// {$endif}
|
||||||
function FpUname (var name: utsname): cint; cdecl; external name 'uname';
|
function FpUname (var name: utsname): cint; cdecl; external name 'uname';
|
||||||
function FpUnlink (path: pchar): cint; cdecl; external name 'unlink';
|
function FpUnlink (path: pchar): cint; cdecl; external name 'unlink';
|
||||||
function FpWaitpid (pid : TPid; stat_loc : pcint; options: cint): TPid; cdecl; external name 'waitpid';
|
function FpWaitpid (pid : TPid; stat_loc : pcint; options: cint): TPid; cdecl; external name 'waitpid';
|
||||||
@ -84,14 +75,21 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
|
|||||||
Function FpGetegid : TGid;cdecl;external name 'getegid';
|
Function FpGetegid : TGid;cdecl;external name 'getegid';
|
||||||
Function FpSetuid (uid : TUid): cInt;cdecl;external name 'setuid';
|
Function FpSetuid (uid : TUid): cInt;cdecl;external name 'setuid';
|
||||||
Function FpSetgid (gid : TGid): cInt;cdecl;external name 'setgid';
|
Function FpSetgid (gid : TGid): cInt;cdecl;external name 'setgid';
|
||||||
Function FpGetgroups (gidsetsize : cInt; var grouplist : tgrparr):cint; cdecl;external name 'getgroups';
|
Function FpGetgroups (gidsetsize : cInt; var grouplist : tgrparr):cint; cdecl;external name 'getgroups';
|
||||||
Function FpGetpgrp : TPid; cdecl;external name 'getpgrp';
|
Function FpGetpgrp : TPid; cdecl;external name 'getpgrp';
|
||||||
Function FpSetsid : TPid; cdecl;external name 'setsid';
|
Function FpSetsid : TPid; cdecl;external name 'setsid';
|
||||||
Function FpPipe (var fildes : tfildes):cInt; cdecl;external name 'pipe';
|
Function FpPipe (var fildes : tfildes):cInt; cdecl;external name 'pipe';
|
||||||
|
Function FpFcntl (fildes : cInt; cmd : cInt): cInt; cdecl external name 'fcntl';
|
||||||
|
Function FpFcntl (fildes : cInt; cmd : cInt; arg :cInt): cInt; cdecl external name 'fcntl';
|
||||||
|
Function FpFcntl (fildes : cInt; cmd : cInt; var arg : flock): cInt; cdecl external name 'fcntl';
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 2004-01-01 14:09:14 marco
|
Revision 1.5 2004-01-01 16:10:23 marco
|
||||||
|
* fpreadlink(pathstr) moved to unxovl (since not platform specific),
|
||||||
|
small fixes for "make all OPT='-dFPC_USE_LIBC'
|
||||||
|
|
||||||
|
Revision 1.4 2004/01/01 14:09:14 marco
|
||||||
* FPC_USE_LIBC fixes
|
* FPC_USE_LIBC fixes
|
||||||
|
|
||||||
Revision 1.3 2003/12/30 15:43:20 marco
|
Revision 1.3 2003/12/30 15:43:20 marco
|
||||||
|
@ -14,10 +14,6 @@
|
|||||||
|
|
||||||
**********************************************************************}
|
**********************************************************************}
|
||||||
|
|
||||||
{I textrec.inc}
|
|
||||||
{I filerec.inc}
|
|
||||||
|
|
||||||
|
|
||||||
Function StatFS(Path:Pathstr;Var Info:Tstatfs):cint;
|
Function StatFS(Path:Pathstr;Var Info:Tstatfs):cint;
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -31,9 +27,32 @@ begin
|
|||||||
statfs:=statfs(pchar(@path[1]),info);
|
statfs:=statfs(pchar(@path[1]),info);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Function fpReadLink(Name:pathstr):pathstr;
|
||||||
|
{
|
||||||
|
Read a link (where it points to)
|
||||||
|
}
|
||||||
|
var
|
||||||
|
LinkName : pathstr;
|
||||||
|
i : cint;
|
||||||
|
begin
|
||||||
|
Name:=Name+#0;
|
||||||
|
i:=fpReadLink(@Name[1],@LinkName[1],high(linkname));
|
||||||
|
if i>0 then
|
||||||
|
begin
|
||||||
|
linkname[0]:=chr(i);
|
||||||
|
fpReadLink:=LinkName;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
fpReadLink:='';
|
||||||
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2003-12-30 12:27:44 marco
|
Revision 1.2 2004-01-01 16:10:23 marco
|
||||||
|
* fpreadlink(pathstr) moved to unxovl (since not platform specific),
|
||||||
|
small fixes for "make all OPT='-dFPC_USE_LIBC'
|
||||||
|
|
||||||
|
Revision 1.1 2003/12/30 12:27:44 marco
|
||||||
* FPC_USE_LIBC
|
* FPC_USE_LIBC
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,11 +17,16 @@
|
|||||||
Function PClose(Var F:file) : cint;
|
Function PClose(Var F:file) : cint;
|
||||||
Function PClose (Var F:text) : cint;
|
Function PClose (Var F:text) : cint;
|
||||||
Function StatFS(Path:Pathstr;Var Info:Tstatfs):cint;
|
Function StatFS(Path:Pathstr;Var Info:Tstatfs):cint;
|
||||||
|
Function fpReadLink(Name:pathstr):pathstr;
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2003-12-30 12:27:44 marco
|
Revision 1.2 2004-01-01 16:10:23 marco
|
||||||
|
* fpreadlink(pathstr) moved to unxovl (since not platform specific),
|
||||||
|
small fixes for "make all OPT='-dFPC_USE_LIBC'
|
||||||
|
|
||||||
|
Revision 1.1 2003/12/30 12:27:44 marco
|
||||||
* FPC_USE_LIBC
|
* FPC_USE_LIBC
|
||||||
|
|
||||||
Revision 1.1 2003/06/01 15:23:46 marco
|
Revision 1.1 2003/06/01 15:23:46 marco
|
||||||
|
Loading…
Reference in New Issue
Block a user