Skip to main content

Ralsina.Me — Roberto Alsina's website

If you try to use quotactl on Linux...

Al­ways re­mem­ber to do this:

#define _LINUX_QUOTA_VERSION 2

Or else, your code will break in mis­te­ri­ous ways.

That's be­cause sys/quo­ta.h has this:

/*
 * Select between different incompatible quota versions.
 * Default to the version used by Linux kernel version 2.4.21
 * or earlier (in RHEL version 1 is AS2.1, version 2 is RHEL3 and later).  */
#ifndef _LINUX_QUOTA_VERSION
# define _LINUX_QUOTA_VERSION 1
#endif

Why? I have no idea. But this is true at least on Cen­tos4, I have no clue of this is al­so true for your dis­tro, but it is sooooo wrong :-(


Contents © 2000-2024 Roberto Alsina