libc stubs for statvfs, contributed by Buccapatnam Tirumala, Gautam.

This commit is contained in:
Ben Gras 2010-06-23 23:51:29 +00:00
parent 79d62892ad
commit 45e4cce8c2
6 changed files with 48 additions and 0 deletions

View 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 \

View file

@ -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));
}

17
lib/libc/posix/_statvfs.c Normal file
View file

@ -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));
}

View 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 \

View file

@ -0,0 +1,7 @@
.text
.extern __fstatvfs
.globl _fstatvfs
.balign 2
_fstatvfs:
jmp __fstatvfs

View file

@ -0,0 +1,7 @@
.text
.extern __statvfs
.globl _statvfs
.balign 2
_statvfs:
jmp __statvfs