2
0
Эх сурвалжийг харах

* hopefuly fix the fp* problems for stat and others

git-svn-id: trunk@8405 -
Almindor 18 жил өмнө
parent
commit
d2e4f53a13

+ 6 - 0
rtl/bsd/unxsysch.inc

@@ -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 ;
+
+

+ 8 - 19
rtl/freebsd/unxsysc.inc

@@ -61,38 +61,27 @@ END;
 end;
 end;
 *)
 *)
 
 
-Function  fsync (fd : cint) : cint;
-
+Function  fpfStatFS (Fd: cint; Info:pstatfs):cint;
 begin
 begin
-  fsync:=fpfSync(fd);
+  fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
 end;
 end;
 
 
-Function  fpFlock (fd,mode : longint) : cint;
+Function  fpStatFS  (Path:pchar; Info:pstatfs):cint;
 
 
 begin
 begin
- fpFlock:=do_syscall(syscall_nr_flock,fd,mode);
+  fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
 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.
-}
+Function  fpfsync (fd : cint) : cint;
 
 
 begin
 begin
- fStatFS:=fpfStatFS(fd, @info);
+  fpfsync:=do_SysCall(syscall_nr_fsync, fd);
 end;
 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.
-}
+Function  fpFlock (fd,mode : longint) : cint;
 
 
 begin
 begin
- StatFS:=fpStatFS(path, @info);
+ fpFlock:=do_syscall(syscall_nr_flock,fd,mode);
 end;
 end;
 
 
 // needs oldfpccall;
 // needs oldfpccall;

+ 9 - 19
rtl/linux/unxsysc.inc

@@ -13,38 +13,28 @@
 
 
  ***********************************************************************}
  ***********************************************************************}
 
 
-Function  fsync (fd : cint) : cint;
+Function  fpFlock (fd,mode : cint) : cint;
 begin
 begin
-  fsync := fpFSync(fd);
+  fpflock:=do_Syscall(Syscall_nr_flock,fd,mode);
 end;
 end;
 
 
-Function  fpFlock (fd,mode : cint) : cint;
+Function  fpfStatFS (Fd: cint; Info:pstatfs):cint;
 begin
 begin
-  fpflock:=do_Syscall(Syscall_nr_flock,fd,mode);
+  fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
 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
-  StatFS:=fpStatFS(Path, @Info);;
+  fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
 end;
 end;
 
 
-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.
-}
+Function  fpfsync (fd : cint) : cint;
+
 begin
 begin
-  fStatFS:=fpfStatFS(fd, @Info);
+  fpfsync:=do_SysCall(syscall_nr_fsync, fd);
 end;
 end;
 
 
-
 {--------------------------------
 {--------------------------------
       Port IO functions
       Port IO functions
 --------------------------------}
 --------------------------------}

+ 6 - 0
rtl/linux/unxsysch.inc

@@ -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 ;
+
+

+ 8 - 19
rtl/netbsd/unxsysc.inc

@@ -62,38 +62,27 @@ end;
 }
 }
 
 
 {$ifndef FPC_USE_LIBC}
 {$ifndef FPC_USE_LIBC}
-Function  fsync (fd : cint) : cint;
+Function  fpFlock (fd,mode : longint) : cint;
 
 
 begin
 begin
-  fsync:=fpfsync(fd);
+ fpFlock:=do_syscall(syscall_nr_flock,fd,mode);
 end;
 end;
 
 
-Function  fpFlock (fd,mode : longint) : cint;
-
+Function  fpfStatFS (Fd: cint; Info:pstatfs):cint;
 begin
 begin
- fpFlock:=do_syscall(syscall_nr_flock,fd,mode);
+  fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
 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.
-}
+Function  fpStatFS  (Path:pchar; Info:pstatfs):cint;
 
 
 begin
 begin
- fStatFS:=fpfstatFS(fd, @info);
+  fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
 end;
 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.
-}
+Function  fpfsync (fd : cint) : cint;
 
 
 begin
 begin
- StatFS:=fpStatFS(path, @info);
+  fpfsync:=do_SysCall(syscall_nr_fsync, fd);
 end;
 end;
 
 
 // needs oldfpccall;
 // needs oldfpccall;

+ 9 - 19
rtl/openbsd/unixsysc.inc

@@ -62,38 +62,28 @@ end;
 }
 }
 
 
 {$ifndef FPC_USE_LIBC}
 {$ifndef FPC_USE_LIBC}
-Function  fsync (fd : cint) : cint;
+
+Function  fpFlock (fd,mode : longint) : cint;
 
 
 begin
 begin
-  fsync:=do_syscall(syscall_nr_fsync,fd);
+ Flock:=do_syscall(syscall_nr_flock,fd,mode);
 end;
 end;
 
 
-Function  Flock (fd,mode : longint) : cint;
-
+Function  fpfStatFS (Fd: cint; Info:pstatfs):cint;
 begin
 begin
- Flock:=do_syscall(syscall_nr_flock,fd,mode);
+  fpfstatfs:=do_SysCall(SysCall_nr_fstatfs,fd,TSysParam(info))
 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.
-}
+Function  fpStatFS  (Path:pchar; Info:pstatfs):cint;
 
 
 begin
 begin
- fStatFS:=do_syscall(syscall_nr_fstatfs,fd,longint(@info));
+  fpstatfs:=do_SysCall(SysCall_nr_statfs,TSysParam(path),TSysParam(Info))
 end;
 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.
-}
+Function  fpfsync (fd : cint) : cint;
 
 
 begin
 begin
- StatFS:=do_syscall(syscall_nr_statfs,longint(path),longint(@info));
+  fpfsync:=do_SysCall(syscall_nr_fsync, fd);
 end;
 end;
 
 
 // needs oldfpccall;
 // needs oldfpccall;

+ 16 - 15
rtl/unix/unix.pp

@@ -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

+ 7 - 5
rtl/unix/unxdeclh.inc

@@ -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';