forked from petershh/minix
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlisten.2
More file actions
36 lines (35 loc) · 833 Bytes
/
Copy pathlisten.2
File metadata and controls
36 lines (35 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.TH LISTEN 2
.SH NAME
listen \- listens for incoming connections on a socket
.SH SYNOPSIS
.ft B
#include <sys/socket.h>
.in +5
.ti -5
int listen(int \fIsd\fP, int \fIbacklog\fP);
.br
.ft P
.SH DESCRIPTION
listen() puts socket \fIsd\fP into the listening state.
\fIbacklog\fP number of incoming connections may be
queued before new incoming connections are refused.
This function is usually called after bind(2) and before
accept(2).
.SH RETURN VALUES
On success, this function returns 0. On error, -1 is returned and
\fIerrno\fP is set.
.SH ERRORS
.TP 15
[EINVAL]
The socket is invalid or bind(2) has not been called yet
for the socket.
.TP 15
[EOPNOTSUPP]
The socket type (example SOCK_DGRAM) does not support listening.
.TP 15
[ENOSYS]
The socket does not support listening.
.SH SEE ALSO
.BR accept(2),
.BR bind(2),
.BR socket(2)