]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/unix.h
apply parts of the netbsd build patch by Patrick Welche <prlw1@newn.cam.ac.uk>, mostl...
[netatalk.git] / etc / afpd / unix.h
1 /*
2  * $Id: unix.h,v 1.17 2004-01-14 16:10:29 bfernhomberg 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 #ifdef HAVE_SYS_PARM_H
47 #include <sys/parm.h>
48 #endif /* HAVE_SYS_PARM_H */
49 #include <sys/mount.h>
50 #endif /* HAVE_SYS_MOUNT_H */
51
52 #if defined(linux) || defined(HAVE_MNTENT_H)
53 #include <mntent.h>
54 #endif /* linux || HAVE_MNTENT_H */
55
56
57 #ifndef NO_QUOTA_SUPPORT
58
59 #if !(defined(__svr4__) || defined(HAVE_DQB_BTIMELIMIT))
60 #define dqb_btimelimit  dqb_btime
61 #endif /* ! __svr4__ || HAVE_DQB_BTIMELIMIT */
62
63 #if defined(HAVE_SYS_QUOTA_H)
64 #include <sys/quota.h>
65 #endif /* HAVE_SYS_QUOTA_H */
66
67 #ifdef __svr4__ 
68 #include <sys/fs/ufs_quota.h>
69 #endif /* __svr4__ */
70
71 #ifdef BSD4_4
72 #include <ufs/ufs/quota.h>
73 #endif /* BSD4_4 */
74
75 #ifdef HAVE_UFS_QUOTA_H
76 #include <ufs/quota.h>
77 #endif /* HAVE_UFS_QUOTA_H */
78
79 #include <unistd.h>
80 #include <sys/types.h>
81 #include <sys/stat.h>
82 #include "directory.h"
83
84 #ifdef HAVE_STRUCT_IF_DQBLK
85 #undef dqblk
86 #define dqblk if_dqblk
87 #endif
88
89 extern int getnfsquota __P((const struct vol *, const int, const u_int32_t,
90                                 struct dqblk *));
91
92 extern int uquota_getvolspace __P((const struct vol *, VolSpace *, VolSpace *,
93                                        const u_int32_t));
94 #endif /* NO_QUOTA_SUPPORT */
95
96 extern struct afp_options default_options;
97
98 extern int gmem            __P((const gid_t));
99 extern int setdeskmode      __P((const mode_t));
100 extern int setdirunixmode   __P((const mode_t, const int, const int));
101 extern int setdirmode       __P((const mode_t, const int, const int));
102 extern int setdeskowner     __P((const uid_t, const gid_t));
103 extern int setdirowner      __P((const uid_t, const gid_t, const int));
104 extern int setfilmode       __P((char *, mode_t , struct stat *));
105 extern int setfilemode      __P((struct path*, const mode_t));
106 extern int unix_rename      __P((const char *oldpath, const char *newpath));
107
108 extern void accessmode      __P((char *, struct maccess *, struct dir *, struct stat *));
109
110 #ifdef AFS      
111     #define accessmode afsmode
112 #endif 
113
114 #endif /* UNIX_H */