summaryrefslogtreecommitdiff
path: root/socket_tcp.c
diff options
context:
space:
mode:
authorDmitry Bogatov <KAction@debian.org>2018-11-29 05:18:28 +0000
committerDmitry Bogatov <KAction@debian.org>2018-11-29 05:18:28 +0000
commitb19ff825af9758fa905bf0ba29bbff66fa66cd50 (patch)
tree4a6fc0b53bb646a038a422b7ef90d65968fde149 /socket_tcp.c
parent35c0ccd3b0eedd2d14e26a109f5812a5c30c38aa (diff)
Import Upstream version 0.88
Diffstat (limited to 'socket_tcp.c')
-rw-r--r--socket_tcp.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/socket_tcp.c b/socket_tcp.c
new file mode 100644
index 0000000..aada07d
--- /dev/null
+++ b/socket_tcp.c
@@ -0,0 +1,16 @@
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include "ndelay.h"
+#include "socket.h"
+
+int socket_tcp(void)
+{
+ int s;
+
+ s = socket(AF_INET,SOCK_STREAM,0);
+ if (s == -1) return -1;
+ if (ndelay_on(s) == -1) { close(s); return -1; }
+ return s;
+}