]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/darwin.h
2 * Copyright (c) 2004-2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef __XFS_DARWIN_H__
19 #define __XFS_DARWIN_H__
21 #include <uuid/uuid.h>
25 #include <sys/ioctl.h>
26 #include <sys/mount.h>
28 #include <sys/syscall.h>
30 # define SYS_fsctl 242
32 static __inline__
int xfsctl(const char *path
, int fd
, int cmd
, void *p
)
34 return syscall(SYS_fsctl
, path
, cmd
, p
, 0);
37 static __inline__
int platform_test_xfs_fd(int fd
)
40 if (fstatfs(fd
, &buf
) < 0)
42 return (strcmp(buf
.f_fstypename
, "xfs") == 0);
45 static __inline__
int platform_test_xfs_path(const char *path
)
48 if (statfs(path
, &buf
) < 0)
50 return (strcmp(buf
.f_fstypename
, "xfs") == 0);
53 static __inline__
int platform_fstatfs(int fd
, struct statfs
*buf
)
55 return fstatfs(fd
, buf
);
58 static __inline__
void platform_getoptreset(void)
64 #define __int8_t int8_t
65 #define __int16_t int16_t
66 #define __int32_t int32_t
67 #define __int32_t int32_t
68 #define __int64_t int64_t
69 #define __uint8_t u_int8_t
70 #define __uint16_t u_int16_t
71 #define __uint32_t u_int32_t
72 #define __uint64_t u_int64_t
78 #define __u16 u_int16_t
79 #define __u32 u_int32_t
80 #define __u64 u_int64_t
84 typedef off_t xfs_off_t
;
85 typedef u_int64_t xfs_ino_t
;
86 typedef u_int32_t xfs_dev_t
;
87 typedef int64_t xfs_daddr_t
;
88 typedef char* xfs_caddr_t
;
90 typedef unsigned char uchar_t
;
95 #define pwrite64 pwrite
96 #define ftruncate64 ftruncate
97 #define fdatasync fsync
98 #define memalign(a,sz) valloc(sz)
100 #include <machine/endian.h>
101 #define __BYTE_ORDER BYTE_ORDER
102 #define __BIG_ENDIAN BIG_ENDIAN
103 #define __LITTLE_ENDIAN LITTLE_ENDIAN
104 #include <xfs/swab.h>
106 #define O_LARGEFILE 0
117 #define ENOATTR 989 /* Attribute not found */
118 #define EFSCORRUPTED 990 /* Filesystem is corrupted */
119 #define constpp char * const *
123 #endif /* __XFS_DARWIN_H__ */