aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-12 10:42:29 +0200
committerMattias Andrée <maandree@kth.se>2016-07-12 10:42:52 +0200
commitd7cf13b968b99cb070c7d5d2e1f7ff1a8072f2f3 (patch)
tree89b172602b2d5dd2ebeb7450a5247614b9d04d00 /src/util.h
parentImplement state merging (diff)
downloadcoopgammad-d7cf13b968b99cb070c7d5d2e1f7ff1a8072f2f3.tar.gz
coopgammad-d7cf13b968b99cb070c7d5d2e1f7ff1a8072f2f3.tar.bz2
coopgammad-d7cf13b968b99cb070c7d5d2e1f7ff1a8072f2f3.tar.xz
Implement re-exec
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/util.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 858d972..18066fa 100644
--- a/src/util.h
+++ b/src/util.h
@@ -33,6 +33,8 @@ void* memdup(const void* src, size_t n);
/**
* Read an entire file
*
+ * Not cancelled by `EINTR`
+ *
* @param fd The file descriptor
* @param n Output for the size of the file
* @return The read content, plus a NUL byte at
@@ -42,6 +44,20 @@ void* nread(int fd, size_t* n);
/**
+ * Write an entire buffer to a file
+ *
+ * Not cancelled by `EINTR`
+ *
+ * @param fd The file descriptor
+ * @param buf The buffer which shall be written to the fail
+ * @param n The size of the buffer
+ * @return The number of written bytes, less than `n`
+ * on error, cannot exceed `n`
+ */
+size_t nwrite(int fd, const void* buf, size_t n);
+
+
+/**
* Duplicate a file descriptor an make sure
* the new file descriptor's index as a
* specified minimum value