From 0b7e004a5c992e3bcfe9b4fd3ede53366b42a436 Mon Sep 17 00:00:00 2001 From: fgsch <> Date: Wed, 21 Mar 2012 23:44:35 +0000 Subject: [PATCH] Implement getdelim(3) and getline(3). Prompted in a mail to tech@ by Jan Klemkow (j-dot-klemkow-at-wemelug-dot-de) but this is based on NetBSD's implementation instead with some tweaks by me. Further improvements would happen in tree. ok millert@; discussed with many others ports cleanup by naddy@, sthen@. Antti Harri, Gonzalo L. R. and myself. --- src/include/stdio.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/include/stdio.h b/src/include/stdio.h index c0689455..a885ff1e 100644 --- a/src/include/stdio.h +++ b/src/include/stdio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdio.h,v 1.41 2011/07/18 17:29:49 matthew Exp $ */ +/* $OpenBSD: stdio.h,v 1.42 2012/03/21 23:44:35 fgsch Exp $ */ /* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ /*- @@ -237,6 +237,12 @@ size_t fwrite(const void *, size_t, size_t, FILE *) __attribute__((__bounded__ (__size__,1,3,2))); int getc(FILE *); int getchar(void); +#if __POSIX_VISIBLE >= 200809 +ssize_t getdelim(char ** __restrict, size_t * __restrict, int, + FILE * __restrict); +ssize_t getline(char ** __restrict, size_t * __restrict, + FILE * __restrict); +#endif char *gets(char *); #if __BSD_VISIBLE && !defined(__SYS_ERRLIST) #define __SYS_ERRLIST