remove empty dir
[reactos.git] / rosapps / net / ncftp / sio / UConnect.c
1 #include "syshdrs.h"
2
3 #if !defined(NO_UNIX_DOMAIN_SOCKETS) && !defined(NO_SIGNALS)
4
5 extern volatile Sjmp_buf gNetTimeoutJmp;
6 extern volatile Sjmp_buf gPipeJmp;
7
8 int
9 UConnect(int sfd, const struct sockaddr_un *const addr, int ualen, int tlen)
10 {
11 int result;
12 vsio_sigproc_t sigalrm;
13
14 if (SSetjmp(gNetTimeoutJmp) != 0) {
15 alarm(0);
16 (void) SSignal(SIGALRM, (sio_sigproc_t) sigalrm);
17 errno = ETIMEDOUT;
18 return (kTimeoutErr);
19 }
20
21 sigalrm = (vsio_sigproc_t) SSignal(SIGALRM, SIOHandler);
22 alarm((unsigned int) tlen);
23
24 errno = 0;
25 do {
26 result = connect(sfd, (struct sockaddr *) addr, ualen);
27 } while ((result < 0) && (errno == EINTR));
28
29 alarm(0);
30 (void) SSignal(SIGALRM, (sio_sigproc_t) sigalrm);
31 return (result);
32 } /* UConnect */
33
34 #endif
35