libcli4: Call map_netlogon_samlogon_response directly
[samba4-gss.git] / tests / sysquotas.c
blob1c98d2093bc9c70cb1450deafdd255daa7fa39a4
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
9 #include <sys/types.h>
10 #endif
12 #ifdef HAVE_ASM_TYPES_H
13 #include <asm/types.h>
14 #endif
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
22 # endif
23 #elif defined(HAVE_SYS_QUOTA_H)
24 # include <sys/quota.h>
25 #endif
27 #ifdef HPUX
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);
31 #endif
33 #ifndef SYS_DQBLK
34 #define SYS_DQBLK dqblk
35 #endif
37 int autoconf_quota(void);
39 int autoconf_quota(void)
41 int ret = -1;
42 struct SYS_DQBLK D;
44 ret = quotactl(Q_GETQUOTA,"/dev/hda1",0,(void *)&D);
46 return ret;
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>
54 #endif
56 #ifdef HAVE_SYS_QUOTA_H
57 #include <sys/quota.h>
58 #endif
60 #ifdef HAVE_UFS_UFS_QUOTA_H
61 #include <ufs/ufs/quota.h>
62 #endif
64 #if defined(HAVE_JFS_QUOTA_H)
65 #include <jfs/quota.h>
66 #endif
68 int autoconf_quota(void)
70 int ret = -1;
71 struct dqblk D;
73 ret = quotactl("/",Q_GETQUOTA,0,(char *) &D);
75 return ret;
78 #elif defined(HAVE_QUOTACTL_2)
80 #error HAVE_QUOTACTL_2 not implemented
82 #else
84 #error Unknown QUOTACTL prototype
86 #endif
88 int main(void)
90 autoconf_quota();
91 return 0;