* Added __srefill() skeleton, for BSD libc.
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ AC_PROG_CPP
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
AC_CHECK_HEADERS(inttypes.h stdint.h getopt.h)
|
||||
AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 fseeko _IO_getc getline getdelim __getdelim fgetln)
|
||||
AC_CHECK_FUNCS(open64 lseek64 mmap64 fopen64 fseeko _IO_getc getline getdelim __getdelim fgetln __srefill)
|
||||
AC_CHECK_TYPES(sighandler_t, [], [],
|
||||
[#define _GNU_SOURCE
|
||||
#include <signal.h>])
|
||||
|
||||
+25
-1
@@ -70,8 +70,12 @@ static ssize_t (*__getdelim_orig) (char **lineptr, size_t *n, int delim,
|
||||
|
||||
/* Additional BSDisms */
|
||||
#ifdef HAVE_FGETLN
|
||||
static char * (*fgetln_orig) (FILE *stream, size_t *len);
|
||||
static char * (*fgetln_orig) (FILE *stream, size_t *len);
|
||||
#endif
|
||||
#ifdef HAVE___SREFILL
|
||||
int * (*__srefill_orig) (FILE *fp);
|
||||
#endif
|
||||
|
||||
|
||||
void _zz_load_stream(void)
|
||||
{
|
||||
@@ -105,6 +109,9 @@ void _zz_load_stream(void)
|
||||
#ifdef HAVE_FGETLN
|
||||
LOADSYM(fgetln);
|
||||
#endif
|
||||
#ifdef HAVE___SREFILL
|
||||
LOADSYM(__srefill);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Our function wrappers */
|
||||
@@ -493,3 +500,20 @@ char *fgetln(FILE *stream, size_t *len)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE___SREFILL
|
||||
int __srefill(FILE *fp)
|
||||
{
|
||||
int ret, fd;
|
||||
|
||||
if(!_zz_ready)
|
||||
LOADSYM(__srefill);
|
||||
fd = fileno(stream);
|
||||
ret = __srefill_orig(stream);
|
||||
if(!_zz_ready || !_zz_iswatched(fd))
|
||||
return ret;
|
||||
|
||||
debug("__srefill([%i]) = %i", fd, ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user