xref: /minix3/minix/lib/libc/sys/fstatvfs.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #include <sys/cdefs.h>
2*433d6423SLionel Sambuc #include "namespace.h"
3*433d6423SLionel Sambuc #include <lib.h>
4*433d6423SLionel Sambuc 
5*433d6423SLionel Sambuc #include <string.h>
6*433d6423SLionel Sambuc #include <sys/statvfs.h>
7*433d6423SLionel Sambuc 
8*433d6423SLionel Sambuc #if defined(__weak_alias)
__weak_alias(fstatvfs,_fstatvfs)9*433d6423SLionel Sambuc __weak_alias(fstatvfs, _fstatvfs)
10*433d6423SLionel Sambuc #endif
11*433d6423SLionel Sambuc 
12*433d6423SLionel Sambuc int fstatvfs1(int fd, struct statvfs *buffer, int flags)
13*433d6423SLionel Sambuc {
14*433d6423SLionel Sambuc   message m;
15*433d6423SLionel Sambuc 
16*433d6423SLionel Sambuc   memset(&m, 0, sizeof(m));
17*433d6423SLionel Sambuc   m.m_lc_vfs_statvfs1.fd = fd;
18*433d6423SLionel Sambuc   m.m_lc_vfs_statvfs1.buf = (vir_bytes)buffer;
19*433d6423SLionel Sambuc   m.m_lc_vfs_statvfs1.flags = flags;
20*433d6423SLionel Sambuc   return(_syscall(VFS_PROC_NR, VFS_FSTATVFS1, &m));
21*433d6423SLionel Sambuc }
22*433d6423SLionel Sambuc 
fstatvfs(int fd,struct statvfs * buffer)23*433d6423SLionel Sambuc int fstatvfs(int fd, struct statvfs *buffer)
24*433d6423SLionel Sambuc {
25*433d6423SLionel Sambuc   return fstatvfs1(fd, buffer, ST_WAIT);
26*433d6423SLionel Sambuc }
27