Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <errno.h>
- #include <stdio.h>
- static char buf[1];
- int main(int argc, char *argv[])
- {
- int fd;
- int ret;
- if (argc < 2)
- exit(1);
- fd = open(argv[1], 0);
- if (fd < 0)
- exit(1);
- ret = read(fd, (size_t)-1, buf);
- printf("ret: %d %d\n", ret, errno);
- close(fd);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement