From 45e4cce8c2d8339cea56ceaa4ade24ddbc588954 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Wed, 23 Jun 2010 23:51:29 +0000 Subject: [PATCH] libc stubs for statvfs, contributed by Buccapatnam Tirumala, Gautam. --- lib/libc/posix/Makefile.inc | 2 ++ lib/libc/posix/_fstatvfs.c | 13 +++++++++++++ lib/libc/posix/_statvfs.c | 17 +++++++++++++++++ lib/libc/syscall/Makefile.inc | 2 ++ lib/libc/syscall/fstatvfs.S | 7 +++++++ lib/libc/syscall/statvfs.S | 7 +++++++ 6 files changed, 48 insertions(+) create mode 100644 lib/libc/posix/_fstatvfs.c create mode 100644 lib/libc/posix/_statvfs.c create mode 100644 lib/libc/syscall/fstatvfs.S create mode 100644 lib/libc/syscall/statvfs.S 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