Changeset 1598 for zzuf


Ignore:
Timestamp:
Jan 7, 2007, 2:16:43 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Added srefill() skeleton, for BSD libc.
Location:
zzuf/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/configure.ac

    r1595 r1598  
    1616
    1717AC_CHECK_HEADERS(inttypes.h stdint.h getopt.h)
    18 AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 fseeko _IO_getc getline getdelim __getdelim fgetln)
     18AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 fseeko _IO_getc getline getdelim __getdelim fgetln __srefill)
    1919AC_CHECK_TYPES(sighandler_t, [], [],
    2020  [#define _GNU_SOURCE
  • zzuf/trunk/src/load-stream.c

    r1595 r1598  
    7171/* Additional BSDisms */
    7272#ifdef HAVE_FGETLN
    73 static char *  (*fgetln_orig) (FILE *stream, size_t *len);
    74 #endif
     73static char *  (*fgetln_orig)    (FILE *stream, size_t *len);
     74#endif
     75#ifdef HAVE___SREFILL
     76int         *  (*__srefill_orig) (FILE *fp);
     77#endif
     78
    7579
    7680void _zz_load_stream(void)
     
    105109#ifdef HAVE_FGETLN
    106110    LOADSYM(fgetln);
     111#endif
     112#ifdef HAVE___SREFILL
     113    LOADSYM(__srefill);
    107114#endif
    108115}
     
    494501#endif
    495502
     503#ifdef HAVE___SREFILL
     504int __srefill(FILE *fp)
     505{
     506    int ret, fd;
     507
     508    if(!_zz_ready)
     509        LOADSYM(__srefill);
     510    fd = fileno(stream);
     511    ret = __srefill_orig(stream);
     512    if(!_zz_ready || !_zz_iswatched(fd))
     513        return ret;
     514
     515    debug("__srefill([%i]) = %i", fd, ret);
     516    return ret;
     517}
     518#endif
     519
Note: See TracChangeset for help on using the changeset viewer.