Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- #include <fcntl.h>
- #include <limits.h>
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int fd;
- if(0>(fd = open("DELETED", O_CREAT|O_RDWR|O_CLOEXEC, 0600))) return perror("open"),1;
- static char const msg[]="got men";
- (void)write(fd, msg, sizeof(msg));
- if(0>(unlink("DELETED"))) return perror("unlink"),1;
- char buf[128];
- sprintf(buf,"cat /proc/%ld/fd/%d", (long)getpid(), fd);
- system(buf);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement