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>
45 #include <acl/libacl.h>
48 #ifdef HAVE_SYS_FS_S5PARAM_H
49 #include <sys/fs/s5param.h>
52 #if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
53 #include <sys/filsys.h>
56 #ifdef HAVE_SYS_STATFS_H
57 # include <sys/statfs.h>
61 #include <sys/dustat.h>
64 #ifdef HAVE_SYS_STATVFS_H
65 #include <sys/statvfs.h>
68 #ifdef HAVE_SYS_FILIO_H
69 #include <sys/filio.h>
77 #ifdef HAVE_SYS_FCNTL_H
78 #include <sys/fcntl.h>
82 #ifdef HAVE_SYS_MODE_H
83 /* apparently AIX needs this for S_ISLNK */
89 #ifdef HAVE_SYS_IOCTL_H
90 #include <sys/ioctl.h>
94 * Veritas File System. Often in addition to native.
97 #if defined(HAVE_SYS_FS_VX_QUOTA_H)
101 #if HAVE_SYS_ATTRIBUTES_H
102 #include <sys/attributes.h>
105 /* mutually exclusive (SuSE 8.2) */
106 #if HAVE_ATTR_XATTR_H
107 #include <attr/xattr.h>
108 #elif HAVE_SYS_XATTR_H
109 #include <sys/xattr.h>
113 #ifdef HAVE_SYS_RESOURCE_H
114 #include <sys/resource.h>
117 /* Some POSIX definitions for those without */
120 #define S_IFDIR 0x4000
123 #define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR)
126 #define S_IRWXU 00700 /* read, write, execute: owner */
129 #define S_IRUSR 00400 /* read permission: owner */
132 #define S_IWUSR 00200 /* write permission: owner */
135 #define S_IXUSR 00100 /* execute permission: owner */
138 #define S_IRWXG 00070 /* read, write, execute: group */
141 #define S_IRGRP 00040 /* read permission: group */
144 #define S_IWGRP 00020 /* write permission: group */
147 #define S_IXGRP 00010 /* execute permission: group */
150 #define S_IRWXO 00007 /* read, write, execute: other */
153 #define S_IROTH 00004 /* read permission: other */
156 #define S_IWOTH 00002 /* write permission: other */
159 #define S_IXOTH 00001 /* execute permission: other */
163 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
167 #define MAXPATHLEN 256