]> gitweb.factorcode.org Git - factor.git/commitdiff
file-systems works on netbsd now
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 3 Dec 2008 03:32:00 +0000 (21:32 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 3 Dec 2008 03:32:00 +0000 (21:32 -0600)
basis/io/unix/files/netbsd/netbsd.factor
basis/unix/getfsstat/netbsd/authors.txt [new file with mode: 0644]
basis/unix/getfsstat/netbsd/netbsd.factor [new file with mode: 0644]
basis/unix/getfsstat/netbsd/tags.txt [new file with mode: 0644]

index 7140847f9a5d003e552486f99835ee479654d5ca..c200331db5f76bf0e38c2cf5481a4c1db394c0e6 100644 (file)
@@ -3,15 +3,14 @@
 USING: alien.syntax kernel unix.stat math unix
 combinators system io.backend accessors alien.c-types
 io.encodings.utf8 alien.strings unix.types io.unix.files
-io.files unix.statvfs.netbsd ;
+io.files unix.statvfs.netbsd unix.getfsstat.netbsd
+grouping sequences ;
 IN: io.unix.files.netbsd
 
 TUPLE: netbsd-file-system-info < unix-file-system-info
 blocks-reserved files-reserved
-owner io-size
-sync-reads sync-writes
-async-reads async-writes
-idx mount-from spare ;
+owner io-size sync-reads sync-writes async-reads async-writes
+idx mount-from ;
 
 M: netbsd new-file-system-info netbsd-file-system-info new ;
 
@@ -40,10 +39,14 @@ M: netbsd statvfs>file-system-info ( file-system-info statvfs -- file-system-inf
         [ statvfs-f_fsid >>id ]
         [ statvfs-f_namemax >>name-max ]
         [ statvfs-f_owner >>owner ]
-        [ statvfs-f_spare >>spare ]
+        [ 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 ) ;
+M: netbsd file-systems ( -- array )
+    f 0 0 getvfsstat dup io-error
+    "statvfs" <c-array> dup dup length 0 getvfsstat io-error
+    "statvfs" heap-size group
+    [ statvfs-f_mntonname alien>native-string file-system-info ] map ;
diff --git a/basis/unix/getfsstat/netbsd/authors.txt b/basis/unix/getfsstat/netbsd/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/unix/getfsstat/netbsd/netbsd.factor b/basis/unix/getfsstat/netbsd/netbsd.factor
new file mode 100644 (file)
index 0000000..1c8941a
--- /dev/null
@@ -0,0 +1,10 @@
+! Copyright (C) 2008 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: alien.syntax ;
+IN: unix.getfsstat.netbsd
+
+: MNT_WAIT        1       ; inline ! synchronously wait for I/O to complete
+: MNT_NOWAIT      2       ; inline ! start all I/O, but do not wait for it 
+: MNT_LAZY        3       ; inline ! push data not written by filesystem syncer 
+
+FUNCTION: int getvfsstat ( statfs* buf, int bufsize, int flags ) ;
diff --git a/basis/unix/getfsstat/netbsd/tags.txt b/basis/unix/getfsstat/netbsd/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable