ReactOS  0.4.14-dev-337-gf981a68
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 
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 
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
volatile sio_sigproc_t vsio_sigproc_t
Definition: sio.h:124
#define EINTR
Definition: acclib.h:80
int errno
INT WSAAPI connect(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
Definition: sockctrl.c:23
#define Sjmp_buf
Definition: sio.h:41
#define kTimeoutErr
Definition: sio.h:58
int UConnect(int, const struct sockaddr_un *const, int, int)
#define SSetjmp(a)
Definition: sio.h:39
GLenum const GLvoid * addr
Definition: glext.h:9621
void(*)(int) SSignal(int signum, void(*handler)(int))
Definition: sio.h:237
#define ETIMEDOUT
Definition: errno.h:121
GLuint64EXT * result
Definition: glext.h:11304
void(* sio_sigproc_t)(int)
Definition: sio.h:123
void SIOHandler(int)