xref: /netbsd-src/lib/libc/sys/statvfs.c (revision 02cdd248ec8b17634bab40aa4f2e161a756d7fce)
1*02cdd248Schristos /*	$NetBSD: statvfs.c,v 1.7 2019/09/22 22:59:38 christos Exp $	*/
26bd1d6d4Schristos 
36bd1d6d4Schristos /*-
46bd1d6d4Schristos  * Copyright (c) 2004 The NetBSD Foundation, Inc.
56bd1d6d4Schristos  * All rights reserved.
66bd1d6d4Schristos  *
76bd1d6d4Schristos  * This code is derived from software contributed to The NetBSD Foundation
86bd1d6d4Schristos  * by Christos Zoulas.
96bd1d6d4Schristos  *
106bd1d6d4Schristos  * Redistribution and use in source and binary forms, with or without
116bd1d6d4Schristos  * modification, are permitted provided that the following conditions
126bd1d6d4Schristos  * are met:
136bd1d6d4Schristos  * 1. Redistributions of source code must retain the above copyright
146bd1d6d4Schristos  *    notice, this list of conditions and the following disclaimer.
156bd1d6d4Schristos  * 2. Redistributions in binary form must reproduce the above copyright
166bd1d6d4Schristos  *    notice, this list of conditions and the following disclaimer in the
176bd1d6d4Schristos  *    documentation and/or other materials provided with the distribution.
186bd1d6d4Schristos  *
196bd1d6d4Schristos  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
206bd1d6d4Schristos  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
216bd1d6d4Schristos  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
226bd1d6d4Schristos  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
236bd1d6d4Schristos  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
246bd1d6d4Schristos  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
256bd1d6d4Schristos  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
266bd1d6d4Schristos  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
276bd1d6d4Schristos  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
286bd1d6d4Schristos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
296bd1d6d4Schristos  * POSSIBILITY OF SUCH DAMAGE.
306bd1d6d4Schristos  */
316bd1d6d4Schristos 
3288c3eadbSlukem #include <sys/cdefs.h>
3388c3eadbSlukem #if defined(LIBC_SCCS) && !defined(lint)
34*02cdd248Schristos __RCSID("$NetBSD: statvfs.c,v 1.7 2019/09/22 22:59:38 christos Exp $");
3588c3eadbSlukem #endif /* LIBC_SCCS and not lint */
3688c3eadbSlukem 
376bd1d6d4Schristos #include <sys/statvfs.h>
386bd1d6d4Schristos 
396bd1d6d4Schristos int
statvfs(const char * file,struct statvfs * st)406bd1d6d4Schristos statvfs(const char *file, struct statvfs *st)
416bd1d6d4Schristos {
426bd1d6d4Schristos 	return statvfs1(file, st, ST_WAIT);
436bd1d6d4Schristos }
446bd1d6d4Schristos 
456bd1d6d4Schristos int
fstatvfs(int f,struct statvfs * st)466bd1d6d4Schristos fstatvfs(int f, struct statvfs *st)
476bd1d6d4Schristos {
486bd1d6d4Schristos 	return fstatvfs1(f, st, ST_WAIT);
496bd1d6d4Schristos }
506bd1d6d4Schristos 
516bd1d6d4Schristos int
fhstatvfs(const void * fh,size_t fh_size,struct statvfs * st)52*02cdd248Schristos fhstatvfs(const void *fh, size_t fh_size, struct statvfs *st)
536bd1d6d4Schristos {
54*02cdd248Schristos 	return fhstatvfs1(fh, fh_size, st, ST_WAIT);
556bd1d6d4Schristos }
56