libfuse

fuse_misc.h
1 /*
2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
4
5 This program can be distributed under the terms of the GNU LGPLv2.
6 See the file COPYING.LIB
7 */
8
9 #include <pthread.h>
10
11 /*
12 Versioned symbols cannot be used in some cases because it
13 - not supported on MacOSX (in MachO binary format)
14
15 Note: "@@" denotes the default symbol, "@" is binary a compat version.
16
17 */
18 #ifdef HAVE_LIBC_VERSIONED_SYMBOLS
19 # if HAVE_SYMVER_ATTRIBUTE
20 # define FUSE_SYMVER(sym1, sym2) __attribute__ ((symver (sym2)))
21 # else
22 # define FUSE_SYMVER(sym1, sym2) __asm__("\t.symver " sym1 "," sym2);
23 # endif
24 #else
25 #define FUSE_SYMVER(sym1, sym2)
26 #endif
27
28 #ifdef HAVE_STRUCT_STAT_ST_ATIM
29 /* Linux */
30 #define ST_ATIM_NSEC(stbuf) ((stbuf)->st_atim.tv_nsec)
31 #define ST_CTIM_NSEC(stbuf) ((stbuf)->st_ctim.tv_nsec)
32 #define ST_MTIM_NSEC(stbuf) ((stbuf)->st_mtim.tv_nsec)
33 #define ST_ATIM_NSEC_SET(stbuf, val) (stbuf)->st_atim.tv_nsec = (val)
34 #define ST_CTIM_NSEC_SET(stbuf, val) (stbuf)->st_ctim.tv_nsec = (val)
35 #define ST_MTIM_NSEC_SET(stbuf, val) (stbuf)->st_mtim.tv_nsec = (val)
36 #elif defined(HAVE_STRUCT_STAT_ST_ATIMESPEC)
37 /* FreeBSD */
38 #define ST_ATIM_NSEC(stbuf) ((stbuf)->st_atimespec.tv_nsec)
39 #define ST_CTIM_NSEC(stbuf) ((stbuf)->st_ctimespec.tv_nsec)
40 #define ST_MTIM_NSEC(stbuf) ((stbuf)->st_mtimespec.tv_nsec)
41 #define ST_ATIM_NSEC_SET(stbuf, val) (stbuf)->st_atimespec.tv_nsec = (val)
42 #define ST_CTIM_NSEC_SET(stbuf, val) (stbuf)->st_ctimespec.tv_nsec = (val)
43 #define ST_MTIM_NSEC_SET(stbuf, val) (stbuf)->st_mtimespec.tv_nsec = (val)
44 #else
45 #define ST_ATIM_NSEC(stbuf) 0
46 #define ST_CTIM_NSEC(stbuf) 0
47 #define ST_MTIM_NSEC(stbuf) 0
48 #define ST_ATIM_NSEC_SET(stbuf, val) do { } while (0)
49 #define ST_CTIM_NSEC_SET(stbuf, val) do { } while (0)
50 #define ST_MTIM_NSEC_SET(stbuf, val) do { } while (0)
51 #endif