]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/unix.h
Linux 2.6 quota interface. [Bjoern]
[netatalk.git] / etc / afpd / unix.h
1 /*
2  * $Id: unix.h,v 1.16 2003-12-28 13:51:12 srittau Exp $
3  */
4
5 #ifndef AFPD_UNIX_H
6 #define AFPD_UNIX_H
7
8 #ifdef HAVE_SYS_CDEFS_H
9 #include <sys/cdefs.h>
10 #endif /* HAVE_SYS_CDEFS_H */
11 #include <netatalk/endian.h>
12 #include "volume.h"
13
14 #if defined( sun ) && !defined( __svr4__ )
15 #ifdef i386
16 typedef int     mode_t;
17 #endif /*i386*/
18 #endif /*sun __svr4__*/
19
20 #if defined(HAVE_SYS_VFS_H) || defined( sun ) || defined( ibm032 ) 
21 #include <sys/vfs.h>
22 #endif /* HAVE_SYS_VFS_H || sun || ibm032 */
23
24 #if defined(_IBMR2) || defined(HAVE_STATFS_H) 
25 #include <sys/statfs.h>
26 /* this might not be right. */
27 #define f_mntfromname f_fname
28 #endif /* _IBMR2 || HAVE_STATFS_H */
29
30 #if defined(TRU64)
31 #define f_frsize f_fsize
32 #else /* TRU64 */
33 #if defined(HAVE_SYS_STATVFS_H) || defined(__svr4__)
34 #include <sys/statvfs.h>
35 #define statfs statvfs
36 #else /* HAVE_SYS_STATVFS || __svr4__ */
37 #define f_frsize f_bsize
38 #endif /* USE_STATVFS_H */
39 #endif /* TRU64 */
40
41 #if defined(__svr4__) || defined(HAVE_SYS_MNTTAB_H)
42 #include <sys/mnttab.h>
43 #endif /* __svr4__ || HAVE_SYS_MNTTAB_H */
44
45 #ifdef HAVE_SYS_MOUNT_H
46 #include <sys/mount.h>
47 #endif /* HAVE_SYS_MOUNT_H */
48
49 #if defined(linux) || defined(HAVE_MNTENT_H)
50 #include <mntent.h>
51 #endif /* linux || HAVE_MNTENT_H */
52
53
54 #ifndef NO_QUOTA_SUPPORT
55
56 #if !(defined(__svr4__) || defined(HAVE_DQB_BTIMELIMIT))
57 #define dqb_btimelimit  dqb_btime
58 #endif /* ! __svr4__ || HAVE_DQB_BTIMELIMIT */
59
60 #if defined(HAVE_SYS_QUOTA_H)
61 #include <sys/quota.h>
62 #endif /* HAVE_SYS_QUOTA_H */
63
64 #ifdef __svr4__ 
65 #include <sys/fs/ufs_quota.h>
66 #endif /* __svr4__ */
67
68 #ifdef BSD4_4
69 #include <ufs/ufs/quota.h>
70 #endif /* BSD4_4 */
71
72 #ifdef HAVE_UFS_QUOTA_H
73 #include <ufs/quota.h>
74 #endif /* HAVE_UFS_QUOTA_H */
75
76 #include <unistd.h>
77 #include <sys/types.h>
78 #include <sys/stat.h>
79 #include "directory.h"
80
81 #ifdef HAVE_STRUCT_IF_DQBLK
82 #undef dqblk
83 #define dqblk if_dqblk
84 #endif
85
86 extern int getnfsquota __P((const struct vol *, const int, const u_int32_t,
87                                 struct dqblk *));
88
89 extern int uquota_getvolspace __P((const struct vol *, VolSpace *, VolSpace *,
90                                        const u_int32_t));
91 #endif /* NO_QUOTA_SUPPORT */
92
93 extern struct afp_options default_options;
94
95 extern int gmem            __P((const gid_t));
96 extern int setdeskmode      __P((const mode_t));
97 extern int setdirunixmode   __P((const mode_t, const int, const int));
98 extern int setdirmode       __P((const mode_t, const int, const int));
99 extern int setdeskowner     __P((const uid_t, const gid_t));
100 extern int setdirowner      __P((const uid_t, const gid_t, const int));
101 extern int setfilmode       __P((char *, mode_t , struct stat *));
102 extern int setfilemode      __P((struct path*, const mode_t));
103 extern int unix_rename      __P((const char *oldpath, const char *newpath));
104
105 extern void accessmode      __P((char *, struct maccess *, struct dir *, struct stat *));
106
107 #ifdef AFS      
108     #define accessmode afsmode
109 #endif 
110
111 #endif /* UNIX_H */