ftmemsim-valgrind/none/tests/fcntl_setown.c
Tom Hughes 1afbb3fc45 Modified the fcntl system call so that only those reason codes which
can block (ie F_SETLKW) are treated as blocking.

This resolves the F_SETOWN problem described in bug #85969.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2535
2004-07-29 21:20:11 +00:00

31 lines
439 B
C

#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <unistd.h>
int main(int argc, char **argv)
{
int s;
if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0)
{
perror("socket");
exit(1);
}
if (fcntl(s, F_SETOWN, getpid()) < 0)
{
perror("fcntl(F_SETOWN)");
exit(1);
}
if (close(s) < 0)
{
perror("close");
exit(1);
}
exit(0);
}