ReactOS
0.4.16-dev-981-g80eb313
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
SAcceptS.c
Go to the documentation of this file.
1
#include "
syshdrs.h
"
2
3
int
4
SAcceptS
(
int
sfd,
struct
sockaddr_in
*
const
addr
,
int
tlen)
5
{
6
int
result
;
7
fd_set
ss
;
8
struct
timeval
tv;
9
size_t
size
;
10
11
if
(tlen <= 0) {
12
errno
= 0;
13
for
(;;) {
14
size
=
sizeof
(
struct
sockaddr_in
);
15
result
=
accept
(sfd, (
struct
sockaddr
*)
addr
, (
int
*) &
size
);
16
if
((
result
>= 0) || (
errno
!=
EINTR
))
17
return
(
result
);
18
}
19
}
20
21
forever
{
22
errno
= 0;
23
FD_ZERO
(&
ss
);
24
FD_SET
(sfd, &
ss
);
25
tv.
tv_sec
= tlen;
26
tv.
tv_usec
= 0;
27
result
=
select
(sfd + 1,
SELECT_TYPE_ARG234
&
ss
,
NULL
,
NULL
,
SELECT_TYPE_ARG5
&tv);
28
if
(
result
== 1) {
29
/* ready */
30
break
;
31
}
else
if
(
result
== 0) {
32
/* timeout */
33
errno
=
ETIMEDOUT
;
34
SETWSATIMEOUTERR
35
return
(
kTimeoutErr
);
36
}
else
if
(
errno
!=
EINTR
) {
37
return
(-1);
38
}
39
}
40
41
do
{
42
size
=
sizeof
(
struct
sockaddr_in
);
43
result
=
accept
(sfd, (
struct
sockaddr
*)
addr
, (
int
*) &
size
);
44
}
while
((
result
< 0) && (
errno
==
EINTR
));
45
46
return
(
result
);
47
}
/* SAcceptS */
SAcceptS
int SAcceptS(int sfd, struct sockaddr_in *const addr, int tlen)
Definition:
SAcceptS.c:4
EINTR
#define EINTR
Definition:
acclib.h:80
NULL
#define NULL
Definition:
types.h:112
select
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
Definition:
select.c:41
ETIMEDOUT
#define ETIMEDOUT
Definition:
errno.h:121
size
GLsizeiptr size
Definition:
glext.h:5919
addr
GLenum const GLvoid * addr
Definition:
glext.h:9621
result
GLuint64EXT * result
Definition:
glext.h:11304
ss
#define ss
Definition:
i386-dis.c:441
SELECT_TYPE_ARG234
#define SELECT_TYPE_ARG234
Definition:
wincfg.h:4
SELECT_TYPE_ARG5
#define SELECT_TYPE_ARG5
Definition:
wincfg.h:7
SETWSATIMEOUTERR
#define SETWSATIMEOUTERR
Definition:
sio.h:120
kTimeoutErr
#define kTimeoutErr
Definition:
sio.h:58
forever
#define forever
Definition:
ncftp.h:73
errno
#define errno
Definition:
errno.h:18
syshdrs.h
accept
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
Definition:
socklife.c:23
fd_set
Definition:
winsock.h:66
sockaddr_in
Definition:
winsock.h:509
sockaddr
Definition:
tcpcore.h:1189
timeval
Definition:
linux.h:1737
timeval::tv_sec
unsigned long tv_sec
Definition:
linux.h:1738
timeval::tv_usec
unsigned long tv_usec
Definition:
linux.h:1739
FD_ZERO
#define FD_ZERO(set)
Definition:
winsock.h:96
FD_SET
#define FD_SET(fd, set)
Definition:
winsock.h:89
modules
rosapps
applications
net
ncftp
sio
SAcceptS.c
Generated on Wed Apr 16 2025 06:06:35 for ReactOS by
1.9.6