]> gitweb.factorcode.org Git - factor.git/commitdiff
file-systems on openbsd
authorsheeple <sheeple@slate.internal.stack-effects.com>
Tue, 2 Dec 2008 21:59:01 +0000 (15:59 -0600)
committersheeple <sheeple@slate.internal.stack-effects.com>
Tue, 2 Dec 2008 21:59:01 +0000 (15:59 -0600)
basis/io/unix/files/freebsd/freebsd.factor
basis/io/unix/files/netbsd/netbsd.factor
basis/io/unix/files/openbsd/openbsd.factor
basis/unix/getfsstat/openbsd/authors.txt [new file with mode: 0644]
basis/unix/getfsstat/openbsd/openbsd.factor [new file with mode: 0644]
basis/unix/getfsstat/openbsd/tags.txt [new file with mode: 0644]
basis/unix/statfs/authors.txt [deleted file]
basis/unix/statfs/openbsd/openbsd.factor
basis/unix/statfs/statfs-tests.factor [deleted file]
basis/unix/statfs/statfs.factor [deleted file]
basis/unix/statfs/tags.txt [deleted file]

index 16ef9f61d225600565e3de29b26273bf384564a3..2c8f4bb438b30d7bd9c3fcd97cb850f4cdb9eda6 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.c-types alien.syntax combinators
 io.backend io.files io.unix.files kernel math system unix
-unix.statfs unix.statvfs.freebsd ;
+unix.statvfs.freebsd ;
 IN: io.unix.files.freebsd
 
 M: freebsd file-system-statvfs ( path -- byte-array )
index 1bd8ba4f674e1090665f4e82876909614534d6dd..7140847f9a5d003e552486f99835ee479654d5ca 100644 (file)
@@ -2,8 +2,8 @@
 ! 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.unix.files io.files unix.statvfs.netbsd ;
+io.encodings.utf8 alien.strings unix.types io.unix.files
+io.files unix.statvfs.netbsd ;
 IN: io.unix.files.netbsd
 
 TUPLE: netbsd-file-system-info < unix-file-system-info
index 463cbde675ec058e10ba9aadbd9805f3c164de5e..8c8f7c154b2bf79d7a286a7bbf156cd1805b29dc 100644 (file)
@@ -1,16 +1,23 @@
 ! Copyright (C) 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien.syntax accessors combinators kernel
-unix.types math system io.backend alien.c-types unix
-io.files io.unix.files unix.statvfs.openbsd ;
+USING: accessors alien.c-types alien.strings alien.syntax
+combinators io.backend io.files io.unix.files kernel math
+sequences system unix unix.getfsstat.openbsd grouping
+unix.statfs.openbsd unix.statvfs.openbsd unix.types ;
 IN: io.unix.files.openbsd
 
+TUPLE: freebsd-file-system-info < unix-file-system-info
+io-size sync-writes sync-reads async-writes async-reads 
+owner ;
+
+M: openbsd new-file-system-info freebsd-file-system-info new ;
+
 M: openbsd file-system-statfs
     "statfs" <c-object> tuck statfs io-error ;
 
 M: openbsd statfs>file-system-info ( file-system-info statfs -- file-system-info' )
     {
-        [ statfs-f_flag >>flags ]
+        [ statfs-f_flags >>flags ]
         [ statfs-f_bsize >>block-size ]
         [ statfs-f_iosize >>io-size ]
         [ statfs-f_blocks >>blocks ]
@@ -26,7 +33,7 @@ M: openbsd statfs>file-system-info ( file-system-info statfs -- file-system-info
         [ statfs-f_fsid >>id ]
         [ statfs-f_namemax >>name-max ]
         [ statfs-f_owner >>owner ]
-        [ statfs-f_spare >>spare ]
+        [ statfs-f_spare >>spare ]
         [ statfs-f_fstypename alien>native-string >>type ]
         [ statfs-f_mntonname alien>native-string >>mount-point ]
         [ statfs-f_mntfromname alien>native-string >>device-name ]
@@ -39,3 +46,9 @@ M: openbsd statvfs>file-system-info ( file-system-info statvfs -- file-system-in
     {
         [ statvfs-f_frsize >>preferred-block-size ]
     } cleave ;
+
+M: openbsd file-systems ( -- seq )
+    f 0 0 getfsstat dup io-error
+    "statfs" <c-array> dup dup length 0 getfsstat io-error 
+    "statfs" heap-size group 
+    [ statfs-f_mntonname alien>native-string file-system-info ] map ;
diff --git a/basis/unix/getfsstat/openbsd/authors.txt b/basis/unix/getfsstat/openbsd/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/unix/getfsstat/openbsd/openbsd.factor b/basis/unix/getfsstat/openbsd/openbsd.factor
new file mode 100644 (file)
index 0000000..8bf692b
--- /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.openbsd
+
+: MNT_WAIT        1       ; ! synchronously wait for I/O to complete
+: MNT_NOWAIT      2       ; ! start all I/O, but do not wait for it
+: MNT_LAZY        3       ; ! push data not written by filesystem syncer
+
+FUNCTION: int getfsstat ( statfs* buf, int bufsize, int flags ) ;
diff --git a/basis/unix/getfsstat/openbsd/tags.txt b/basis/unix/getfsstat/openbsd/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
diff --git a/basis/unix/statfs/authors.txt b/basis/unix/statfs/authors.txt
deleted file mode 100644 (file)
index b4bd0e7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Doug Coleman
\ No newline at end of file
index 98bf140af760eba8f3459cd38859d123b62b2334..378e335c115e265760775a941cc740ce676de4bc 100644 (file)
@@ -27,7 +27,7 @@ C-STRUCT: statfs
     { { "u_int32_t" 3 } "f_spare" }
     { { "char" MFSNAMELEN } "f_fstypename" }
     { { "char" MNAMELEN } "f_mntonname" }
-    { { "char" MNAMELEN } "f_mntfromname" } ;
-    ! { "mount_info" "mount_info" } ;
+    { { "char" MNAMELEN } "f_mntfromname" }
+    { { "char" 160 } "mount_info" } ;
 
 FUNCTION: int statfs ( char* path, statvfs* buf ) ;
diff --git a/basis/unix/statfs/statfs-tests.factor b/basis/unix/statfs/statfs-tests.factor
deleted file mode 100644 (file)
index 39bc77f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: tools.test unix.statfs ;
-IN: unix.statfs.tests
diff --git a/basis/unix/statfs/statfs.factor b/basis/unix/statfs/statfs.factor
deleted file mode 100644 (file)
index 7d1bebc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
-USING: sequences system vocabs.loader combinators accessors
-kernel math.order sorting ;
-IN: unix.statfs
-
-os {
-    { linux   [ "unix.statfs.linux"   require ] }
-    { macosx  [ "unix.statfs.macosx"  require ] }
-    { freebsd [ "unix.statfs.freebsd" require ] }
-    { openbsd [ "unix.statfs.openbsd" require ] }
-    { netbsd  [ ] }
-} case
diff --git a/basis/unix/statfs/tags.txt b/basis/unix/statfs/tags.txt
deleted file mode 100644 (file)
index 6bf6830..0000000
+++ /dev/null
@@ -1 +0,0 @@
-unportable