Q_XQUOTAON(2const)

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

πŸ’– Q_XQUOTAON β€” it's giving "quota szn" πŸ’–

okay bestie, welcome to Q_XQUOTAON(2const), a lil page from the Linux man-pages family. yes it's a 2const page, which is just manpage-speak for "this is one specific request code you pass to a bigger syscall," iykyk. the bigger syscall here is quotactl(2) (and its fd-flavored sibling quotactl_fd(2)), and this constant's whole job is turning quotas ON for an XFS filesystem. no cap. πŸŽ€


🌸 NAME 🌸

Q_XQUOTAON β€” turn on quotas for an XFS filesystem ✨

basically: quota accounting and quota limit enforcement? we're switching them ON, bestie. main character energy only. πŸ‘‘


🫢 LIBRARY 🫢

Standard C library β€” that's libc, aka -lc. the cozy classic. πŸ’…


✨ SYNOPSIS ✨

okay so there are two ways to slide into this call, depending on which wrapper you're vibing with. first up, the one you get through quotactl(2):

#include <xfs/xqm.h>      /* See quotactl(2) */
#include <sys/quota.h>

int quotactl(QCMD(Q_XQUOTAON, type), const char *_Nullable special, 0,
             caddr_t addr);

and then the quotactl_fd(2) route, which goes through raw syscall(2) energy (yes we're being extra, yes it's necessary):

#include <xfs/xqm.h>      /* See quotactl_fd(2) */
#include <sys/syscall.h>  /* Definition of SYS_* constants */
#include <unistd.h>

int syscall(SYS_quotactl_fd, int fd, QCMD(Q_XQUOTAON, type), 0,
            unsigned int *addr);

note the _Nullable on special, note the literal 0 sitting in the third slot like it owns the place, and note that addr is a caddr_t in one and an unsigned int * in the other. copy-paste responsibly bestie 🫢


πŸ’œ DESCRIPTION πŸ’œ

Turn on quotas for an XFS filesystem. that's the whole mission. πŸ¦‹

now here's the tea: XFS is built different. it lets you turn quota limit enforcement on and off completely separately from quota accounting. so instead of one boring on/off switch, XFS expects addr to be a pointer to an unsigned int that holds a bitwise combination of these flags (all defined in <xfs/xqm.h>):

XFS_QUOTA_UDQ_ACCT  /* User quota accounting */
XFS_QUOTA_UDQ_ENFD  /* User quota limits enforcement */
XFS_QUOTA_GDQ_ACCT  /* Group quota accounting */
XFS_QUOTA_GDQ_ENFD  /* Group quota limits enforcement */
XFS_QUOTA_PDQ_ACCT  /* Project quota accounting */
XFS_QUOTA_PDQ_ENFD  /* Project quota limits enforcement */

so yeah β€” user, group, project, and for each one you can pick accounting, enforcement, or both (that's the bitwise OR moment ✨). you mix and match, you hand over the pointer, you slay.

🚨 real talk though: this operation requires privilege β€” specifically CAP_SYS_ADMIN. no cap, no quota-on. if you don't have it, the kernel is not gonna let you in the group chat. πŸ’€

πŸ”₯ RETURN VALUE πŸ”₯

See quotactl(2). (the details live over there, bestie β€” we're not re-typing them, that's just how these pages do.) 😌


πŸ’€ ERRORS πŸ’€

See quotactl(2). same deal. the error lore is in that page. πŸ™ˆ


🌈 STANDARDS 🌈

Linux. 🐧 iconic, obviously.


⭐ HISTORY ⭐

Linux. ⭐ the origin story is short and sweet.


πŸŽ€ SEE ALSO πŸŽ€

go read these next, fr fr:


and that's a wrap on Q_XQUOTAON(2const)! this lil masterpiece comes to you from Linux man-pages 6.20, dated 2026-06-05. go forth, enable your quotas, drink water, and remember: accounting is not enforcement. πŸ’–πŸ¦‹βœ¨πŸŽ€

πŸ“¦ 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