summaryrefslogtreecommitdiff
path: root/src/sysstdio.h
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2022-09-25 16:15:16 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2022-09-25 16:15:16 -0400
commit650c20f1ca4e07591a727e1cfcc74b3363d15985 (patch)
tree85d11f6437cde22f410c25e0e5f71a3131ebd07d /src/sysstdio.h
parent8869332684c2302b5ba1ead4568bbc7ba1c0183e (diff)
parent4b85ae6a24380fb67a3315eaec9233f17a872473 (diff)
downloademacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.gz
emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.tar.bz2
emacs-650c20f1ca4e07591a727e1cfcc74b3363d15985.zip
Merge 'master' into noverlay
Diffstat (limited to 'src/sysstdio.h')
-rw-r--r--src/sysstdio.h54
1 files changed, 13 insertions, 41 deletions
diff --git a/src/sysstdio.h b/src/sysstdio.h
index 87d62afc3d7..efedc3e450b 100644
--- a/src/sysstdio.h
+++ b/src/sysstdio.h
@@ -1,6 +1,6 @@
/* Standard I/O for Emacs.
-Copyright 2013-2017 Free Software Foundation, Inc.
+Copyright 2013-2022 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -20,10 +20,19 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#ifndef EMACS_SYSSTDIO_H
#define EMACS_SYSSTDIO_H
+#include <stdarg.h>
#include <fcntl.h>
+#include <limits.h>
#include <stdio.h>
-extern FILE *emacs_fopen (char const *, char const *);
+#include <attribute.h>
+#include <unlocked-io.h>
+
+extern FILE *emacs_fopen (char const *, char const *)
+ ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC (fclose, 1);
+extern void errputc (int);
+extern void errwrite (void const *, ptrdiff_t);
+extern void close_output_streams (void);
#if O_BINARY
# define FOPEN_BINARY "b"
@@ -33,45 +42,8 @@ extern FILE *emacs_fopen (char const *, char const *);
# define FOPEN_TEXT ""
#endif
-/* These are compatible with unlocked-io.h, if both files are included. */
-#if !HAVE_DECL_CLEARERR_UNLOCKED
-# define clearerr_unlocked(x) clearerr (x)
-#endif
-#if !HAVE_DECL_FEOF_UNLOCKED
-# define feof_unlocked(x) feof (x)
-#endif
-#if !HAVE_DECL_FERROR_UNLOCKED
-# define ferror_unlocked(x) ferror (x)
-#endif
-#if !HAVE_DECL_FFLUSH_UNLOCKED
-# define fflush_unlocked(x) fflush (x)
-#endif
-#if !HAVE_DECL_FGETS_UNLOCKED
-# define fgets_unlocked(x,y,z) fgets (x,y,z)
-#endif
-#if !HAVE_DECL_FPUTC_UNLOCKED
-# define fputc_unlocked(x,y) fputc (x,y)
-#endif
-#if !HAVE_DECL_FPUTS_UNLOCKED
-# define fputs_unlocked(x,y) fputs (x,y)
-#endif
-#if !HAVE_DECL_FREAD_UNLOCKED
-# define fread_unlocked(w,x,y,z) fread (w,x,y,z)
-#endif
-#if !HAVE_DECL_FWRITE_UNLOCKED
-# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
-#endif
-#if !HAVE_DECL_GETC_UNLOCKED
-# define getc_unlocked(x) getc (x)
-#endif
-#if !HAVE_DECL_GETCHAR_UNLOCKED
-# define getchar_unlocked() getchar ()
-#endif
-#if !HAVE_DECL_PUTC_UNLOCKED
-# define putc_unlocked(x,y) putc (x,y)
-#endif
-#if !HAVE_DECL_PUTCHAR_UNLOCKED
-# define putchar_unlocked(x) putchar (x)
+#ifndef PIPE_BUF
+ #define PIPE_BUF MAX_ALLOCA
#endif
#endif /* EMACS_SYSSTDIO_H */