man-pages/man2/ustat.2

117 lines
3.4 KiB
Groff
Raw Normal View History

2004-11-03 13:51:07 +00:00
.\" Copyright (C) 1995, Thomas K. Dyas <tdyas@eden.rutgers.edu>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
2004-11-03 13:51:07 +00:00
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
2004-11-03 13:51:07 +00:00
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Created 1995-08-09 Thomas K. Dyas <tdyas@eden.rutgers.edu>
.\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified 2001-03-22 by aeb
.\" Modified 2003-08-04 by aeb
.\"
2007-05-30 05:36:26 +00:00
.TH USTAT 2 2003-08-04 "Linux" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.SH NAME
ustat \- get file system statistics
.SH SYNOPSIS
.nf
.B #include <sys/types.h>
.br
.BR "#include <unistd.h>" " /* libc[45] */"
.br
.BR "#include <ustat.h>" " /* glibc2 */"
.sp
.BI "int ustat(dev_t " dev ", struct ustat *" ubuf );
2007-12-23 21:05:57 +00:00
.fi
2004-11-03 13:51:07 +00:00
.SH DESCRIPTION
.BR ustat ()
2004-11-03 13:51:07 +00:00
returns information about a mounted file system.
.I dev
is a device number identifying a device containing
a mounted file system.
.I ubuf
2007-04-05 12:36:57 +00:00
is a pointer to a \fIustat\fP structure that contains the following
2004-11-03 13:51:07 +00:00
members:
2007-12-23 21:05:57 +00:00
.in +4n
2004-11-03 13:51:07 +00:00
.nf
2007-04-05 12:36:57 +00:00
daddr_t f_tfree; /* Total free blocks */
ino_t f_tinode; /* Number of free inodes */
char f_fname[6]; /* Filsys name */
char f_fpack[6]; /* Filsys pack name */
2004-11-03 13:51:07 +00:00
.fi
2007-12-23 21:05:57 +00:00
.in
2004-11-03 13:51:07 +00:00
.PP
2007-06-26 08:21:48 +00:00
The last two fields,
.I f_fname
and
.IR f_fpack ,
are not implemented and will
2008-06-09 15:49:35 +00:00
always be filled with null bytes (\(aq\\0\(aq).
2004-11-03 13:51:07 +00:00
.SH "RETURN VALUE"
2007-06-26 08:21:48 +00:00
On success, zero is returned and the
.I ustat
structure pointed to by
2004-11-03 13:51:07 +00:00
.I ubuf
will be filled in.
On error, \-1 is returned, and
2004-11-03 13:51:07 +00:00
.I errno
is set appropriately.
.SH ERRORS
.TP
.B EFAULT
.I ubuf
points outside of your accessible address space.
.TP
.B EINVAL
.I dev
does not refer to a device containing a mounted file system.
.TP
.B ENOSYS
The mounted file system referenced by
.I dev
does not support this operation, or any version of Linux before
1.3.16.
.SH "CONFORMING TO"
SVr4.
2006-08-03 13:57:17 +00:00
.\" SVr4 documents additional error conditions ENOLINK, ECOMM, and EINTR
.\" but has no ENOSYS condition.
2004-11-03 13:51:07 +00:00
.SH NOTES
.BR ustat ()
2004-11-03 13:51:07 +00:00
is deprecated and has only been provided for compatibility.
All new programs should use
.BR statfs (2)
instead.
intro.1, time.1, _syscall.2, accept.2, brk.2, capget.2, faccessat.2, futimesat.2, gethostname.2, intro.2, ioprio_set.2, kill.2, madvise.2, mlock.2, mount.2, msgget.2, perf_event_open.2, poll.2, readv.2, sched_rr_get_interval.2, sched_setscheduler.2, select.2, select_tut.2, shmget.2, stat.2, timer_create.2, ustat.2, vfork.2, wait.2, alloca.3, atexit.3, catopen.3, crypt.3, dbopen.3, fenv.3, fopen.3, getaddrinfo_a.3, gethostbyname.3, getutent.3, intro.3, login.3, mallopt.3, queue.3, regex.3, sigpause.3, sigsetops.3, stdio.3, strftime.3, strptime.3, sysconf.3, ttyslot.3, undocumented.3, cciss.4, console_codes.4, hpsa.4, initrd.4, intro.4, rtc.4, st.4, tty_ioctl.4, wavelan.4, acct.5, charmap.5, dir_colors.5, hosts.5, intro.5, termcap.5, utmp.5, intro.6, armscii-8.7, boot.7, bootparam.7, capabilities.7, cpuset.7, credentials.7, ddp.7, epoll.7, glob.7, intro.7, ip.7, ipv6.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, koi8-r.7, koi8-u.7, man-pages.7, man.7, math_error.7, netlink.7, numa.7, packet.7, path_resolution.7, pipe.7, pthreads.7, raw.7, rtnetlink.7, signal.7, socket.7, spufs.7, svipc.7, tcp.7, time.7, udp.7, udplite.7, unicode.7, unix.7, uri.7, utf-8.7, x25.7, intro.8: Global fix: use consistent capitalization in .SS headings Capitalization in .SS sections across pages (and sometimes even within a single page) is wildly inconsistent. Make it consistent. Capitalize first word in heading, but otherwise use lower case, except where English usage (e.g., proper nouns) or programming language requirements (e.g., identifier names) dictate otherwise. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-02-24 14:08:38 +00:00
.SS "HP-UX notes"
2006-08-03 13:57:17 +00:00
The HP-UX version of the
.I ustat
2006-08-03 13:57:17 +00:00
structure has an additional field,
.IR f_blksize ,
that is unknown elsewhere.
2006-08-03 13:57:17 +00:00
HP-UX warns:
2004-11-03 13:51:07 +00:00
For some file systems, the number of free inodes does not change.
2005-06-15 14:10:23 +00:00
Such file systems will return \-1 in the field
2004-11-03 13:51:07 +00:00
.IR f_tinode .
.\" Some software tries to use this in order to test whether the
2008-03-19 07:26:08 +00:00
.\" underlying file system is NFS.
2004-11-03 13:51:07 +00:00
For some file systems, inodes are dynamically allocated.
Such file systems will return the current number of free inodes.
.SH "SEE ALSO"
.BR stat (2),
.BR statfs (2)