Q_GETNEXTQUOTA(2const)
β¨ Q_GETNEXTQUOTA π (the Q_GETNEXTQUOTA(2const) glow-up)
okay bestie, listen β this is a <sys/quota.h> constant page, the kind that comes bundled with quotactl(2). it's short, it's sweet, it's giving "quietly running your whole filesystem's vibe check" energy. let's go πΈ
π NAME
Q_GETNEXTQUOTA β get disk quota limits and current usage for the next user or group π«Ά
π LIBRARY
Standard C library (libc, -lc) β she's built in, no extra credit needed π
π SYNOPSIS
okay so here's the whole squad. first, the classic quotactl() route:
#include <sys/quota.h>
int quotactl(QCMD(Q_GETNEXTQUOTA, type), const char *_Nullable special,
int id, caddr_t addr);
then the fd-based syscall route, with all the includes you need:
#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_GETNEXTQUOTA, type),
int id, struct nextdqblk *addr);
and here's the struct, the main character herself β¨:
#include <sys/quota.h>
struct nextdqblk {
uint64_t dqb_bhardlimit;
uint64_t dqb_bsoftlimit;
uint64_t dqb_curspace;
uint64_t dqb_ihardlimit;
uint64_t dqb_isoftlimit;
uint64_t dqb_curinodes;
uint64_t dqb_btime;
uint64_t dqb_itime;
uint32_t dqb_valid;
uint32_t dqb_id;
};
like. look at her. immaculate. π§
π DESCRIPTION
ngl this operation is literally the same as Q_GETQUOTA(2const) β except it doesn't come back with the ID you asked for, it comes back with the next ID that's >= id and actually has a quota set. it's the "who's next in line with a quota" move. so iconic of her π
the addr argument is a pointer to a nextdqblk structure, and its fields are exactly like the ones in dqblk(2type)β¦ with one addition: a .dqb_id field that hands you back the ID whose quota info you're getting. so you're not guessing who it is, bestie, the struct tells you π
π RETURN VALUE
See quotactl(2). (fr fr, the whole return-value story lives over there π)
π ERRORS
See quotactl(2) too β but there's one special guest error that belongs here:
ESRCHβ there is no ID greater than or equal toidthat has an active quota. π like, nobody. not one. the search came back empty.
π STANDARDS
Linux. that's it, that's the whole line π§
π°οΈ HISTORY
Linux 4.6 β she's been around since 2016, a certified elder of the nextquota lineage π
π¦ SEE ALSO
and that's the page, bestie!! this whole writeup is from Linux man-pages 6.20, dated 2026-06-05, and yes the header at the top and the footer at the bottom of the original both just said Q_GETNEXTQUOTA(2const) β so now you know her government name too. go forth and quota responsibly πβ¨π
π¦ 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