2019-01-01 00:11:28 +00:00
|
|
|
/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
1998-03-20 16:35:19 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1998-03-20 16:35:19 +00:00
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
1998-03-20 16:35:19 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1998-03-20 16:35:19 +00:00
|
|
|
|
2003-09-17 00:49:19 +00:00
|
|
|
#include <stddef.h>
|
1998-03-20 16:35:19 +00:00
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/statfs.h>
|
2017-10-01 22:08:14 +00:00
|
|
|
#include "internal_statvfs.h"
|
1998-03-20 16:35:19 +00:00
|
|
|
|
|
|
|
int
|
2015-06-09 19:52:01 +00:00
|
|
|
__fstatvfs (int fd, struct statvfs *buf)
|
1998-03-20 16:35:19 +00:00
|
|
|
{
|
|
|
|
struct statfs fsbuf;
|
|
|
|
|
|
|
|
/* Get as much information as possible from the system. */
|
|
|
|
if (__fstatfs (fd, &fsbuf) < 0)
|
|
|
|
return -1;
|
|
|
|
|
2003-09-17 00:49:19 +00:00
|
|
|
/* Convert the result. */
|
2014-05-29 04:11:29 +00:00
|
|
|
__internal_statvfs (NULL, buf, &fsbuf, fd);
|
2000-01-18 10:53:15 +00:00
|
|
|
|
1998-03-20 16:35:19 +00:00
|
|
|
/* We signal success if the statfs call succeeded. */
|
|
|
|
return 0;
|
|
|
|
}
|
2015-06-09 19:52:01 +00:00
|
|
|
weak_alias (__fstatvfs, fstatvfs)
|
|
|
|
libc_hidden_weak (fstatvfs)
|