r18644: bring in libreplace in lib/replace
[Samba/nascimento.git] / source / lib / replace / system / filesys.h
blob1e48f7ab40408a25a7fef509b56f33e5bbd6ceaa
1 #ifndef _system_filesys_h
2 #define _system_filesys_h
3 /*
4 Unix SMB/CIFS implementation.
6 filesystem system include wrappers
8 Copyright (C) Andrew Tridgell 2004
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <unistd.h>
26 #include <sys/stat.h>
28 #ifdef HAVE_SYS_PARAM_H
29 #include <sys/param.h>
30 #endif
32 #ifdef HAVE_SYS_MOUNT_H
33 #include <sys/mount.h>
34 #endif
36 #ifdef HAVE_SYS_VFS_H
37 #include <sys/vfs.h>
38 #endif
40 #ifdef HAVE_SYS_ACL_H
41 #include <sys/acl.h>
42 #endif
44 #ifdef HAVE_SYS_FS_S5PARAM_H
45 #include <sys/fs/s5param.h>
46 #endif
48 #if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
49 #include <sys/filsys.h>
50 #endif
52 #ifdef HAVE_SYS_STATFS_H
53 # include <sys/statfs.h>
54 #endif
56 #ifdef HAVE_DUSTAT_H
57 #include <sys/dustat.h>
58 #endif
60 #ifdef HAVE_SYS_STATVFS_H
61 #include <sys/statvfs.h>
62 #endif
64 #ifdef HAVE_SYS_FILIO_H
65 #include <sys/filio.h>
66 #endif
68 #include <sys/file.h>
70 #ifdef HAVE_FCNTL_H
71 #include <fcntl.h>
72 #else
73 #ifdef HAVE_SYS_FCNTL_H
74 #include <sys/fcntl.h>
75 #endif
76 #endif
78 #ifdef HAVE_SYS_MODE_H
79 /* apparently AIX needs this for S_ISLNK */
80 #ifndef S_ISLNK
81 #include <sys/mode.h>
82 #endif
83 #endif
85 #ifdef HAVE_SYS_IOCTL_H
86 #include <sys/ioctl.h>
87 #endif
90 * Veritas File System. Often in addition to native.
91 * Quotas different.
93 #if defined(HAVE_SYS_FS_VX_QUOTA_H)
94 #define VXFS_QUOTA
95 #endif
97 #if HAVE_SYS_ATTRIBUTES_H
98 #include <sys/attributes.h>
99 #endif
101 /* mutually exclusive (SuSE 8.2) */
102 #if HAVE_ATTR_XATTR_H
103 #include <attr/xattr.h>
104 #elif HAVE_SYS_XATTR_H
105 #include <sys/xattr.h>
106 #endif
109 #ifdef HAVE_SYS_RESOURCE_H
110 #include <sys/resource.h>
111 #endif
113 /* Some POSIX definitions for those without */
115 #ifndef S_IFDIR
116 #define S_IFDIR 0x4000
117 #endif
118 #ifndef S_ISDIR
119 #define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR)
120 #endif
121 #ifndef S_IRWXU
122 #define S_IRWXU 00700 /* read, write, execute: owner */
123 #endif
124 #ifndef S_IRUSR
125 #define S_IRUSR 00400 /* read permission: owner */
126 #endif
127 #ifndef S_IWUSR
128 #define S_IWUSR 00200 /* write permission: owner */
129 #endif
130 #ifndef S_IXUSR
131 #define S_IXUSR 00100 /* execute permission: owner */
132 #endif
133 #ifndef S_IRWXG
134 #define S_IRWXG 00070 /* read, write, execute: group */
135 #endif
136 #ifndef S_IRGRP
137 #define S_IRGRP 00040 /* read permission: group */
138 #endif
139 #ifndef S_IWGRP
140 #define S_IWGRP 00020 /* write permission: group */
141 #endif
142 #ifndef S_IXGRP
143 #define S_IXGRP 00010 /* execute permission: group */
144 #endif
145 #ifndef S_IRWXO
146 #define S_IRWXO 00007 /* read, write, execute: other */
147 #endif
148 #ifndef S_IROTH
149 #define S_IROTH 00004 /* read permission: other */
150 #endif
151 #ifndef S_IWOTH
152 #define S_IWOTH 00002 /* write permission: other */
153 #endif
154 #ifndef S_IXOTH
155 #define S_IXOTH 00001 /* execute permission: other */
156 #endif
158 #ifndef O_ACCMODE
159 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
160 #endif
162 #ifndef MAXPATHLEN
163 #define MAXPATHLEN 256
164 #endif
166 #ifndef SEEK_SET
167 #define SEEK_SET 0
168 #endif
170 #endif