aboutsummaryrefslogtreecommitdiff
path: root/include/stdio.h
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2020-01-30 03:31:16 +0000
committerKyle Evans <kevans@FreeBSD.org>2020-01-30 03:31:16 +0000
commit12fe218f0bf6043be71f42529868da47ed094c02 (patch)
tree61c19935edab8bdf6e32eb7060ad0ed1573d6f77 /include/stdio.h
parentf2c462994d27a13044607f330c5f54133fb5863c (diff)
downloadsrc-12fe218f0bf6043be71f42529868da47ed094c02.tar.gz
src-12fe218f0bf6043be71f42529868da47ed094c02.zip
stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwrite
fflush_unlocked is currently desired in ports by sysutils/metalog, and redefined as the locked fflush. fputc_unlocked, fputs_unlocked, fread_unlocked, and fwrite_unlocked are currently desired in ports by devel/elfutils, and redefined as the locked fputs, fread, and fwrite respectively. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D23336
Notes
Notes: svn path=/head/; revision=357284
Diffstat (limited to 'include/stdio.h')
-rw-r--r--include/stdio.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 97e8144372f6..279160912ba9 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -346,7 +346,12 @@ int putchar_unlocked(int);
void clearerr_unlocked(FILE *);
int feof_unlocked(FILE *);
int ferror_unlocked(FILE *);
+int fflush_unlocked(FILE *);
int fileno_unlocked(FILE *);
+int fputs_unlocked(const char * __restrict, FILE * __restrict);
+size_t fread_unlocked(void * __restrict, size_t, size_t, FILE * __restrict);
+size_t fwrite_unlocked(const void * __restrict, size_t, size_t,
+ FILE * __restrict);
#endif
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500
@@ -507,10 +512,11 @@ extern int __isthreaded;
* See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12
* B.8.2.7 for the rationale behind the *_unlocked() macros.
*/
+#define clearerr_unlocked(p) __sclearerr(p)
#define feof_unlocked(p) __sfeof(p)
#define ferror_unlocked(p) __sferror(p)
-#define clearerr_unlocked(p) __sclearerr(p)
#define fileno_unlocked(p) __sfileno(p)
+#define fputc_unlocked(s, p) __sputc(s, p)
#endif
#if __POSIX_VISIBLE >= 199506
#define getc_unlocked(fp) __sgetc(fp)