prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:4:3: error: ‘::fprintf’ has not been declared
::fprintf(stderr, "Usage: %s <filepath> <buffer size>\n", argv[0]);
^~
prog.cpp:4:13: error: ‘stderr’ was not declared in this scope
::fprintf(stderr, "Usage: %s <filepath> <buffer size>\n", argv[0]);
^~~~~~
prog.cpp:9:2: error: ‘size_t’ was not declared in this scope
size_t buf_size = ::strtoul(argv[2], NULL, 10);;
^~~~~~
prog.cpp:11:6: error: ‘buf_size’ was not declared in this scope
if (buf_size == 0) {
^~~~~~~~
prog.cpp:12:3: error: ‘::fprintf’ has not been declared
::fprintf(stderr, "Usage: %s <filepath> <buffer size>\n", filename);
^~
prog.cpp:12:13: error: ‘stderr’ was not declared in this scope
::fprintf(stderr, "Usage: %s <filepath> <buffer size>\n", filename);
^~~~~~
prog.cpp:13:3: error: ‘::fprintf’ has not been declared
::fprintf(stderr, "<buffer size> must be greater than zero\n", filename);
^~
prog.cpp:17:2: error: ‘time_t’ was not declared in this scope
time_t u_start = time(NULL);
^~~~~~
prog.cpp:20:2: error: ‘ssize_t’ was not declared in this scope
ssize_t i_size;
^~~~~~~
prog.cpp:21:11: error: ‘::open’ has not been declared
int fd = ::open(filename, O_RDONLY|O_LARGEFILE);
^~
prog.cpp:21:28: error: ‘O_RDONLY’ was not declared in this scope
int fd = ::open(filename, O_RDONLY|O_LARGEFILE);
^~~~~~~~
prog.cpp:21:37: error: ‘O_LARGEFILE’ was not declared in this scope
int fd = ::open(filename, O_RDONLY|O_LARGEFILE);
^~~~~~~~~~~
prog.cpp:24:3: error: ‘::fprintf’ has not been declared
::fprintf(stderr, "fatal error: open file error \"%s\"\n", filename);
^~
prog.cpp:24:13: error: ‘stderr’ was not declared in this scope
::fprintf(stderr, "fatal error: open file error \"%s\"\n", filename);
^~~~~~
prog.cpp:28:10: error: ‘::malloc’ has not been declared
p_buf = ::malloc(buf_size);
^~
prog.cpp:28:19: error: ‘buf_size’ was not declared in this scope
p_buf = ::malloc(buf_size);
^~~~~~~~
prog.cpp:31:8: error: ‘i_size’ was not declared in this scope
if ((i_size = ::read(fd, p_buf, buf_size)) < 0) {
^~~~~~
prog.cpp:31:17: error: ‘::read’ has not been declared
if ((i_size = ::read(fd, p_buf, buf_size)) < 0) {
^~
prog.cpp:32:4: error: ‘::fprintf’ has not been declared
::fprintf(stderr, "fatal error: %u bytes read error\n", buf_size);
^~
prog.cpp:32:14: error: ‘stderr’ was not declared in this scope
::fprintf(stderr, "fatal error: %u bytes read error\n", buf_size);
^~~~~~
prog.cpp:35:11: error: ‘i_size’ was not declared in this scope
} while (i_size == buf_size);
^~~~~~
prog.cpp:37:2: error: ‘::free’ has not been declared
::free(p_buf);
^~
prog.cpp:38:2: error: ‘::fprintf’ has not been declared
::fprintf(stdout, "%d\n", time(NULL) - u_start);
^~
prog.cpp:38:12: error: ‘stdout’ was not declared in this scope
::fprintf(stdout, "%d\n", time(NULL) - u_start);
^~~~~~
prog.cpp:38:33: error: ‘NULL’ was not declared in this scope
::fprintf(stdout, "%d\n", time(NULL) - u_start);
^~~~
prog.cpp:38:37: error: ‘time’ was not declared in this scope
::fprintf(stdout, "%d\n", time(NULL) - u_start);
^
prog.cpp:38:41: error: ‘u_start’ was not declared in this scope
::fprintf(stdout, "%d\n", time(NULL) - u_start);
^~~~~~~