#include #include /*arguments of syscall can be found on http://blog.rchapman.org/post/36801038863/linux-system-call-table-for-x86-64*/ int main(int argc, char* argv[]){ const char* fileName[7] = "me.txt"; //create a file that the owner can read/write. flags can be found easily by google syscall(SYS_open,fileName,O_CREAT,S_IRUSR|S_IWUSR); //open it as write only int fd = syscall(SYS_open,fileName,O_WRONLY); //write somehing syscall(SYS_write,fd,"hello",5); //close the file syscall(SYS_close,fd); //change permission to executable syscall(SYS_fchmod,fd,S_IXUSR); }