summaryrefslogtreecommitdiffstats
path: root/gl/unistd.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/unistd.in.h')
-rw-r--r--gl/unistd.in.h56
1 files changed, 52 insertions, 4 deletions
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 45fc5dc..7914f22 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -86,7 +86,7 @@
86#endif 86#endif
87 87
88#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \ 88#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
89 || @GNULIB_PREAD@ || defined GNULIB_POSIXCHECK) 89 || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
90/* Get ssize_t. */ 90/* Get ssize_t. */
91# include <sys/types.h> 91# include <sys/types.h>
92#endif 92#endif
@@ -1016,6 +1016,40 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
1016#endif 1016#endif
1017 1017
1018 1018
1019#if @GNULIB_PWRITE@
1020/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
1021 Return the number of bytes written if successful, otherwise
1022 set errno and return -1. 0 indicates nothing written. See the
1023 POSIX:2001 specification
1024 <http://www.opengroup.org/susv3xsh/pwrite.html>. */
1025# if @REPLACE_PWRITE@
1026# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1027# define pwrite rpl_pwrite
1028# endif
1029_GL_FUNCDECL_RPL (pwrite, ssize_t,
1030 (int fd, const void *buf, size_t bufsize, off_t offset)
1031 _GL_ARG_NONNULL ((2)));
1032_GL_CXXALIAS_RPL (pwrite, ssize_t,
1033 (int fd, const void *buf, size_t bufsize, off_t offset));
1034# else
1035# if !@HAVE_PWRITE@
1036_GL_FUNCDECL_SYS (pwrite, ssize_t,
1037 (int fd, const void *buf, size_t bufsize, off_t offset)
1038 _GL_ARG_NONNULL ((2)));
1039# endif
1040_GL_CXXALIAS_SYS (pwrite, ssize_t,
1041 (int fd, const void *buf, size_t bufsize, off_t offset));
1042# endif
1043_GL_CXXALIASWARN (pwrite);
1044#elif defined GNULIB_POSIXCHECK
1045# undef pwrite
1046# if HAVE_RAW_DECL_PWRITE
1047_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
1048 "use gnulib module pwrite for portability");
1049# endif
1050#endif
1051
1052
1019#if @GNULIB_READLINK@ 1053#if @GNULIB_READLINK@
1020/* Read the contents of the symbolic link FILE and place the first BUFSIZE 1054/* Read the contents of the symbolic link FILE and place the first BUFSIZE
1021 bytes of it into BUF. Return the number of bytes placed into BUF if 1055 bytes of it into BUF. Return the number of bytes placed into BUF if
@@ -1164,12 +1198,23 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
1164#if @GNULIB_TTYNAME_R@ 1198#if @GNULIB_TTYNAME_R@
1165/* Store at most BUFLEN characters of the pathname of the terminal FD is 1199/* Store at most BUFLEN characters of the pathname of the terminal FD is
1166 open on in BUF. Return 0 on success, otherwise an error number. */ 1200 open on in BUF. Return 0 on success, otherwise an error number. */
1167# if !@HAVE_TTYNAME_R@ 1201# if @REPLACE_TTYNAME_R@
1202# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1203# undef ttyname_r
1204# define ttyname_r rpl_ttyname_r
1205# endif
1206_GL_FUNCDECL_RPL (ttyname_r, int,
1207 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
1208_GL_CXXALIAS_RPL (ttyname_r, int,
1209 (int fd, char *buf, size_t buflen));
1210# else
1211# if !@HAVE_TTYNAME_R@
1168_GL_FUNCDECL_SYS (ttyname_r, int, 1212_GL_FUNCDECL_SYS (ttyname_r, int,
1169 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); 1213 (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
1170# endif 1214# endif
1171_GL_CXXALIAS_SYS (ttyname_r, int, 1215_GL_CXXALIAS_SYS (ttyname_r, int,
1172 (int fd, char *buf, size_t buflen)); 1216 (int fd, char *buf, size_t buflen));
1217# endif
1173_GL_CXXALIASWARN (ttyname_r); 1218_GL_CXXALIASWARN (ttyname_r);
1174#elif defined GNULIB_POSIXCHECK 1219#elif defined GNULIB_POSIXCHECK
1175# undef ttyname_r 1220# undef ttyname_r
@@ -1268,7 +1313,10 @@ _GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
1268 _GL_ARG_NONNULL ((2))); 1313 _GL_ARG_NONNULL ((2)));
1269_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); 1314_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
1270# else 1315# else
1271_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); 1316/* Need to cast, because on mingw, the third parameter is
1317 unsigned int count
1318 and the return type is 'int'. */
1319_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
1272# endif 1320# endif
1273_GL_CXXALIASWARN (write); 1321_GL_CXXALIASWARN (write);
1274#endif 1322#endif