aboutsummaryrefslogtreecommitdiffstats
path: root/recvfd.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-08-29 16:51:41 +0200
committerMattias Andrée <maandree@kth.se>2018-08-29 16:52:38 +0200
commit7f397be7159a28d459d8f4ba6b934ab86458d633 (patch)
tree87be67fa6baf8e5b6d548084b80bf038c9a91912 /recvfd.c
parentAdd tests for strtotimespec and strtotimeval (diff)
downloadlibsimple-7f397be7159a28d459d8f4ba6b934ab86458d633.tar.gz
libsimple-7f397be7159a28d459d8f4ba6b934ab86458d633.tar.bz2
libsimple-7f397be7159a28d459d8f4ba6b934ab86458d633.tar.xz
Remove sendfd, recvfd, recvfrom_timestamped, and recv_timestamped for now
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--recvfd.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/recvfd.c b/recvfd.c
deleted file mode 100644
index cd8ecb6..0000000
--- a/recvfd.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include "libsimple.h"
-#ifndef TEST
-
-
-int
-libsimple_recvfd(int sock) /* TODO test */
-{
- int fd;
- char buf[1];
- struct iovec iov;
- struct msghdr msg;
- struct cmsghdr *cmsg;
- char cms[CMSG_SPACE(sizeof(fd))];
-
- iov.iov_base = buf;
- iov.iov_len = 1;
-
- memset(&msg, 0, sizeof(msg));
- msg.msg_name = NULL;
- msg.msg_namelen = 0;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
-
- msg.msg_control = (caddr_t)cms;
- msg.msg_controllen = sizeof(cms);
-
- switch (recvmsg(sock, &msg, 0)) {
- case -1:
- return -1;
- case 0:
- errno = ECONNRESET;
- return -1;
- default:
- break;
- }
-
- cmsg = CMSG_FIRSTHDR(&msg);
- memcpy(&fd, CMSG_DATA(cmsg), sizeof(fd));
- return fd;
-}
-
-
-#else
-#include "test.h"
-
-int
-main(void)
-{
- return 0;
-}
-
-#endif