summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/statfix64.h
blob: a35ca7ae3d9962cf0007f3a6a1e493923b336430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef STATFIX_H
#define STATFIX_H

#include <features.h>
#include <limits.h>

#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 
#undef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS   64
#endif
#ifndef __USE_LARGEFILE64
# define __USE_LARGEFILE64      1
#endif
/* We absolutely do _NOT_ want interfaces silently
 *  * renamed under us or very bad things will happen... */
#ifdef __USE_FILE_OFFSET64
# undef __USE_FILE_OFFSET64
#endif

#ifdef __UCLIBC_HAVE_LFS__ 
#if defined __WORDSIZE && __WORDSIZE < 64 

#include <sys/types.h>

/* Pull in whatever this particular arch's kernel thinks the kernel version of
 * struct stat should look like.  It turns out that each arch has a different
 * opinion on the subject, and different kernel revs use different names... */
#define stat kernel_stat
#define new_stat kernel_stat
#define stat64 kernel_stat64
#define new_stat64 kernel_stat64
#include <asm/stat.h> 
#undef new_stat64
#undef stat64
#undef new_stat
#undef stat


/* Now pull in libc's version of stat */
#define stat libc_stat
#define stat64 libc_stat64
#include <sys/stat.h>
#undef stat64
#undef stat

extern void statfix64(struct libc_stat64 *libcstat, struct kernel_stat64 *kstat);
extern int __fxstat64(int version, int fd, struct libc_stat64 * statbuf);
#else	/* __WORDSIZE */
#include <sys/types.h>

/* Pull in whatever this particular arch's kernel thinks the kernel version of
 * struct stat should look like.  It turns out that each arch has a different
 * opinion on the subject, and different kernel revs use different names... */
#define stat kernel_stat
#define new_stat kernel_stat
#define kernel_stat64 kernel_stat
#include <asm/stat.h> 
#undef new_stat64
#undef stat64
#undef new_stat
#undef stat


/* Now pull in libc's version of stat */
#define stat libc_stat
#define stat64 libc_stat64
#include <sys/stat.h>
#undef stat64
#undef stat

extern void statfix64(struct libc_stat64 *libcstat, struct kernel_stat64 *kstat);
extern int __fxstat64(int version, int fd, struct libc_stat64 * statbuf);

#endif /* __WORDSIZE */
#endif /* __UCLIBC_HAVE_LFS__ */

#endif