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

* few small freebsd fixes backported from debugging linux

marco 21 жил өмнө
parent
commit
fdf4095798

+ 19 - 17
rtl/bsd/unxsysc.inc

@@ -1,3 +1,17 @@
+{
+   $Id$
+   This file is part of the Free Pascal run time library.
+   Copyright (c) 2003 Marco van de Voort
+   member of the Free Pascal development team.
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+**********************************************************************}
 
 function fpNice(N:cint):cint;
 {
@@ -96,22 +110,10 @@ 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)
+   $Log$
+   Revision 1.4  2004-01-01 17:07:21  marco
+    * few small freebsd fixes backported from debugging linux
+
+
 }
-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;

+ 4 - 2
rtl/bsd/unxsysch.inc

@@ -20,14 +20,16 @@ Function fpLstat(path:pchar;Info:pstat):cint;
 Function fpLstat(Filename: PathStr;Info:pstat):cint;
 Function fpSymlink(oldname,newname:pchar):cint;
 Function fpReadLink(name,linkname:pchar;maxlen:cint):cint;
-Function fpReadLink(name:PathStr):PathStr;
 Function Fpmmap(start:pointer;len:size_t;prot:cint;flags:cint;fd:cint;offst:off_t):pointer; external name  'FPC_SYSC_MMAP';
 Function Fpmunmap(start:pointer;len:size_t):cint;  external name 'FPC_SYSC_MUNMAP';
 function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; external name 'FPC_SYSC_GETTIMEOFDAY';
 
 {
   $Log$
-  Revision 1.4  2003-12-30 12:26:21  marco
+  Revision 1.5  2004-01-01 17:07:21  marco
+   * few small freebsd fixes backported from debugging linux
+
+  Revision 1.4  2003/12/30 12:26:21  marco
    * FPC_USE_LIBC
 
 }

+ 15 - 1
rtl/freebsd/unixsysc.inc

@@ -86,6 +86,17 @@ begin
  fStatFS:=do_syscall(syscall_nr_fstatfs,fd,longint(@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:=do_syscall(syscall_nr_statfs,longint(path),longint(@info));
+end;
+
 // needs oldfpccall;
 Function intAssignPipe(var pipe_in,pipe_out:longint;var errn:cint):cint; {$ifndef ver1_0} oldfpccall;{$endif} 
 {
@@ -264,7 +275,10 @@ end;
 
 {
   $Log$
-  Revision 1.17  2003-12-30 12:32:30  marco
+  Revision 1.18  2004-01-01 17:07:21  marco
+   * few small freebsd fixes backported from debugging linux
+
+  Revision 1.17  2003/12/30 12:32:30  marco
   *** empty log message ***
 
   Revision 1.16  2003/11/19 17:11:40  marco