From: Ben Gras Date: Wed, 23 Jun 2010 23:51:29 +0000 (+0000) Subject: libc stubs for statvfs, contributed by Buccapatnam Tirumala, Gautam. X-Git-Tag: v3.1.8~376 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/FAQ?a=commitdiff_plain;h=45e4cce8c2d8339cea56ceaa4ade24ddbc588954;p=minix.git libc stubs for statvfs, contributed by Buccapatnam Tirumala, Gautam. --- diff --git a/lib/libc/posix/Makefile.inc b/lib/libc/posix/Makefile.inc index 7b40f7877..cb5b007cf 100644 --- a/lib/libc/posix/Makefile.inc +++ b/lib/libc/posix/Makefile.inc @@ -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 index 000000000..dc8aee879 --- /dev/null +++ b/lib/libc/posix/_fstatvfs.c @@ -0,0 +1,13 @@ +#include +#define fstatvfs _fstatvfs +#include +#include + +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 index 000000000..4d56efd42 --- /dev/null +++ b/lib/libc/posix/_statvfs.c @@ -0,0 +1,17 @@ +#include +#define statvfs _statvfs +#include +#include +#include + +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)); +} diff --git a/lib/libc/syscall/Makefile.inc b/lib/libc/syscall/Makefile.inc index 18410494a..64a5ba652 100644 --- a/lib/libc/syscall/Makefile.inc +++ b/lib/libc/syscall/Makefile.inc @@ -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 index 000000000..096218c54 --- /dev/null +++ b/lib/libc/syscall/fstatvfs.S @@ -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 index 000000000..9d14d71e3 --- /dev/null +++ b/lib/libc/syscall/statvfs.S @@ -0,0 +1,7 @@ +.text +.extern __statvfs +.globl _statvfs +.balign 2 + +_statvfs: + jmp __statvfs