ReactOS 0.4.16-dev-91-g764881a
UConnect.c
Go to the documentation of this file.
1#include "syshdrs.h"
2
3#if !defined(NO_UNIX_DOMAIN_SOCKETS) && !defined(NO_SIGNALS)
4
5extern volatile Sjmp_buf gNetTimeoutJmp;
6extern volatile Sjmp_buf gPipeJmp;
7
8int
9UConnect(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);
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
#define EINTR
Definition: acclib.h:80
#define ETIMEDOUT
Definition: errno.h:121
GLenum const GLvoid * addr
Definition: glext.h:9621
GLuint64EXT * result
Definition: glext.h:11304
void SIOHandler(int)
#define SSetjmp(a)
Definition: sio.h:39
volatile sio_sigproc_t vsio_sigproc_t
Definition: sio.h:124
void(*)(int) SSignal(int signum, void(*handler)(int))
Definition: sio.h:237
#define Sjmp_buf
Definition: sio.h:41
#define kTimeoutErr
Definition: sio.h:58
void(* sio_sigproc_t)(int)
Definition: sio.h:123
#define errno
Definition: errno.h:18
int UConnect(int, const struct sockaddr_un *const, int, int)