vgdb: Handle EAGAIN in read_buf
[valgrind.git] / none / tests / fcntl_setown.c
blobb0ccf64e6e55ab31a48c90affb9f4fd75c379aab
1 #include <fcntl.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <sys/socket.h>
5 #include <unistd.h>
7 int main(int argc, char **argv)
9 int s;
11 if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0)
13 perror("socket");
14 exit(1);
17 if (fcntl(s, F_SETOWN, getpid()) < 0)
19 perror("fcntl(F_SETOWN)");
20 exit(1);
23 if (close(s) < 0)
25 perror("close");
26 exit(1);
29 exit(0);