Guest User

Untitled

a guest
Jul 16th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. /* We rely heavily on various flags the CLONE function understands:
  2. CLONE_VM, CLONE_FS, CLONE_FILES
  3. These flags select semantics with shared address space and
  4. file descriptors according to what POSIX requires.
  5. CLONE_SIGHAND, CLONE_THREAD
  6. This flag selects the POSIX signal semantics and various
  7. other kinds of sharing (itimers, POSIX timers, etc.).
  8. CLONE_SETTLS
  9. The sixth parameter to CLONE determines the TLS area for the
  10. new thread.
  11. CLONE_PARENT_SETTID
  12. The kernels writes the thread ID of the newly created thread
  13. into the location pointed to by the fifth parameters to CLONE.
  14. Note that it would be semantically equivalent to use
  15. CLONE_CHILD_SETTID but it is be more expensive in the kernel.
  16. CLONE_CHILD_CLEARTID
  17. The kernels clears the thread ID of a thread that has called
  18. sys_exit() in the location pointed to by the seventh parameter
  19. to CLONE.
  20. The termination signal is chosen to be zero which means no signal
  21. is sent. */
  22. const int clone_flags = (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SYSVSEM
  23. | CLONE_SIGHAND | CLONE_THREAD
  24. | CLONE_SETTLS | CLONE_PARENT_SETTID
  25. | CLONE_CHILD_CLEARTID
  26. | 0);
Add Comment
Please, Sign In to add comment