xref: /minix3/minix/lib/libc/sys/statvfs.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1 #include <sys/cdefs.h>
2 #include <lib.h>
3 #include "namespace.h"
4 
5 #include <sys/types.h>
6 #include <sys/statvfs.h>
7 #include <string.h>
8 
9 #ifdef __weak_alias
__weak_alias(statvfs,_statvfs)10 __weak_alias(statvfs, _statvfs)
11 #endif
12 
13 int statvfs1(const char *name, struct statvfs *buffer, int flags)
14 {
15   message m;
16 
17   memset(&m, 0, sizeof(m));
18   m.m_lc_vfs_statvfs1.len = strlen(name) + 1;
19   m.m_lc_vfs_statvfs1.name =  (vir_bytes)name;
20   m.m_lc_vfs_statvfs1.buf = (vir_bytes)buffer;
21   m.m_lc_vfs_statvfs1.flags = flags;
22   return(_syscall(VFS_PROC_NR, VFS_STATVFS1, &m));
23 }
24 
statvfs(const char * name,struct statvfs * buffer)25 int statvfs(const char *name, struct statvfs *buffer)
26 {
27   return statvfs1(name, buffer, ST_WAIT);
28 }
29