]> Zhao Yanbai Git Server - minix.git/commitdiff
libc stubs for statvfs, contributed by Buccapatnam Tirumala, Gautam.
authorBen Gras <ben@minix3.org>
Wed, 23 Jun 2010 23:51:29 +0000 (23:51 +0000)
committerBen Gras <ben@minix3.org>
Wed, 23 Jun 2010 23:51:29 +0000 (23:51 +0000)
lib/libc/posix/Makefile.inc
lib/libc/posix/_fstatvfs.c [new file with mode: 0644]
lib/libc/posix/_statvfs.c [new file with mode: 0644]
lib/libc/syscall/Makefile.inc
lib/libc/syscall/fstatvfs.S [new file with mode: 0644]
lib/libc/syscall/statvfs.S [new file with mode: 0644]

index 7b40f7877445e6fbff8c4966e226a32f3626f21d..cb5b007cf5aa426e3105449584676910b5ac6166 100644 (file)
@@ -31,6 +31,7 @@ SRCS+=         \
        _fpathconf.c \
        _fstat.c \
        _fstatfs.c \
+       _fstatvfs.c \
        _fsync.c \
        _getcwd.c \
        _getegid.c \
@@ -79,6 +80,7 @@ SRCS+=         \
        _sigsuspend.c \
        _sleep.c \
        _stat.c \
+       _statvfs.c \
        _stime.c \
        _symlink.c \
        _sync.c \
diff --git a/lib/libc/posix/_fstatvfs.c b/lib/libc/posix/_fstatvfs.c
new file mode 100644 (file)
index 0000000..dc8aee8
--- /dev/null
@@ -0,0 +1,13 @@
+#include <lib.h>
+#define fstatvfs       _fstatvfs
+#include <sys/statvfs.h>
+#include <minix/com.h>
+
+PUBLIC int fstatvfs(int fd, struct statvfs *buffer)
+{
+  message m;
+
+  m.FSTATVFS_FD = fd;
+  m.FSTATVFS_BUF = (char *) buffer;
+  return(_syscall(VFS_PROC_NR, FSTATVFS, &m));
+}
diff --git a/lib/libc/posix/_statvfs.c b/lib/libc/posix/_statvfs.c
new file mode 100644 (file)
index 0000000..4d56efd
--- /dev/null
@@ -0,0 +1,17 @@
+#include <lib.h>
+#define statvfs        _statvfs
+#include <sys/statvfs.h>
+#include <string.h>
+#include <minix/com.h>
+
+PUBLIC int statvfs(name, buffer)
+_CONST char *name;
+struct statvfs *buffer;
+{
+  message m;
+
+  m.STATVFS_LEN = strlen(name) + 1;
+  m.STATVFS_NAME = (char *) name;
+  m.STATVFS_BUF = (char *) buffer;
+  return(_syscall(VFS_PROC_NR, STATVFS, &m));
+}
index 18410494ae8667e9f160821697338c24fc3b133f..64a5ba6521e9bce9b0fc240ee2161c54c3bcbf36 100644 (file)
@@ -36,6 +36,7 @@ SRCS+=  \
        fpathconf.S \
        fstat.S \
        fstatfs.S \
+       fstatvfs.S \
        getcwd.S \
        getdents.S \
        getdma.S \
@@ -113,6 +114,7 @@ SRCS+=  \
        sleep.S \
        sprofile.S \
        stat.S \
+       statvfs.S \
        stime.S \
        svrctl.S \
        symlink.S \
diff --git a/lib/libc/syscall/fstatvfs.S b/lib/libc/syscall/fstatvfs.S
new file mode 100644 (file)
index 0000000..096218c
--- /dev/null
@@ -0,0 +1,7 @@
+.text
+.extern        __fstatvfs
+.globl _fstatvfs
+.balign        2
+
+_fstatvfs:
+       jmp     __fstatvfs
diff --git a/lib/libc/syscall/statvfs.S b/lib/libc/syscall/statvfs.S
new file mode 100644 (file)
index 0000000..9d14d71
--- /dev/null
@@ -0,0 +1,7 @@
+.text
+.extern        __statvfs
+.globl _statvfs
+.balign        2
+
+_statvfs:
+       jmp     __statvfs