Files
ftmemsim-valgrind/tests/erringfds.c
Julian Seward 3c5002fd6c Add test for correct handling of read/write with invalid fds.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@315
2002-05-23 16:53:20 +00:00

18 lines
302 B
C

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main ( void )
{
int fd, n;
char buf[10];
fd = open("foo/bar/xyzzy", O_RDONLY); /* fails */
printf("fd = %d\n", fd);
n = read ( fd, buf, 10 );
printf ("n = %d\n", n);
return 0;
}