File: 02_gnu_hurd.patch

package info (click to toggle)
libquota-perl 1.7.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 360 kB
  • sloc: ansic: 975; perl: 793; sh: 51; makefile: 9
file content (106 lines) | stat: -rw-r--r-- 3,433 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Description: fix build on hurd
Author: Barry deFreese
Reviewed-by: Nicholas Bamber <nicholas@periapt.co.uk>
Last-Update: 2011-01-05
Forwarded: not-needed
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -14,6 +14,7 @@
 elsif($os =~ /^IRIX\d* 6/) { $config='irix_6.h'; }
 elsif($os =~ /^OSF1/)      { $config='dec_osf.h'; }
 elsif($os =~ /^Linux [23]/){ $config='linux.h'; $picobj='linuxapi.o'; }
+elsif($os =~ /^GNU/)       { $config='gnu.h'; }
 elsif($os =~ /^AIX/)       { $config='aix_4_1.h'; }
 elsif($os =~ /^BSD\/OS 2/ ||
       $os =~ /^Darwin/    ||
--- /dev/null
+++ b/hints/gnu.h
@@ -0,0 +1,88 @@
+/*
+ *   Configuration for GNU
+ *
+ *   For AFS support look at the end of this file
+ */
+
+/*   See hints/none.h for a complete list of options with explanations */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <mntent.h>
+
+#include <rpc/rpc.h>
+#include <rpc/pmap_prot.h>
+#include <rpcsvc/rquota.h>
+/* #include "include/rquota.h" */
+#include <sys/socket.h>
+#include <netdb.h>
+
+#include <string.h>
+#include <stdio.h>
+
+/* definitions from sys/quota.h */
+#define USRQUOTA  0             /* element used for user quotas */
+#define GRPQUOTA  1             /* element used for group quotas */
+
+/*
+ * Command definitions for the 'quotactl' system call.
+ * The commands are broken into a main command defined below
+ * and a subcommand that is used to convey the type of
+ * quota that is being manipulated (see above).
+ */
+#define SUBCMDMASK  0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD(cmd, type)  (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+
+/* declare an internal version of the quota block struct */
+typedef u_int64_t qsize_t;
+struct dqblk {
+  qsize_t dqb_ihardlimit;   /* absolute limit on allocated inodes */
+  qsize_t dqb_isoftlimit;   /* preferred inode limit */
+  qsize_t dqb_curinodes;    /* current # allocated inodes */
+  qsize_t dqb_bhardlimit;   /* absolute limit on disk blks alloc */
+  qsize_t dqb_bsoftlimit;   /* preferred limit on disk blks */
+  qsize_t dqb_curblocks;    /* current block count */
+  time_t  dqb_btime;        /* time limit for excessive disk use */
+  time_t  dqb_itime;        /* time limit for excessive inode use */
+};
+/* you can use this switch to hard-wire the quota API if it's not identified correctly */
+/* #define LINUX_API_VERSION 1 */  /* API range [1..3] */
+
+int linuxquota_query( const char * dev, int uid, int isgrp, struct dqblk * dqb );
+int linuxquota_setqlim( const char * dev, int uid, int isgrp, struct dqblk * dqb );
+int linuxquota_sync( const char * dev, int isgrp );
+
+
+#define Q_DIV(X) (X)
+#define Q_MUL(X) (X)
+#define DEV_QBSIZE 1024
+
+#define Q_CTL_V3
+#define CADR (caddr_t)
+
+#define MY_XDR
+
+#define MNTENT mntent
+
+#define GQR_STATUS status
+#define GQR_RQUOTA getquota_rslt_u.gqr_rquota
+
+#define QS_BHARD dqb_bhardlimit
+#define QS_BSOFT dqb_bsoftlimit
+#define QS_BCUR  dqb_curblocks
+#define QS_FHARD dqb_ihardlimit
+#define QS_FSOFT dqb_isoftlimit
+#define QS_FCUR  dqb_curinodes
+#define QS_BTIME dqb_btime
+#define QS_FTIME dqb_itime
+
+/* uncomment this is you're using NFS with a version of the quota tools < 3.0 */
+/* #define LINUX_RQUOTAD_BUG */
+
+/* enable support for extended quota RPC (i.e. quota RPC version 2) */
+/* note: could also be enabled by defining MY_XDR (and including "include/rquota.h") */
+#if defined (EXT_RQUOTAVERS)
+#define USE_EXT_RQUOTA
+#endif