Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <pthread.h>
- #include <linux/sched.h>
- #include <unistd.h>
- #include <stdio.h>
- extern int unshare(int);
- static void *
- thread_main(void *arg)
- {
- #ifndef BEES
- if (unshare(CLONE_FILES) < 0) {
- perror("unshare");
- }
- #endif
- if (close(1) < 0) {
- perror("close");
- }
- return arg;
- }
- int main() {
- pthread_t thr;
- pthread_create(&thr, 0, thread_main, 0);
- pthread_join(thr, 0);
- if (write(1, "Bees?\n", 6) != 6) {
- perror("write");
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement