1 #ifndef _system_filesys_h
2 #define _system_filesys_h
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.
28 #ifdef HAVE_SYS_PARAM_H
29 #include <sys/param.h>
32 #ifdef HAVE_SYS_MOUNT_H
33 #include <sys/mount.h>
44 #ifdef HAVE_SYS_FS_S5PARAM_H
45 #include <sys/fs/s5param.h>
48 #if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
49 #include <sys/filsys.h>
52 #ifdef HAVE_SYS_STATFS_H
53 # include <sys/statfs.h>
57 #include <sys/dustat.h>
60 #ifdef HAVE_SYS_STATVFS_H
61 #include <sys/statvfs.h>
64 #ifdef HAVE_SYS_FILIO_H
65 #include <sys/filio.h>
73 #ifdef HAVE_SYS_FCNTL_H
74 #include <sys/fcntl.h>
78 #ifdef HAVE_SYS_MODE_H
79 /* apparently AIX needs this for S_ISLNK */
85 #ifdef HAVE_SYS_IOCTL_H
86 #include <sys/ioctl.h>
90 * Veritas File System. Often in addition to native.
93 #if defined(HAVE_SYS_FS_VX_QUOTA_H)
97 #if HAVE_SYS_ATTRIBUTES_H
98 #include <sys/attributes.h>
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>
109 #ifdef HAVE_SYS_RESOURCE_H
110 #include <sys/resource.h>
113 /* Some POSIX definitions for those without */
116 #define S_IFDIR 0x4000
119 #define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR)
122 #define S_IRWXU 00700 /* read, write, execute: owner */
125 #define S_IRUSR 00400 /* read permission: owner */
128 #define S_IWUSR 00200 /* write permission: owner */
131 #define S_IXUSR 00100 /* execute permission: owner */
134 #define S_IRWXG 00070 /* read, write, execute: group */
137 #define S_IRGRP 00040 /* read permission: group */
140 #define S_IWGRP 00020 /* write permission: group */
143 #define S_IXGRP 00010 /* execute permission: group */
146 #define S_IRWXO 00007 /* read, write, execute: other */
149 #define S_IROTH 00004 /* read permission: other */
152 #define S_IWOTH 00002 /* write permission: other */
155 #define S_IXOTH 00001 /* execute permission: other */
159 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
163 #define MAXPATHLEN 256