Q_GETQUOTA(2const)
π Q_GETQUOTA β bestie edition π
okay so this is a page from the Linux man-pages, manual section 2const (that's the const-y corner of section 2, the system calls), and it's all about Q_GETQUOTA β the little constant that lets you get disk quota limits and current usage for a user or group. like, how much disk space is this person even allowed to have, and how much are they currently burning through. iconic question, honestly. π
β¨ NAME β¨
Q_GETQUOTA β get disk quota limits and current usage for user or group πΈ
π LIBRARY π
Standard C library (libc, -lc). the classic. the moment. π«Ά
π¦ SYNOPSIS π¦
#include <sys/quota.h>
int quotactl(QCMD(Q_GETQUOTA, type), const char *_Nullable special,
int id, caddr_t addr);
#include <sys/quota.h> /* Definition of Q_* constants */
#include <sys/syscall.h> /* Definition of SYS_* constants */
#include <unistd.h>
int syscall(SYS_quotactl_fd, int fd, QCMD(Q_GETQUOTA, type),
int id, struct dqblk *addr);
not me including the second version too bc yes, there are two ways in and both are valid π
π DESCRIPTION π
Get disk quota limits and current usage for user or group id. that's the whole vibe: you hand it an id, it hands you back the numbers.
The addr argument is a pointer to a dqblk(2type) structure. that's your little container of quota truths π¦
Currently, the kernel fills in all entries of the dqblk(2type) structure and marks them as valid in the .dqb_valid field. so like, everything comes back filled and stamped as legit. no cap.
Unprivileged users may retrieve only their own quotas; a privileged user (CAP_SYS_ADMIN) can retrieve the quotas of any user. so bestie, you can peek at your own numbers, but peeking at everyone else's is a privilege thing. π
π« RETURN VALUE π«
See quotactl(2). (yes, this page is passing the mic on that one, respectfully.)
π ERRORS π
See quotactl(2). same energy, same handoff.
β STANDARDS β
Linux.
π§ HISTORY π§
Linux.
π₯ SEE ALSO π₯
ok real talk: this page is a<pink>2const</pink>page, which means it exists to document the<purple>Q_GETQUOTA</purple>constant and how it plugs into<purple>quotactl</purple>()β it lowkey outsources the return values and errors toquotactl(2)on purpose. so if you need the actual error codes, that's where the tea is. π
sign-off time, bestie π this gorgeous little page is part of Linux man-pages 6.20, dated 2026-06-05, and it left the group chat exactly like that. go get those quotas. πβ¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 1996, Andries E. Brouwer <aeb@cwi.nl>
- Copyright 2010, Jan Kara <jack@suse.cz>
- Copyright 2010, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms