diff options
author | Ton Voon <ton.voon@opsera.com> | 2010-06-17 10:16:43 +0100 |
---|---|---|
committer | tonvoon <ton.voon@opsera.com> | 2010-06-23 13:30:34 +0000 |
commit | 18f6835edaf7d640a2c9e476cb1babdbdadbfd9b (patch) | |
tree | ae11f40e48dc34658445c99012726f32bfb45c56 /gl/unistd.in.h | |
parent | f61412478ceb7c821793c8356b936f64066508bf (diff) | |
download | monitoring-plugins-18f6835edaf7d640a2c9e476cb1babdbdadbfd9b.tar.gz |
Added state retention APIs. Implemented for check_snmp with --rate option.
See http://nagiosplugin.org/c-api-private for more details on the API.
Also updated check_snmp -l option to change the perfdata label.
Diffstat (limited to 'gl/unistd.in.h')
-rw-r--r-- | gl/unistd.in.h | 56 |
1 files changed, 52 insertions, 4 deletions
diff --git a/gl/unistd.in.h b/gl/unistd.in.h index 45fc5dcf..7914f228 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 |