prog.cpp: In function ‘int main()’:
prog.cpp:8:17: error: expected primary-expression before ‘%’ token
int argc = *%rsp;
^
prog.cpp:8:18: error: ‘rsp’ was not declared in this scope
int argc = *%rsp;
^~~
prog.cpp:9:20: error: expected primary-expression before ‘%’ token
char* arg1 = *(%rsp + 16);
^
prog.cpp:12:21: error: ‘O_RDONLY’ was not declared in this scope
fd = open(arg1, O_RDONLY, 0);
^~~~~~~~
prog.cpp:12:32: error: ‘open’ was not declared in this scope
fd = open(arg1, O_RDONLY, 0);
^
prog.cpp:13:32: error: ‘lseek’ was not declared in this scope
len = lseek(fd, SEEK_END, 0);
^
prog.cpp:14:27: error: ‘PROT_READ’ was not declared in this scope
ptr = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
^~~~~~~~~
prog.cpp:14:38: error: ‘MAP_SHARED’ was not declared in this scope
ptr = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
^~~~~~~~~~
prog.cpp:14:55: error: ‘mmap’ was not declared in this scope
ptr = mmap(NULL, len, PROT_READ, MAP_SHARED, fd, 0);
^
prog.cpp:15:27: error: ‘write’ was not declared in this scope
write(stdout, ptr, len);
^
prog.cpp:16:20: error: ‘munmap’ was not declared in this scope
munmap(ptr, len);
^
prog.cpp:17:13: error: ‘close’ was not declared in this scope
close(fd);
^