.\" 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_SETQUOTA 2const 2026-06-05 "Linux man-pages 6.19"
.SH NAME
Q_SETQUOTA
\-
set quota information 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_SETQUOTA, " 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_SETQUOTA, " type ),
.BI "             int\~" id ", struct\~dqblk\~*" addr );
.fi
.SH DESCRIPTION
Set quota information for user or group
.IR id ,
using the information supplied in the
.BR dqblk (2type)
structure pointed to by
.IR addr .
.P
The
.I .dqb_valid
field of the
.BR dqblk (2type)
structure indicates which entries in the structure have been set by the caller.
.P
This operation requires privilege
.RB ( CAP_SYS_ADMIN ).
.SH RETURN VALUE
See
.BR quotactl (2).
.SH ERRORS
See
.BR quotactl (2).
.TP
.B ERANGE
The specified limits are out of the range allowed by the quota format.
.SH STANDARDS
Linux.
.SH HISTORY
Linux.
.P
This operation supersedes the
.B Q_SETQLIM
and
.B Q_SETUSE
operations in the previous quota interfaces.
.SH SEE ALSO
.BR quotactl (2),
.BR quotactl_fd (2),
.BR dqblk (2type)
