diff options
author | Simo Sorce <simo@redhat.com> | 2014-01-03 16:45:35 -0500 |
---|---|---|
committer | Günther Deschner <gdeschner@redhat.com> | 2014-01-15 17:55:19 +0100 |
commit | 58a39677c961c72b052eae0b9d94b992254d6e10 (patch) | |
tree | 2dc2dc5824a1efb20eebe0eb9fcd866b4caaab4a /proxy/src/gp_common.h | |
parent | ad766e34ade64ba1d9f4fdefb32849d2b330e854 (diff) | |
download | gss-proxy-58a39677c961c72b052eae0b9d94b992254d6e10.tar.gz gss-proxy-58a39677c961c72b052eae0b9d94b992254d6e10.tar.xz gss-proxy-58a39677c961c72b052eae0b9d94b992254d6e10.zip |
Add utility functions to read()/write() safely
Automatically handle short reads due to singals interrupting the process.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Günther Deschner <gdeschner@redhat.com>
Diffstat (limited to 'proxy/src/gp_common.h')
-rw-r--r-- | proxy/src/gp_common.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/proxy/src/gp_common.h b/proxy/src/gp_common.h index f2b8c3e..3a1b7be 100644 --- a/proxy/src/gp_common.h +++ b/proxy/src/gp_common.h @@ -69,6 +69,8 @@ bool gp_same(const char *a, const char *b); bool gp_boolean_is_true(const char *s); char *gp_getenv(const char *name); +ssize_t gp_safe_read(int fd, void *buf, size_t count); +ssize_t gp_safe_write(int fd, const void *buf, size_t count); /* NOTE: read the note in gp_util.c before using gp_strerror() */ char *gp_strerror(int errnum); |