From 3d08ac923727fcd91dc7ee07fbadf09de4abeb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 10 Aug 2010 09:56:13 +0000 Subject: [PATCH] Add the fmemopen() and open_memstream() POSIX extensions to libroot. Those can be used to build FILE pointers to in-memory buffers, a possible use would be to make resources available to ported applications. Untested. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37997 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/posix/stdio.h | 4 ++++ src/system/libroot/posix/glibc/libio/Jamfile | 3 +++ 2 files changed, 7 insertions(+) diff --git a/headers/posix/stdio.h b/headers/posix/stdio.h index 5a695e1b07..b1853fe590 100644 --- a/headers/posix/stdio.h +++ b/headers/posix/stdio.h @@ -95,6 +95,10 @@ extern FILE *popen(const char *command, const char *mode); extern int pclose(FILE *stream); extern void perror(const char *errorPrefix); +/* memory streams */ +extern FILE *fmemopen(void *buf, size_t size, const char *mode); +extern FILE *open_memstream(void **buf, size_t *size); + /* file I/O */ extern int fflush(FILE *stream); extern int fflush_unlocked(FILE *stream); diff --git a/src/system/libroot/posix/glibc/libio/Jamfile b/src/system/libroot/posix/glibc/libio/Jamfile index 1c430f74ff..2e10d5ae7d 100644 --- a/src/system/libroot/posix/glibc/libio/Jamfile +++ b/src/system/libroot/posix/glibc/libio/Jamfile @@ -30,6 +30,7 @@ MergeObject posix_gnu_libio.o : filedoalloc.c fileops.c flockfile.c + fmemopen.c fputc.c fputc_u.c freopen.c @@ -49,6 +50,7 @@ MergeObject posix_gnu_libio.o : iofgets.c iofgets_u.c iofopen.c + iofopncook.c iofputs.c iofputs_u.c iofread.c @@ -72,6 +74,7 @@ MergeObject posix_gnu_libio.o : iovdprintf.c iovsprintf.c iovsscanf.c + memstream.c # obprintf.c pclose.c peekc.c