diff options
author | djm <djm> | 2006-04-23 02:06:20 +0000 |
---|---|---|
committer | djm <djm> | 2006-04-23 02:06:20 +0000 |
commit | 8ec1ff987be1e0b0991e6529549977f000bd6eb6 (patch) | |
tree | cbbd0d0ed579468030a6e5456655d2b5b7df9923 /atomicio.h | |
parent | 77599c1e373f8f16622cf64c61eeecfdd0fd8bd3 (diff) | |
download | openssh-8ec1ff987be1e0b0991e6529549977f000bd6eb6.tar.gz |
- djm@cvs.openbsd.org 2006/04/16 00:52:55
[atomicio.c atomicio.h]
introduce atomiciov() function that wraps readv/writev to retry
interrupted transfers like atomicio() does for read/write;
feedback deraadt@ dtucker@ stevesk@ ok deraadt@
Diffstat (limited to 'atomicio.h')
-rw-r--r-- | atomicio.h | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -1,6 +1,7 @@ -/* $OpenBSD: atomicio.h,v 1.7 2006/03/25 22:22:42 djm Exp $ */ +/* $OpenBSD: atomicio.h,v 1.8 2006/04/16 00:52:55 djm Exp $ */ /* + * Copyright (c) 2006 Damien Miller. All rights reserved. * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. * All rights reserved. * @@ -25,9 +26,24 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _ATOMICIO_H +#define _ATOMICIO_H + +#include <sys/types.h> +#include <unistd.h> +#include <sys/uio.h> + /* * Ensure all of data on socket comes through. f==read || f==vwrite */ size_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t); #define vwrite (ssize_t (*)(int, void *, size_t))write + +/* + * ensure all of data on socket comes through. f==readv || f==writev + */ +size_t atomiciov(ssize_t (*)(int, const struct iovec *, int), + int, const struct iovec *, int); + +#endif /* _ATOMICIO_H */ |