diff options
author | cy <cy@FreeBSD.org> | 2018-04-18 19:18:14 +0000 |
---|---|---|
committer | cy <cy@FreeBSD.org> | 2018-04-18 19:18:14 +0000 |
commit | c00d3b23449ed11f61948fdd529022f1621a9891 (patch) | |
tree | 06f99f04e6a84dc3960c21739f8282b907a9fcca /include | |
parent | c4642292bc00ef62b477d6f9395cfcc717abb691 (diff) | |
download | FreeBSD-src-c00d3b23449ed11f61948fdd529022f1621a9891.zip FreeBSD-src-c00d3b23449ed11f61948fdd529022f1621a9891.tar.gz |
MFC r331936, r331942, r331943, r331945, r331947, r331948
Add new gets_s(3) stdio function.
This implements the gets_s(3) function as documented at
http://en.cppreference.com/w/c/io/gets. It facilitates the
optional removal of gets(3).
Reviewed by: ed
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D12785
Diffstat (limited to 'include')
-rw-r--r-- | include/stdio.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/stdio.h b/include/stdio.h index 1ff9aca..13329c4 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -49,6 +49,11 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif +#ifndef _RSIZE_T_DEFINED +#define _RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + #if __POSIX_VISIBLE >= 200809 #ifndef _OFF_T_DECLARED #define _OFF_T_DECLARED @@ -263,6 +268,9 @@ size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict); int getc(FILE *); int getchar(void); char *gets(char *); +#if __EXT1_VISIBLE +char *gets_s(char *, rsize_t); +#endif void perror(const char *); int printf(const char * __restrict, ...); int putc(int, FILE *); |