1 /* this test should find out what quota api is available on the os */
3 #if defined(HAVE_QUOTACTL_4A)
4 /* long quotactl(int cmd, char *special, qid_t id, caddr_t addr) */
6 #ifdef HAVE_SYS_TYPES_H
10 #ifdef HAVE_ASM_TYPES_H
11 #include <asm/types.h>
14 #if defined(HAVE_LINUX_QUOTA_H)
15 # include <linux/quota.h>
16 # if defined(HAVE_STRUCT_IF_DQBLK)
17 # define SYS_DQBLK if_dqblk
18 # elif defined(HAVE_STRUCT_MEM_DQBLK)
19 # define SYS_DQBLK mem_dqblk
21 #elif defined(HAVE_SYS_QUOTA_H)
22 # include <sys/quota.h>
26 #define SYS_DQBLK dqblk
29 int autoconf_quota(void)
34 ret
= quotactl(Q_GETQUOTA
,"/dev/hda1",0,(void *)&D
);
39 #elif defined(HAVE_QUOTACTL_4B)
40 /* int quotactl(const char *path, int cmd, int id, char *addr); */
42 #ifdef HAVE_SYS_QUOTA_H
43 #include <sys/quota.h>
45 #include <sys/types.h>
46 #include <ufs/ufs/quota.h>
47 #include <machine/param.h>
50 int autoconf_quota(void)
55 ret
= quotactl("/",Q_GETQUOTA
,0,(char *) &D
);
60 #elif defined(HAVE_QUOTACTL_3)
61 /* int quotactl (char *spec, int request, char *arg); */
63 #ifdef HAVE_SYS_TYPES_H
64 #include <sys/types.h>
66 #ifdef HAVE_SYS_QUOTA_H
67 #include <sys/quota.h>
70 int autoconf_quota(void)
73 struct q_request request
;
75 ret
= quotactl("/", Q_GETQUOTA
, &request
);
80 #elif defined(HAVE_QUOTACTL_2)
82 #error HAVE_QUOTACTL_2 not implemented
86 #error Unknow QUOTACTL prototype