1 /* this test should find out what quota api is available on the os */
3 int autoconf_quota(void);
5 #if defined(HAVE_QUOTACTL_4A)
6 /* long quotactl(int cmd, char *special, qid_t id, caddr_t addr) */
8 #ifdef HAVE_SYS_TYPES_H
12 #ifdef HAVE_ASM_TYPES_H
13 #include <asm/types.h>
16 #if defined(HAVE_LINUX_QUOTA_H)
17 # include <linux/quota.h>
18 # if defined(HAVE_STRUCT_IF_DQBLK)
19 # define SYS_DQBLK if_dqblk
20 # elif defined(HAVE_STRUCT_MEM_DQBLK)
21 # define SYS_DQBLK mem_dqblk
23 #elif defined(HAVE_SYS_QUOTA_H)
24 # include <sys/quota.h>
28 /* HPUX has no prototype for quotactl but we test compile with strict
29 error checks, which would fail without function prototype */
30 extern int quotactl(int cmd
, const char *special
, uid_t uid
, void *addr
);
34 #define SYS_DQBLK dqblk
37 int autoconf_quota(void);
39 int autoconf_quota(void)
44 ret
= quotactl(Q_GETQUOTA
,"/dev/hda1",0,(void *)&D
);
49 #elif defined(HAVE_QUOTACTL_4B)
50 /* int quotactl(const char *path, int cmd, int id, char *addr); */
52 #ifdef HAVE_SYS_TYPES_H
53 #include <sys/types.h>
56 #ifdef HAVE_SYS_QUOTA_H
57 #include <sys/quota.h>
59 #include <sys/types.h>
60 #ifdef HAVE_UFS_UFS_QUOTA_H
61 #include <ufs/ufs/quota.h>
63 #include <machine/param.h>
66 int autoconf_quota(void)
71 ret
= quotactl("/",Q_GETQUOTA
,0,(char *) &D
);
76 #elif defined(HAVE_QUOTACTL_2)
78 #error HAVE_QUOTACTL_2 not implemented
82 #error Unknow QUOTACTL prototype