- Timestamp:
- Jul 15, 2008, 10:16:11 PM (13 years ago)
- Location:
- zzuf/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/configure.ac
r2527 r2528 39 39 40 40 AC_CHECK_FUNCS(setenv waitpid setrlimit gettimeofday fork kill pipe _pipe) 41 AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 dup dup2 fseeko_IO_getc getline getdelim __getdelim fgetln __srefill map_fd memalign posix_memalign aio_read accept bind connect socket readv pread recv recvfrom recvmsg mmap valloc sigaction getpagesize getc_unlocked getchar_unlocked fgetc_unlocked fread_unlocked fgets_unlocked)41 AC_CHECK_FUNCS(open64 __open64 lseek64 mmap64 fopen64 __fopen64 __freopen64 dup dup2 fseeko __fseeko64 _IO_getc getline getdelim __getdelim fgetln __srefill map_fd memalign posix_memalign aio_read accept bind connect socket readv pread recv recvfrom recvmsg mmap valloc sigaction getpagesize getc_unlocked getchar_unlocked fgetc_unlocked fread_unlocked fgets_unlocked) 42 42 43 43 AC_CHECK_TYPES(sighandler_t, [], [], -
zzuf/trunk/doc/libzzuf.3
r2365 r2528 94 94 \fBfree\fR(), \fBmemalign\fR(), \fBposix_memalign\fR() 95 95 .TP 96 Linux-specific:96 Required on Linux: 97 97 \fBopen64\fR(), \fBlseek64\fR(), \fBmmap64\fR(), \fB_IO_getc\fR(), 98 98 \fBgetline\fR(), \fBgetdelim\fR(), \fB__getdelim\fR(), \fBgetc_unlocked\fR(), … … 100 100 \fBfread_unlocked\fR() 101 101 .TP 102 BSD-specific:102 Required on BSD systems: 103 103 \fBfgetln\fR(), \fB__srefill\fR() 104 104 .TP 105 Mac OS X-specific:105 Required on Mac OS X: 106 106 \fBmap_fd\fR() 107 .TP 108 Required on HP-UX: 109 \fB__fopen64\fR(), \fB__fseeko64\fR(), \fB__freopen64\fR(), \fB__open64\fR(), 110 \fB__lseek64\fR() 107 111 .TP 108 112 Signal handling: -
zzuf/trunk/src/lib-fd.c
r2527 r2528 84 84 static int (*ORIG(open64)) (const char *file, int oflag, ...); 85 85 #endif 86 #if defined HAVE___OPEN64 87 static int (*ORIG(__open64))(const char *file, int oflag, ...); 88 #endif 86 89 #if defined HAVE_DUP 87 90 static int (*ORIG(dup)) (int oldfd); … … 133 136 #if defined HAVE_LSEEK64 134 137 static off64_t (*ORIG(lseek64)) (int fd, off64_t offset, int whence); 138 #endif 139 #if defined HAVE___LSEEK64 140 static off64_t (*ORIG(__lseek64)) (int fd, off64_t offset, int whence); 135 141 #endif 136 142 static int (*ORIG(close)) (int fd); … … 177 183 { 178 184 int ret; OPEN(open64); return ret; 185 } 186 #endif 187 188 #if defined HAVE___OPEN64 189 int NEW(__open64)(const char *file, int oflag, ...) 190 { 191 int ret; OPEN(__open64); return ret; 179 192 } 180 193 #endif … … 523 536 off64_t NEW(lseek64)(int fd, off64_t offset, int whence) 524 537 { 525 off64_t ret; 526 LSEEK(lseek64, off64_t); 527 return ret; 538 off64_t ret; LSEEK(lseek64, off64_t); return ret; 539 } 540 #endif 541 542 #if defined HAVE___LSEEK64 543 off64_t NEW(__lseek64)(int fd, off64_t offset, int whence) 544 { 545 off64_t ret; LSEEK(__lseek64, off64_t); return ret; 528 546 } 529 547 #endif -
zzuf/trunk/src/lib-stream.c
r2524 r2528 49 49 static FILE * (*ORIG(fopen64)) (const char *path, const char *mode); 50 50 #endif 51 #if defined HAVE___FOPEN64 52 static FILE * (*ORIG(__fopen64))(const char *path, const char *mode); 53 #endif 51 54 static FILE * (*ORIG(freopen)) (const char *path, const char *mode, 52 55 FILE *stream); 56 #if defined HAVE___FREOPEN64 57 static FILE * (*ORIG(__freopen64)) (const char *path, const char *mode, 58 FILE *stream); 59 #endif 53 60 static int (*ORIG(fseek)) (FILE *stream, long offset, int whence); 54 61 #if defined HAVE_FSEEKO 55 62 static int (*ORIG(fseeko)) (FILE *stream, off_t offset, int whence); 63 #endif 64 #if defined HAVE___FSEEKO64 65 static int (*ORIG(__fseeko64)) (FILE *stream, off_t offset, int whence); 56 66 #endif 57 67 static void (*ORIG(rewind)) (FILE *stream); … … 135 145 #endif 136 146 147 #if defined HAVE___FOPEN64 148 FILE *NEW(__fopen64)(const char *path, const char *mode) 149 { 150 FILE *ret; FOPEN(__fopen64); return ret; 151 } 152 #endif 153 154 #define FREOPEN(fn) \ 155 do \ 156 { \ 157 int fd0 = -1, fd1 = -1, disp = 0; \ 158 LOADSYM(fn); \ 159 if(_zz_ready && (fd0 = fileno(stream)) >= 0 && _zz_iswatched(fd0)) \ 160 { \ 161 _zz_unregister(fd0); \ 162 disp = 1; \ 163 } \ 164 _zz_lock(-1); \ 165 ret = ORIG(fn)(path, mode, stream); \ 166 _zz_unlock(-1); \ 167 if(ret && _zz_mustwatch(path)) \ 168 { \ 169 fd1 = fileno(ret); \ 170 _zz_register(fd1); \ 171 disp = 1; \ 172 } \ 173 if(disp) \ 174 debug("%s(\"%s\", \"%s\", [%i]) = [%i]", __func__, \ 175 path, mode, fd0, fd1); \ 176 } while(0) 177 137 178 FILE *NEW(freopen)(const char *path, const char *mode, FILE *stream) 138 179 { 139 FILE *ret; 140 int fd0 = -1, fd1 = -1, disp = 0; 141 142 LOADSYM(freopen); 143 if(_zz_ready && (fd0 = fileno(stream)) >= 0 && _zz_iswatched(fd0)) 144 { 145 _zz_unregister(fd0); 146 disp = 1; 147 } 148 149 _zz_lock(-1); 150 ret = ORIG(freopen)(path, mode, stream); 151 _zz_unlock(-1); 152 153 if(ret && _zz_mustwatch(path)) 154 { 155 fd1 = fileno(ret); 156 _zz_register(fd1); 157 disp = 1; 158 } 159 160 if(disp) 161 debug("%s(\"%s\", \"%s\", [%i]) = [%i]", __func__, 162 path, mode, fd0, fd1); 163 164 return ret; 165 } 180 FILE *ret; FREOPEN(freopen); return ret; 181 } 182 183 #if defined HAVE___FREOPEN64 184 FILE *NEW(__freopen64)(const char *path, const char *mode, FILE *stream) 185 { 186 FILE *ret; FREOPEN(__freopen64); return ret; 187 } 188 #endif 166 189 167 190 #if defined HAVE___SREFILL /* Don't fuzz or seek if we have __srefill() */ … … 212 235 { 213 236 int ret; FSEEK(fseeko, ftello); return ret; 237 } 238 #endif 239 240 #if defined HAVE___FSEEKO64 241 int NEW(__fseeko64)(FILE *stream, off64_t offset, int whence) 242 { 243 int ret; FSEEK(__fseeko64, ftello); return ret; 214 244 } 215 245 #endif
Note: See TracChangeset
for help on using the changeset viewer.