2011-02-17 18:11:09 +01:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include "namespace.h"
|
|
|
|
#include <lib.h>
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
#include <string.h>
|
2011-02-17 18:11:09 +01:00
|
|
|
#include <sys/statvfs.h>
|
|
|
|
|
2013-12-06 12:04:52 +01:00
|
|
|
#if defined(__weak_alias)
|
2011-02-17 18:11:09 +01:00
|
|
|
__weak_alias(fstatvfs, _fstatvfs)
|
|
|
|
#endif
|
|
|
|
|
2013-08-20 01:28:23 +02:00
|
|
|
int fstatvfs1(int fd, struct statvfs *buffer, int flags)
|
2011-02-17 18:11:09 +01:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
2014-05-12 11:49:08 +02:00
|
|
|
m.m_lc_vfs_statvfs1.fd = fd;
|
|
|
|
m.m_lc_vfs_statvfs1.buf = (vir_bytes)buffer;
|
|
|
|
m.m_lc_vfs_statvfs1.flags = flags;
|
2013-11-04 22:48:08 +01:00
|
|
|
return(_syscall(VFS_PROC_NR, VFS_FSTATVFS1, &m));
|
2013-08-20 01:28:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int fstatvfs(int fd, struct statvfs *buffer)
|
|
|
|
{
|
|
|
|
return fstatvfs1(fd, buffer, ST_WAIT);
|
2011-02-17 18:11:09 +01:00
|
|
|
}
|