SHARE
TWEET
read().c
a guest
Apr 3rd, 2017
88
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #include <stdio.h>
- #include <unistd.h>
- int main()
- {
- char *buf = NULL;
- int len = 10;
- len = read(STDIN_FILENO, buf, 40);
- if (len > 0) {
- printf("%d", len);
- printf("\ngot %d bytes", len);
- return 0;
- }
- else if (len <= 0)
- {
- printf("%d", len);
- printf("\nFalse or got EOF");
- }
- return 0;
- }
RAW Paste Data
