mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 13:59:07 +02:00
* hopefuly fix the fp* problems for stat and others
git-svn-id: trunk@8405 -
This commit is contained in:
parent
7a94d05e23
commit
d2e4f53a13
@ -14,3 +14,9 @@
|
|||||||
|
|
||||||
function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; external name 'FPC_SYSC_GETTIMEOFDAY';
|
function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; external name 'FPC_SYSC_GETTIMEOFDAY';
|
||||||
|
|
||||||
|
function fpfStatFS (Fd: cint; Info:pstatfs):cint;
|
||||||
|
function fpStatFS (Path:pchar; Info:pstatfs):cint;
|
||||||
|
function fpfsync (fd : cint) : cint;
|
||||||
|
Function fpFlock (fd,mode : cint) : cint ;
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,10 +61,21 @@ END;
|
|||||||
end;
|
end;
|
||||||
*)
|
*)
|
||||||
|
|
||||||
Function fsync (fd : cint) : cint;
|
Function fpfStatFS (Fd: cint; Info:pstatfs):cint;
|
||||||
|
begin
|
||||||
|
fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function fpStatFS (Path:pchar; Info:pstatfs):cint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
fsync:=fpfSync(fd);
|
fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function fpfsync (fd : cint) : cint;
|
||||||
|
|
||||||
|
begin
|
||||||
|
fpfsync:=do_SysCall(syscall_nr_fsync, fd);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function fpFlock (fd,mode : longint) : cint;
|
Function fpFlock (fd,mode : longint) : cint;
|
||||||
@ -73,28 +84,6 @@ begin
|
|||||||
fpFlock:=do_syscall(syscall_nr_flock,fd,mode);
|
fpFlock:=do_syscall(syscall_nr_flock,fd,mode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function fStatFS(Fd:Longint;Var Info:tstatfs):cint;
|
|
||||||
{
|
|
||||||
Get all information on a fileSystem, and return it in Info.
|
|
||||||
Fd is the file descriptor of a file/directory on the fileSystem
|
|
||||||
you wish to investigate.
|
|
||||||
}
|
|
||||||
|
|
||||||
begin
|
|
||||||
fStatFS:=fpfStatFS(fd, @info);
|
|
||||||
end;
|
|
||||||
|
|
||||||
Function StatFS(path:pchar;Var Info:tstatfs):cint;
|
|
||||||
{
|
|
||||||
Get all information on a fileSystem, and return it in Info.
|
|
||||||
Fd is the file descriptor of a file/directory on the fileSystem
|
|
||||||
you wish to investigate.
|
|
||||||
}
|
|
||||||
|
|
||||||
begin
|
|
||||||
StatFS:=fpStatFS(path, @info);
|
|
||||||
end;
|
|
||||||
|
|
||||||
// needs oldfpccall;
|
// needs oldfpccall;
|
||||||
Function intAssignPipe(var pipe_in,pipe_out:longint;var errn:cint):cint; oldfpccall;
|
Function intAssignPipe(var pipe_in,pipe_out:longint;var errn:cint):cint; oldfpccall;
|
||||||
{
|
{
|
||||||
|
@ -13,37 +13,27 @@
|
|||||||
|
|
||||||
***********************************************************************}
|
***********************************************************************}
|
||||||
|
|
||||||
Function fsync (fd : cint) : cint;
|
|
||||||
begin
|
|
||||||
fsync := fpFSync(fd);
|
|
||||||
end;
|
|
||||||
|
|
||||||
Function fpFlock (fd,mode : cint) : cint;
|
Function fpFlock (fd,mode : cint) : cint;
|
||||||
begin
|
begin
|
||||||
fpflock:=do_Syscall(Syscall_nr_flock,fd,mode);
|
fpflock:=do_Syscall(Syscall_nr_flock,fd,mode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Function fpfStatFS (Fd: cint; Info:pstatfs):cint;
|
||||||
Function StatFS(Path:Pchar;Var Info:tstatfs):cint;
|
|
||||||
{
|
|
||||||
Get all information on a fileSystem, and return it in Info.
|
|
||||||
Path is the name of a file/directory on the fileSystem you wish to
|
|
||||||
investigate.
|
|
||||||
}
|
|
||||||
begin
|
begin
|
||||||
StatFS:=fpStatFS(Path, @Info);;
|
fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function fStatFS(Fd:cint;Var Info:tstatfs):cint;
|
Function fpStatFS (Path:pchar; Info:pstatfs):cint;
|
||||||
{
|
|
||||||
Get all information on a fileSystem, and return it in Info.
|
|
||||||
Fd is the file descriptor of a file/directory on the fileSystem
|
|
||||||
you wish to investigate.
|
|
||||||
}
|
|
||||||
begin
|
begin
|
||||||
fStatFS:=fpfStatFS(fd, @Info);
|
fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Function fpfsync (fd : cint) : cint;
|
||||||
|
|
||||||
|
begin
|
||||||
|
fpfsync:=do_SysCall(syscall_nr_fsync, fd);
|
||||||
|
end;
|
||||||
|
|
||||||
{--------------------------------
|
{--------------------------------
|
||||||
Port IO functions
|
Port IO functions
|
||||||
|
@ -15,3 +15,9 @@
|
|||||||
|
|
||||||
function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; external name 'FPC_SYSC_GETTIMEOFDAY';
|
function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; external name 'FPC_SYSC_GETTIMEOFDAY';
|
||||||
|
|
||||||
|
function fpfStatFS (Fd: cint; Info:pstatfs):cint;
|
||||||
|
function fpStatFS (Path:pchar; Info:pstatfs):cint;
|
||||||
|
function fpfsync (fd : cint) : cint;
|
||||||
|
Function fpFlock (fd,mode : cint) : cint ;
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,38 +62,27 @@ end;
|
|||||||
}
|
}
|
||||||
|
|
||||||
{$ifndef FPC_USE_LIBC}
|
{$ifndef FPC_USE_LIBC}
|
||||||
Function fsync (fd : cint) : cint;
|
|
||||||
|
|
||||||
begin
|
|
||||||
fsync:=fpfsync(fd);
|
|
||||||
end;
|
|
||||||
|
|
||||||
Function fpFlock (fd,mode : longint) : cint;
|
Function fpFlock (fd,mode : longint) : cint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
fpFlock:=do_syscall(syscall_nr_flock,fd,mode);
|
fpFlock:=do_syscall(syscall_nr_flock,fd,mode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function fStatFS(Fd:Longint;Var Info:tstatfs):cint;
|
Function fpfStatFS (Fd: cint; Info:pstatfs):cint;
|
||||||
{
|
|
||||||
Get all information on a fileSystem, and return it in Info.
|
|
||||||
Fd is the file descriptor of a file/directory on the fileSystem
|
|
||||||
you wish to investigate.
|
|
||||||
}
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
fStatFS:=fpfstatFS(fd, @info);
|
fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function StatFS(path:pchar;Var Info:tstatfs):cint;
|
Function fpStatFS (Path:pchar; Info:pstatfs):cint;
|
||||||
{
|
|
||||||
Get all information on a fileSystem, and return it in Info.
|
|
||||||
Fd is the file descriptor of a file/directory on the fileSystem
|
|
||||||
you wish to investigate.
|
|
||||||
}
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
StatFS:=fpStatFS(path, @info);
|
fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function fpfsync (fd : cint) : cint;
|
||||||
|
|
||||||
|
begin
|
||||||
|
fpfsync:=do_SysCall(syscall_nr_fsync, fd);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// needs oldfpccall;
|
// needs oldfpccall;
|
||||||
|
@ -62,38 +62,28 @@ end;
|
|||||||
}
|
}
|
||||||
|
|
||||||
{$ifndef FPC_USE_LIBC}
|
{$ifndef FPC_USE_LIBC}
|
||||||
Function fsync (fd : cint) : cint;
|
|
||||||
|
|
||||||
begin
|
Function fpFlock (fd,mode : longint) : cint;
|
||||||
fsync:=do_syscall(syscall_nr_fsync,fd);
|
|
||||||
end;
|
|
||||||
|
|
||||||
Function Flock (fd,mode : longint) : cint;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Flock:=do_syscall(syscall_nr_flock,fd,mode);
|
Flock:=do_syscall(syscall_nr_flock,fd,mode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function fStatFS(Fd:Longint;Var Info:tstatfs):cint;
|
Function fpfStatFS (Fd: cint; Info:pstatfs):cint;
|
||||||
{
|
|
||||||
Get all information on a fileSystem, and return it in Info.
|
|
||||||
Fd is the file descriptor of a file/directory on the fileSystem
|
|
||||||
you wish to investigate.
|
|
||||||
}
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
fStatFS:=do_syscall(syscall_nr_fstatfs,fd,longint(@info));
|
fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function StatFS(path:pchar;Var Info:tstatfs):cint;
|
Function fpStatFS (Path:pchar; Info:pstatfs):cint;
|
||||||
{
|
|
||||||
Get all information on a fileSystem, and return it in Info.
|
|
||||||
Fd is the file descriptor of a file/directory on the fileSystem
|
|
||||||
you wish to investigate.
|
|
||||||
}
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
StatFS:=do_syscall(syscall_nr_statfs,longint(path),longint(@info));
|
fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
|
||||||
|
end;
|
||||||
|
|
||||||
|
Function fpfsync (fd : cint) : cint;
|
||||||
|
|
||||||
|
begin
|
||||||
|
fpfsync:=do_SysCall(syscall_nr_fsync, fd);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// needs oldfpccall;
|
// needs oldfpccall;
|
||||||
|
@ -96,17 +96,10 @@ Function W_STOPCODE (Signal: Integer): Integer;
|
|||||||
|
|
||||||
{** File Handling **}
|
{** File Handling **}
|
||||||
|
|
||||||
{$ifndef FPC_USE_LIBC} // defined using cdecl for libc.
|
|
||||||
// some of these are formally listed as deprecated, but specially statfs will remain for a while, no rush.
|
// some of these are formally listed as deprecated, but specially statfs will remain for a while, no rush.
|
||||||
Function fsync (fd : cint) : cint; deprecated;
|
Function fsync (fd : cint) : cint; deprecated;
|
||||||
Function fpFlock (fd,mode : cint) : cint ;
|
|
||||||
Function fStatFS (Fd: cint;Var Info:tstatfs):cint; deprecated;
|
Function fStatFS (Fd: cint;Var Info:tstatfs):cint; deprecated;
|
||||||
Function StatFS (Path:pchar;Var Info:tstatfs):cint; deprecated;
|
Function StatFS (Path:pchar;Var Info:tstatfs):cint; deprecated;
|
||||||
{$endif}
|
|
||||||
|
|
||||||
Function fpfStatFS (Fd: cint; Info:pstatfs):cint;
|
|
||||||
Function fpStatFS (Path:pchar; Info:pstatfs):cint;
|
|
||||||
Function fpfsync (fd : cint) : cint;
|
|
||||||
|
|
||||||
Function fpFlock (var T : text;mode : cint) : cint;
|
Function fpFlock (var T : text;mode : cint) : cint;
|
||||||
Function fpFlock (var F : File;mode : cint) : cint;
|
Function fpFlock (var F : File;mode : cint) : cint;
|
||||||
@ -1314,21 +1307,29 @@ Begin
|
|||||||
FSearch:=FSearch(path,dirlist,CurrentDirectoryFirst);
|
FSearch:=FSearch(path,dirlist,CurrentDirectoryFirst);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function fpfStatFS (Fd: cint; Info:pstatfs):cint;
|
Function fsync (fd : cint) : cint;
|
||||||
begin
|
begin
|
||||||
fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
|
fsync := fpFSync(fd);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function fpStatFS (Path:pchar; Info:pstatfs):cint;
|
Function StatFS(Path:Pchar;Var Info:tstatfs):cint;
|
||||||
|
{
|
||||||
|
Get all information on a fileSystem, and return it in Info.
|
||||||
|
Path is the name of a file/directory on the fileSystem you wish to
|
||||||
|
investigate.
|
||||||
|
}
|
||||||
begin
|
begin
|
||||||
fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
|
StatFS:=fpStatFS(Path, @Info);;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function fpfsync (fd : cint) : cint;
|
Function fStatFS(Fd:cint;Var Info:tstatfs):cint;
|
||||||
|
{
|
||||||
|
Get all information on a fileSystem, and return it in Info.
|
||||||
|
Fd is the file descriptor of a file/directory on the fileSystem
|
||||||
|
you wish to investigate.
|
||||||
|
}
|
||||||
begin
|
begin
|
||||||
fpfsync:=do_SysCall(syscall_nr_fsync, fd);
|
fStatFS:=fpfStatFS(fd, @Info);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Initialization
|
Initialization
|
||||||
|
@ -24,16 +24,18 @@ Function fpFlock (fd,mode : longint) : cint; cdecl; external clib name 'flock';
|
|||||||
{$endif solaris}
|
{$endif solaris}
|
||||||
|
|
||||||
{$ifdef beos}
|
{$ifdef beos}
|
||||||
Function fStatFS(Fd:Longint;Var Info:tstatfs):cint; cdecl; external clib name 'fstatvfs';
|
Function fpfStatFS(Fd:Longint; Info:pstatfs):cint; cdecl; external clib name 'fstatvfs';
|
||||||
{$else beos}
|
{$else beos}
|
||||||
Function fStatFS(Fd:Longint;Var Info:tstatfs):cint; cdecl; external clib name 'fstatfs';
|
Function fpfStatFS(Fd:Longint; Info:pstatfs):cint; cdecl; external clib name 'fstatfs';
|
||||||
{$endif beos}
|
{$endif beos}
|
||||||
|
|
||||||
Function fsync (fd : cint) : cint; cdecl; external clib name 'fsync';
|
Function fpfsync (fd : cint) : cint; cdecl; external clib name 'fsync';
|
||||||
|
|
||||||
{$ifdef beos}
|
{$ifdef beos}
|
||||||
Function StatFS (Path:pchar;Var Info:tstatfs):cint; cdecl; external clib name 'statvfs';
|
Function fpStatFS (Path:pchar; Info:pstatfs):cint; cdecl; external clib name 'statvfs';
|
||||||
{$else beos}
|
{$else beos}
|
||||||
Function StatFS (Path:pchar;Var Info:tstatfs):cint; cdecl; external clib name 'statfs';
|
Function fpStatFS (Path:pchar; Info:pstatfs):cint; cdecl; external clib name 'statfs';
|
||||||
{$endif beos}
|
{$endif beos}
|
||||||
|
|
||||||
function pipe (var fildes: filedesarray):cint; cdecl; external clib name 'pipe';
|
function pipe (var fildes: filedesarray):cint; cdecl; external clib name 'pipe';
|
||||||
function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; cdecl; external clib name 'gettimeofday';
|
function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; cdecl; external clib name 'gettimeofday';
|
||||||
|
Loading…
Reference in New Issue
Block a user