Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F42726260
lowat-dgram.c
glebius (Gleb Smirnoff)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
glebius
Jun 2 2022, 6:42 PM
2022-06-02 18:42:22 (UTC+0)
Size
649 B
Referenced Files
None
Subscribers
None
lowat-dgram.c
View Options
#include
<sys/types.h>
#include
<sys/select.h>
#include
<sys/socket.h>
#include
<stdio.h>
#include
<err.h>
static
int
fd
[
2
];
void
test
(
void
)
{
char
buf
[
50
];
fd_set
rfds
;
if
(
send
(
fd
[
0
],
buf
,
50
,
0
)
!=
50
)
err
(
1
,
"send"
);
FD_ZERO
(
&
rfds
);
FD_SET
(
fd
[
1
],
&
rfds
);
if
(
select
(
fd
[
1
]
+
1
,
&
rfds
,
NULL
,
NULL
,
NULL
)
!=
1
)
err
(
1
,
"select"
);
if
(
recv
(
fd
[
1
],
buf
,
50
,
0
)
!=
50
)
err
(
1
,
"receive"
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
v
;
if
(
socketpair
(
PF_UNIX
,
SOCK_DGRAM
,
0
,
fd
)
!=
0
)
err
(
1
,
"socketpair"
);
test
();
v
=
100
;
if
(
setsockopt
(
fd
[
1
],
SOL_SOCKET
,
SO_RCVLOWAT
,
&
v
,
sizeof
(
v
))
!=
0
)
err
(
1
,
"setsockopt"
);
test
();
}
File Metadata
Details
Attached
Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4812360
Default Alt Text
lowat-dgram.c (649 B)
Attached To
Mode
D35389: sockets: limit use of watermarks to SOCK_STREAM sockets
Attached
Detach File
Event Timeline
Log In to Comment