diff options
author | H. Peter Anvin <hpa@zytor.com> | 2004-06-09 19:38:48 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2004-06-09 19:38:48 +0000 |
commit | d0c4c83fb0105a0cc5f22dfe7f1b4a3ed44b848e (patch) | |
tree | a7f19f73b7a201a6762f1a173652d2490918039c | |
parent | 85bb33c1101198ec427ce9a781bf2e6c5877d6c0 (diff) | |
download | klibc-d0c4c83fb0105a0cc5f22dfe7f1b4a3ed44b848e.tar.gz |
Fix statfs/fstatfs on systems which have statfs64/fstatfs64klibc-0.133
-rw-r--r-- | klibc/Makefile | 1 | ||||
-rw-r--r-- | klibc/SYSCALLS.def | 14 | ||||
-rw-r--r-- | klibc/fstatfs.c | 19 | ||||
-rw-r--r-- | klibc/statfs.c | 19 |
4 files changed, 50 insertions, 3 deletions
diff --git a/klibc/Makefile b/klibc/Makefile index 1840f3300ac31..b05a7e44c8c7c 100644 --- a/klibc/Makefile +++ b/klibc/Makefile @@ -19,6 +19,7 @@ LIBOBJS = vsnprintf.o snprintf.o vsprintf.o sprintf.o \ execl.o execle.o execv.o execvpe.o execvp.o execlp.o execlpe.o \ fork.o wait.o wait3.o waitpid.o system.o setpgrp.o getpgrp.o \ printf.o vprintf.o fprintf.o vfprintf.o perror.o \ + statfs.o fstatfs.o \ open.o fopen.o fread.o fread2.o fgetc.o fgets.o \ fwrite.o fwrite2.o fputc.o fputs.o puts.o \ sleep.o usleep.o raise.o abort.o assert.o alarm.o pause.o \ diff --git a/klibc/SYSCALLS.def b/klibc/SYSCALLS.def index 814f0f8f694e4..107e3845d3342 100644 --- a/klibc/SYSCALLS.def +++ b/klibc/SYSCALLS.def @@ -1,7 +1,7 @@ ; -*- fundamental -*- ; ; This is a list of system calls we invoke "directly". These -; are generated into syscall stubs in their own C files, so the +; are generated into syscall stubs in their own files, so the ; linker can do its job properly. ; ; The full description of a line is: @@ -66,8 +66,16 @@ int mount(const char *, const char *, const char *, unsigned long, const void *) <alpha,ia64> int umount::umount2(const char *, int) <!m68k> int pivot_root(const char *, const char *) int sync() -int statfs64,statfs::statfs(const char *, struct statfs *) -int fstatfs64,fstatfs::fstatfs(int, struct statfs *) +#ifdef __NR_statfs64 +int statfs64::__statfs64(const char *, size_t, struct statfs *) +#else +int statfs(const char *, struct statfs *) +#endif +#ifdef __NR_fstatfs64 +int fstatfs64::__fstatfs64(int, size_t, struct statfs *) +#else +int fstatfs(int, struct statfs *) +#endif int swapon(const char *, int) int swapoff(const char *) diff --git a/klibc/fstatfs.c b/klibc/fstatfs.c new file mode 100644 index 0000000000000..09e4674947508 --- /dev/null +++ b/klibc/fstatfs.c @@ -0,0 +1,19 @@ +/* + * fstatfs.c + * + * On architectures which do fstatfs64, wrap the system call + */ + +#include <sys/syscall.h> +#include <sys/vfs.h> + +#ifdef __NR_fstatfs64 + +extern int __fstatfs64(int, size_t, struct statfs *); + +int fstatfs(int fd, struct statfs *buf) +{ + return __fstatfs64(fd, sizeof *buf, buf); +} + +#endif diff --git a/klibc/statfs.c b/klibc/statfs.c new file mode 100644 index 0000000000000..60e9188a092cc --- /dev/null +++ b/klibc/statfs.c @@ -0,0 +1,19 @@ +/* + * statfs.c + * + * On architectures which do statfs64, wrap the system call + */ + +#include <sys/syscall.h> +#include <sys/vfs.h> + +#ifdef __NR_statfs64 + +extern int __statfs64(const char *, size_t, struct statfs *); + +int statfs(const char *path, struct statfs *buf) +{ + return __statfs64(path, sizeof *buf, buf); +} + +#endif |