.\" Copyright 1996, Andries E. Brouwer <aeb@cwi.nl>
.\" Copyright 2010, Jan Kara <jack@suse.cz>
.\" Copyright 2010, Michael Kerrisk <mtk.manpages@gmail.com>
.\" Copyright, the authors of the Linux man-pages project
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
.TH Q_GETQUOTA 2const 2026-06-05 "Linux man-pages 6.19"
.SH NAME
Q_GETQUOTA
\-
get disk quota limits and current usage for user or group
.SH LIBRARY
Standard C library
.RI ( libc ,\~ \-lc )
.SH SYNOPSIS
.nf
.B #include <sys/quota.h>
.P
.BI "int\~quotactl(QCMD(Q_GETQUOTA, " type "), const\~char\~*_Nullable\~" special ,
.BI "             int\~" id ", caddr_t\~" addr );
.P
.BR "#include <sys/quota.h>" "    /* Definition of " Q_* " constants */"
.BR "#include <sys/syscall.h>" "  /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.P
.BI "int\~syscall(SYS_quotactl_fd, int\~" fd ", QCMD(Q_GETQUOTA, " type ),
.BI "            int\~" id ", struct\~dqblk\~*" addr );
.fi
.SH DESCRIPTION
Get disk quota limits and current usage for user or group
.IR id .
.P
The
.I addr
argument is a pointer to a
.BR dqblk (2type)
structure.
.P
Currently,
the kernel fills in all entries of the
.BR dqblk (2type)
structure and marks them as valid in the
.I .dqb_valid
field.
.P
Unprivileged users may retrieve only their own quotas;
a privileged user
.RB ( CAP_SYS_ADMIN )
can retrieve the quotas of any user.
.SH RETURN VALUE
See
.BR quotactl (2).
.SH ERRORS
See
.BR quotactl (2).
.SH STANDARDS
Linux.
.SH HISTORY
Linux.
.SH SEE ALSO
.BR quotactl (2),
.BR quotactl_fd (2),
.BR Q_GETNEXTQUOTA (2const),
.BR dqblk (2type)
