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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
From: Felipe Sateler <fsateler@gmail.com>
Date: Thu, 15 Apr 2010 15:00:23 -0400
Subject: [PATCH] Drop cases for glibc < 2.4
Some functions definitions were dependent on the glibc version. Since
2.7 is in stable, drop everything for < 2.4.
---
installwatch/installwatch.c | 31 -------------------------------
1 files changed, 0 insertions(+), 31 deletions(-)
--- a/installwatch/installwatch.c
+++ b/installwatch/installwatch.c
@@ -88,11 +88,7 @@
static int (*true_open)(const char *, int, ...);
static DIR *(*true_opendir)(const char *);
static struct dirent *(*true_readdir)(DIR *dir);
-#if (GLIBC_MINOR <= 4)
-static int (*true_readlink)(const char*,char *,size_t);
-#else
static ssize_t (*true_readlink)(const char*,char *,size_t);
-#endif
static char *(*true_realpath)(const char *,char *);
static int (*true_rename)(const char *, const char *);
static int (*true_rmdir)(const char *);
@@ -122,8 +118,6 @@
size_t, int);
static int (*true_removexattr)(const char *,const char *);
-#if(GLIBC_MINOR >= 1)
-
static int (*true_creat64)(const char *, __mode_t);
static FILE *(*true_fopen64)(const char *,const char *);
static int (*true_ftruncate64)(int, __off64_t);
@@ -143,9 +137,7 @@
static int (*true_lxstat64)(int,const char *, struct stat64 *);
static int (*true_truncate64)(const char *, __off64_t);
-#endif
-#if (GLIBC_MINOR >= 4)
static int (*true_openat)(int, const char *, int, ...);
static int (*true_fchmodat)(int, const char *, mode_t, int);
static int (*true_fchownat)(int, const char *, uid_t, gid_t, int);
@@ -158,7 +150,6 @@
static int (*true_renameat)(int, const char *, int, const char *);
static int (*true_symlinkat)(const char *, int, const char *);
static int (*true_unlinkat)(int, const char *, int);
-#endif
#if defined __GNUC__ && __GNUC__>=2
#define inline inline
@@ -178,7 +169,6 @@
return true_lxstat(_STAT_VER,pathname,info);
}
-#if (GLIBC_MINOR >= 4)
static inline int true_fstatat(int dirfd, const char *pathname, struct stat *info, int flags) {
return true_fxstatat(_STAT_VER, dirfd, pathname, info, flags);
}
@@ -191,7 +181,6 @@
return true_xmknodat(_MKNOD_VER, dirfd, pathname, mode, &dev);
}
-#endif
/* A few defines to fix things a little */
#define INSTW_OK 0
@@ -285,10 +274,8 @@
#if DEBUG
static int __instw_printdirent(struct dirent*);
-#if(GLIBC_MINOR >= 1)
static int __instw_printdirent64(struct dirent64*);
#endif
-#endif
#ifdef DEBUG
static int instw_print(instw_t *);
@@ -303,9 +290,7 @@
static int instw_setmetatransl(instw_t *);
static int instw_setpath(instw_t *,const char *);
-#if (GLIBC_MINOR >= 4)
static int instw_setpathrel(instw_t *, int, const char *);
-#endif
static int instw_getstatus(instw_t *,int *);
static int instw_apply(instw_t *);
static int instw_filldirls(instw_t *);
@@ -392,7 +377,6 @@
-#if(GLIBC_MINOR >= 1)
true_creat64 = dlsym(libc_handle, "creat64");
true_fopen64 = dlsym(libc_handle, "fopen64");
true_ftruncate64 = dlsym(libc_handle, "ftruncate64");
@@ -403,9 +387,7 @@
true_lxstat64 = dlsym(libc_handle, "__lxstat64");
true_truncate64 = dlsym(libc_handle, "truncate64");
true_removexattr = dlsym(libc_handle, "removexattr");
-#endif
-#if (GLIBC_MINOR >= 4)
true_openat = dlsym(libc_handle, "openat");
true_fchmodat = dlsym(libc_handle, "fchmodat");
@@ -420,7 +402,6 @@
true_symlinkat = dlsym(libc_handle, "symlinkat");
true_unlinkat = dlsym(libc_handle, "unlinkat");
-#endif
if(instw_init()) exit(-1);
}
@@ -1687,7 +1668,6 @@
* returns = / 0 ok. path set
* -1 failed. cf errno /
*/
-#if (GLIBC_MINOR >= 4)
static int instw_setpathrel(instw_t *instw, int dirfd, const char *relpath) {
/* This constant should be large enough to make a string that holds
@@ -1727,7 +1707,6 @@
#undef PROC_PATH_LEN
}
-#endif
/*
* procedure = / rc:=instw_getstatus(instw,status) /
@@ -2958,13 +2937,8 @@
return result;
}
-#if (GLIBC_MINOR <= 4)
-int readlink(const char *path,char *buf,size_t bufsiz) {
- int result;
-#else
ssize_t readlink(const char *path,char *buf,size_t bufsiz) {
ssize_t result;
-#endif
instw_t instw;
int status;
@@ -3518,7 +3492,6 @@
return result;
}
-#if(GLIBC_MINOR >= 1)
int creat64(const char *pathname, __mode_t mode) {
/* Is it a system call? */
@@ -3862,7 +3835,6 @@
return result;
}
-#endif /* GLIBC_MINOR >= 1 */
/***********************************************
@@ -3882,7 +3854,6 @@
* Thanks to Gilbert Ashley for his work on this!
*/
-#if (GLIBC_MINOR >= 4)
int openat (int dirfd, const char *path, int flags, ...) {
mode_t mode = 0;
@@ -4547,5 +4518,3 @@
}
-
-#endif /* GLIBC_MINOR >= 4 */
|