repo.or.cz
/
valgrind.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Bug 497723 - forgot to restore callgrind output cleanup
[valgrind.git]
/
none
/
tests
/
fcntl_setown.c
blob
b0ccf64e6e55ab31a48c90affb9f4fd75c379aab
1
#include <fcntl.h>
2
#include <stdio.h>
3
#include <stdlib.h>
4
#include <sys/socket.h>
5
#include <unistd.h>
6
7
int
main
(
int
argc
,
char
**
argv
)
8
{
9
int
s
;
10
11
if
((
s
=
socket
(
PF_INET
,
SOCK_STREAM
,
0
)) <
0
)
12
{
13
perror
(
"socket"
);
14
exit
(
1
);
15
}
16
17
if
(
fcntl
(
s
,
F_SETOWN
,
getpid
()) <
0
)
18
{
19
perror
(
"fcntl(F_SETOWN)"
);
20
exit
(
1
);
21
}
22
23
if
(
close
(
s
) <
0
)
24
{
25
perror
(
"close"
);
26
exit
(
1
);
27
}
28
29
exit
(
0
);
30
}