summaryrefslogtreecommitdiff
path: root/atomicio.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-04-23 12:06:20 +1000
committerDamien Miller <djm@mindrot.org>2006-04-23 12:06:20 +1000
commit6aa139c41ff22f9c91a934a73013265ea0a64afc (patch)
tree7df9e369f188628f3331b768752d0e918b7c7c8c /atomicio.h
parent499a0d5ada82acbf8a5c5d496dbf0b4570dde1af (diff)
downloadopenssh-git-6aa139c41ff22f9c91a934a73013265ea0a64afc.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.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/atomicio.h b/atomicio.h
index ddb63ee8..03bf065e 100644
--- a/atomicio.h
+++ b/atomicio.h
@@ -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 */