Originally from wip with netbsd-6 patches sketched by yours truly and finished/tested by Edgar Fuss. The Quota module provides access to file system quotas. The quotactl system call or ioctl is used to query or set quotas on the local host, or queries are submitted via RPC to a remote host. Mount tables can be parsed with getmntent and paths can be translated to device files (or whatever the actual quotactl implementations needs as argument) of the according file system.
35 lines
1.2 KiB
Text
35 lines
1.2 KiB
Text
$NetBSD: patch-ab,v 1.1 2012/08/14 14:24:20 dholland Exp $
|
|
|
|
Extend hints/bsd.h to define NETBSD_LIBQUOTA and include <quota.h> on
|
|
NetBSD >= 5.99.59.
|
|
|
|
--- hints/bsd.h.orig 2007-11-24 14:49:43.000000000 +0100
|
|
+++ hints/bsd.h 2012-05-14 15:52:47.000000000 +0200
|
|
@@ -9,6 +9,7 @@
|
|
* and Jon Schewe <schewe@tcfreenet.org>
|
|
* NetBSD mods and merge of *BSD-related hints provided by
|
|
* Jaromir Dolecek <jdolecek@NetBSD.org>
|
|
+ * NetBSD libquota mods by David Holland <dholland@netbsd.org>
|
|
*/
|
|
|
|
/* See hints/none.h for a complete list of options with explanations */
|
|
@@ -16,7 +17,19 @@
|
|
#include <sys/param.h>
|
|
#include <sys/mount.h>
|
|
#include <fstab.h>
|
|
+
|
|
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 599004800 && __NetBSD_Version__ < 599005900
|
|
+#error "NetBSD 5.99 proplib-based quotas not supported"
|
|
+#endif
|
|
+
|
|
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 599005900) /* NetBSD 5.99.59 */
|
|
+#include <quota.h>
|
|
+/* struct qblk needed for the way the XS handles NFS quota */
|
|
+#include <ufs/ufs/quota1.h>
|
|
+#define NETBSD_LIBQUOTA
|
|
+#else
|
|
#include <ufs/ufs/quota.h>
|
|
+#endif
|
|
|
|
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900) /* NetBSD 2.99.9 */
|
|
/* NetBSD 3.0 has no statfs anymore */
|