tests/sysquotas.c

説明を見る。
00001 /* this test should find out what quota api is available on the os */
00002 
00003  int autoconf_quota(void);
00004 
00005 #if defined(HAVE_QUOTACTL_4A)
00006 /* long quotactl(int cmd, char *special, qid_t id, caddr_t addr) */
00007 
00008 #ifdef HAVE_SYS_TYPES_H
00009 #include <sys/types.h>
00010 #endif
00011 
00012 #ifdef HAVE_ASM_TYPES_H
00013 #include <asm/types.h>
00014 #endif
00015 
00016 #if defined(HAVE_LINUX_QUOTA_H)
00017 # include <linux/quota.h>
00018 # if defined(HAVE_STRUCT_IF_DQBLK)
00019 #  define SYS_DQBLK if_dqblk
00020 # elif defined(HAVE_STRUCT_MEM_DQBLK)
00021 #  define SYS_DQBLK mem_dqblk
00022 # endif
00023 #elif defined(HAVE_SYS_QUOTA_H)
00024 # include <sys/quota.h>
00025 #endif
00026 
00027 #ifndef SYS_DQBLK
00028 #define SYS_DQBLK dqblk
00029 #endif
00030 
00031  int autoconf_quota(void);
00032 
00033  int autoconf_quota(void)
00034 {
00035         int ret = -1;
00036         struct SYS_DQBLK D;
00037 
00038         ret = quotactl(Q_GETQUOTA,"/dev/hda1",0,(void *)&D);
00039         
00040         return ret;
00041 }
00042 
00043 #elif defined(HAVE_QUOTACTL_4B)
00044 /* int quotactl(const char *path, int cmd, int id, char *addr); */
00045 
00046 #ifdef HAVE_SYS_QUOTA_H
00047 #include <sys/quota.h>
00048 #else /* *BSD */
00049 #include <sys/types.h>
00050 #include <ufs/ufs/quota.h>
00051 #include <machine/param.h>
00052 #endif
00053 
00054  int autoconf_quota(void)
00055 {
00056         int ret = -1;
00057         struct dqblk D;
00058 
00059         ret = quotactl("/",Q_GETQUOTA,0,(char *) &D);
00060 
00061         return ret;
00062 }
00063 
00064 #elif defined(HAVE_QUOTACTL_3)
00065 /* int quotactl (char *spec, int request, char *arg); */
00066 
00067 #ifdef HAVE_SYS_TYPES_H
00068 #include <sys/types.h>
00069 #endif
00070 #ifdef HAVE_SYS_QUOTA_H
00071 #include <sys/quota.h>
00072 #endif
00073 
00074  int autoconf_quota(void)
00075 {
00076         int ret = -1;
00077         struct q_request request;
00078 
00079         ret = quotactl("/", Q_GETQUOTA, &request);
00080 
00081         return ret;
00082 }
00083 
00084 #elif defined(HAVE_QUOTACTL_2)
00085 
00086 #error HAVE_QUOTACTL_2 not implemented
00087 
00088 #else
00089 
00090 #error Unknow QUOTACTL prototype
00091 
00092 #endif
00093 
00094  int main(void)
00095 {       
00096         autoconf_quota();
00097         return 0;
00098 }

Sambaに対してSat Aug 29 21:22:59 2009に生成されました。  doxygen 1.4.7