Changeset 2552
- Timestamp:
- Jul 16, 2008, 11:24:09 PM (14 years ago)
- Location:
- zzuf/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/configure.ac
r2542 r2552 39 39 40 40 AC_CHECK_FUNCS(setenv waitpid setrlimit gettimeofday fork kill pipe _pipe) 41 AC_CHECK_FUNCS(open64 __open64 lseek64 __lseek64 mmap64 fopen64 __fopen64 __freopen64 dup dup2 fseeko __fseeko64 __fsetpos64 _IO_getc getline getdelim __getdelim fgetln __srefill __filbuf 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 __lseek64 mmap64 fopen64 __fopen64 freopen64 __freopen64 dup dup2 fseeko fseeko64 __fseeko64 fsetpos64 __fsetpos64 _IO_getc getline getdelim __getdelim fgetln __srefill __filbuf 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
r2533 r2552 109 109 \fB__open64\fR(), \fB__lseek64\fR(), \fB__filbuf\fR() 110 110 .TP 111 Required on OpenSolaris: 112 \fBfreopen64\fR(), \fBfseeko64\fR(), \fBfsetpos64\fR() 113 .TP 111 114 Signal handling: 112 115 \fBsignal\fR(), \fBsigaction\fR() -
zzuf/trunk/src/lib-stream.c
r2542 r2552 63 63 static FILE * (*ORIG(freopen)) (const char *path, const char *mode, 64 64 FILE *stream); 65 #if defined HAVE_FREOPEN64 66 static FILE * (*ORIG(freopen64))(const char *path, const char *mode, 67 FILE *stream); 68 #endif 65 69 #if defined HAVE___FREOPEN64 66 70 static FILE * (*ORIG(__freopen64)) (const char *path, const char *mode, … … 71 75 static int (*ORIG(fseeko)) (FILE *stream, off_t offset, int whence); 72 76 #endif 77 #if defined HAVE_FSEEKO64 78 static int (*ORIG(fseeko64)) (FILE *stream, off_t offset, int whence); 79 #endif 73 80 #if defined HAVE___FSEEKO64 74 81 static int (*ORIG(__fseeko64)) (FILE *stream, off_t offset, int whence); 82 #endif 83 #if defined HAVE_FSETPOS64 84 static int (*ORIG(fsetpos64))(FILE *stream, const fpos64_t *pos); 75 85 #endif 76 86 #if defined HAVE___FSETPOS64 … … 206 216 } 207 217 218 #if defined HAVE_FREOPEN64 219 FILE *NEW(freopen64)(const char *path, const char *mode, FILE *stream) 220 { 221 FILE *ret; FREOPEN(freopen64); return ret; 222 } 223 #endif 224 208 225 #if defined HAVE___FREOPEN64 209 226 FILE *NEW(__freopen64)(const char *path, const char *mode, FILE *stream) … … 263 280 #endif 264 281 282 #if defined HAVE_FSEEKO64 283 int NEW(fseeko64)(FILE *stream, off64_t offset, int whence) 284 { 285 int ret; FSEEK(fseeko64, ftello); return ret; 286 } 287 #endif 288 265 289 #if defined HAVE___FSEEKO64 266 290 int NEW(__fseeko64)(FILE *stream, off64_t offset, int whence) … … 270 294 #endif 271 295 296 #define FSETPOS(fn) \ 297 do \ 298 { \ 299 int fd; \ 300 LOADSYM(fn); \ 301 fd = fileno(stream); \ 302 if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) \ 303 return ORIG(fn)(stream, pos); \ 304 _zz_lock(fd); \ 305 ret = ORIG(fn)(stream, pos); \ 306 _zz_unlock(fd); \ 307 debug("%s([%i], %lli) = %i", __func__, \ 308 fd, (long long int)*pos, ret); \ 309 /* On HP-UX at least, fpos64_t == int64_t */ \ 310 _zz_setpos(fd, (int64_t)*pos); \ 311 } \ 312 while(0) 313 314 #if defined HAVE_FSETPOS64 315 int NEW(fsetpos64)(FILE *stream, const fpos64_t *pos) 316 { 317 int ret; FSETPOS(fsetpos64); return ret; 318 } 319 #endif 320 272 321 #if defined HAVE___FSETPOS64 273 322 int NEW(__fsetpos64)(FILE *stream, const fpos64_t *pos) 274 323 { 275 int ret, fd; 276 277 LOADSYM(__fsetpos64); 278 fd = fileno(stream); 279 if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) 280 return ORIG(__fsetpos64)(stream, pos); 281 _zz_lock(fd); 282 ret = ORIG(__fsetpos64)(stream, pos); 283 _zz_unlock(fd); 284 debug("%s([%i], %lli) = %i", __func__, 285 fd, (long long int)*pos, ret); 286 /* On HP-UX at least, fpos64_t == int64_t */ 287 _zz_setpos(fd, (int64_t)*pos); 288 289 return ret; 324 int ret; FSETPOS(__fsetpos64); return ret; 290 325 } 291 326 #endif
Note: See TracChangeset
for help on using the changeset viewer.