utils: Provide a fmemopen(3) fallback using BSD funopen()

This commit is contained in:
Martin Willi
2013-10-24 13:17:05 +02:00
parent 9043cb2f9c
commit 2077d996a9
3 changed files with 62 additions and 0 deletions
+15
View File
@@ -765,6 +765,21 @@ bool cas_ptr(void **ptr, void *oldval, void *newval);
#endif /* HAVE_GCC_ATOMIC_OPERATIONS */
#ifndef HAVE_FMEMOPEN
# ifdef HAVE_FUNOPEN
# define HAVE_FMEMOPEN fallback
/**
* fmemopen(3) fallback using BSD funopen.
*
* We could also provide one using fopencookie(), but should we have it we
* most likely have fmemopen().
*
* fseek() is currently not supported.
*/
FILE *fmemopen(void *buf, size_t size, const char *mode);
# endif /* FUNOPEN */
#endif /* FMEMOPEN */
/**
* printf hook for time_t.
*