]> gitweb.factorcode.org Git - factor.git/commitdiff
fix netbsd file-system-info
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 30 Nov 2008 23:32:55 +0000 (17:32 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 30 Nov 2008 23:32:55 +0000 (17:32 -0600)
basis/io/unix/files/netbsd/netbsd.factor
basis/unix/statvfs/netbsd/netbsd.factor

index 429833a44434f334f92d05caaeda72c785498028..1bd8ba4f674e1090665f4e82876909614534d6dd 100644 (file)
@@ -2,13 +2,48 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.syntax kernel unix.stat math unix
 combinators system io.backend accessors alien.c-types
-io.encodings.utf8 alien.strings unix.types unix.statfs io.files ;
+io.encodings.utf8 alien.strings unix.types unix.statfs 
+io.unix.files io.files unix.statvfs.netbsd ;
 IN: io.unix.files.netbsd
 
 TUPLE: netbsd-file-system-info < unix-file-system-info
-owner io-size blocks-reserved
-sync-reads sync-writes async-reads async-writes
-fsidx fstype mnotonname mntfromname mount-from spare ;
+blocks-reserved files-reserved
+owner io-size
+sync-reads sync-writes
+async-reads async-writes
+idx mount-from spare ;
+
+M: netbsd new-file-system-info netbsd-file-system-info new ;
 
 M: netbsd file-system-statvfs
     "statvfs" <c-object> tuck statvfs io-error ;
+
+M: netbsd statvfs>file-system-info ( file-system-info statvfs -- file-system-info' )
+    {
+        [ statvfs-f_flag >>flags ]
+        [ statvfs-f_bsize >>block-size ]
+        [ statvfs-f_frsize >>preferred-block-size ]
+        [ statvfs-f_iosize >>io-size ]
+        [ statvfs-f_blocks >>blocks ]
+        [ statvfs-f_bfree >>blocks-free ]
+        [ statvfs-f_bavail >>blocks-available ]
+        [ statvfs-f_bresvd >>blocks-reserved ]
+        [ statvfs-f_files >>files ]
+        [ statvfs-f_ffree >>files-free ]
+        [ statvfs-f_favail >>files-available ]
+        [ statvfs-f_fresvd >>files-reserved ]
+        [ statvfs-f_syncreads >>sync-reads ]
+        [ statvfs-f_syncwrites >>sync-writes ]
+        [ statvfs-f_asyncreads >>async-reads ]
+        [ statvfs-f_asyncwrites >>async-writes ]
+        [ statvfs-f_fsidx >>idx ]
+        [ statvfs-f_fsid >>id ]
+        [ statvfs-f_namemax >>name-max ]
+        [ statvfs-f_owner >>owner ]
+        [ statvfs-f_spare >>spare ]
+        [ statvfs-f_fstypename alien>native-string >>type ]
+        [ statvfs-f_mntonname alien>native-string >>mount-point ]
+        [ statvfs-f_mntfromname alien>native-string >>device-name ]
+    } cleave ;
+
+FUNCTION: int statvfs ( char* path, statvfs* buf ) ;
index e67a74de633af4481ed2d0dc35730d3d4fc0d4c1..cf575c74b16d81e54aa1c84bc1e7035e75c90b5d 100644 (file)
@@ -32,4 +32,4 @@ C-STRUCT: statvfs
     { { "char" _VFS_MNAMELEN } "f_mntonname" }
     { { "char" _VFS_MNAMELEN } "f_mntfromname" } ;
 
-FUNCTION: int statvfs ( char* path, statvfs *buf ) ;
+FUNCTION: int statvfs ( char* path, statvfsbuf ) ;