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
configure.ac: Generalize glibc version check
[valgrind.git]
/
memcheck
/
tests
/
erringfds.c
blob
0f1afe5deecc5303f43c567fe74ddd6595f970db
1
2
#include <stdio.h>
3
#include <sys/types.h>
4
#include <sys/stat.h>
5
#include <fcntl.h>
6
#include <unistd.h>
7
8
int
main
(
void
)
9
{
10
int
fd
,
n
;
11
char
buf
[
10
];
12
fd
=
open
(
"foo/bar/xyzzy"
,
O_RDONLY
);
/* fails */
13
printf
(
"fd = %d
\n
"
,
fd
);
14
n
=
read
(
fd
,
buf
,
10
);
15
printf
(
"n = %d
\n
"
,
n
);
16
return
0
;
17
}