From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- unix/os/net/connect.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 unix/os/net/connect.c (limited to 'unix/os/net/connect.c') diff --git a/unix/os/net/connect.c b/unix/os/net/connect.c new file mode 100644 index 00000000..aeb2b959 --- /dev/null +++ b/unix/os/net/connect.c @@ -0,0 +1,27 @@ +/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + */ + +#include "types.h" + +extern int errno; +int tcperrno; + +/* TCP_CONNECT -- Initiate a connection on a socket. Returns when the server + * accepts the connection and a full duplex connection has been established. + * Zero is returned if the connection succeeds; -1 is returned if the connection + * fails. The sockaddr argument is necessary because a socket may be used to + * talk to multiple endpoints. + */ +tcp_connect (s, name, namelen) +u_sock s; /* the socket */ +struct sockaddr *name; /* endpoint of communications */ +int namelen; /* sizeof(name) */ +{ + int status; +eprintf("connect\n"); + + /* MACHDEP */ + status = connect (s, name, namelen); + tcperrno = errno; + return (status); +} -- cgit