diff options
| author | Richard Nyberg <rnyberg@murmeldjur.se> | 2006-02-05 11:34:18 +0000 |
|---|---|---|
| committer | Richard Nyberg <rnyberg@murmeldjur.se> | 2006-02-05 11:34:18 +0000 |
| commit | 38418fcd2bb0d6ae159fecbb527bfa02ea9c9c3e (patch) | |
| tree | 0deadf5fac6fca207d04826a68b97bd4277ca369 /misc/subr.h | |
| parent | 65f3eb2185e3cb9ed91f3c76d68673fc0b8d4d4c (diff) | |
| download | btpd-38418fcd2bb0d6ae159fecbb527bfa02ea9c9c3e.tar.gz btpd-38418fcd2bb0d6ae159fecbb527bfa02ea9c9c3e.zip | |
Add functions read_fully and write_fully. They are simpler alternatives to
read and write on blocking sockets.
Diffstat (limited to 'misc/subr.h')
| -rw-r--r-- | misc/subr.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/misc/subr.h b/misc/subr.h index 8ad42c2..0a6223a 100644 --- a/misc/subr.h +++ b/misc/subr.h @@ -24,4 +24,7 @@ int canon_path(const char *path, char **res); long rand_between(long min, long max); +int read_fully(int fd, void *buf, size_t len); +int write_fully(int fd, const void *buf, size_t len); + #endif |