Q_GETNEXTQUOTA(2const)

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

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