From b5c13463743d5c2e4dead1934b4abe74eceac104 Mon Sep 17 00:00:00 2001 From: Geoffrey Thomas Date: Sun, 23 Aug 2015 22:15:07 -0400 Subject: Add support for sendmsg(2), recvmsg(2), and cmsg(3) The best specification for control message layout appears to be [RFC 2292, section 4](https://tools.ietf.org/html/rfc2292#section-4), despite this not being a wire protocol. These definitions have also been checked against glibc 2.19 and Linux 4.0 , and tested on Debian 8.1 and FreeBSD 10.2 x86_64. The API differs a bit from the cmsg(3) API for type-safety reasons (and also because the cmsg(3) API is terrible). See test/sys/test_socket.rs for an example. Only supports SCM_RIGHTS at the moment. Fixes #88. --- nix-test/src/const.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nix-test/src/const.c') diff --git a/nix-test/src/const.c b/nix-test/src/const.c index a0a6a116..60447629 100644 --- a/nix-test/src/const.c +++ b/nix-test/src/const.c @@ -289,6 +289,9 @@ get_int_const(const char* err) { GET_CONST(MSG_OOB); GET_CONST(MSG_PEEK); GET_CONST(MSG_DONTWAIT); + GET_CONST(MSG_EOR); + GET_CONST(MSG_TRUNC); + GET_CONST(MSG_CTRUNC); GET_CONST(SHUT_RD); GET_CONST(SHUT_WR); GET_CONST(SHUT_RDWR); @@ -312,6 +315,7 @@ get_int_const(const char* err) { // GET_CONST(SO_PEEK_OFF); GET_CONST(SO_PEERCRED); GET_CONST(SO_SNDBUFFORCE); + GET_CONST(MSG_ERRQUEUE); #endif return -1; -- cgit v1.2.3