Q_GETQUOTA(2const)

πŸ“¦
version 6.20 Β· 2 versions
, in arch rolling, nixpkgs unstable

πŸ’– 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 to quotactl(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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms