mirror of https://github.com/mkerrisk/man-pages
clone.2: Use syscall(SYS_...); for system calls without a wrapper
The CLONE_* constants seem to be available from either <linux/sched.h> or <sched.h>, and since clone3() already includes <linux/sched.h> for 'struct clone_args', <sched.h> is not really needed, AFAICS; however, to avoid confusion, I also included <sched.h> for clone3() for consistency: clone() is getting CLONE_* from <sched.h>, and it would confuse the reader if clone3() got the same CLONE_* constants from a different header. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
74ddb3019f
commit
a380538369
17
man2/clone.2
17
man2/clone.2
|
@ -56,13 +56,13 @@ clone, __clone2, clone3 \- create a child process
|
||||||
.PP
|
.PP
|
||||||
/* For the prototype of the raw clone() system call, see NOTES */
|
/* For the prototype of the raw clone() system call, see NOTES */
|
||||||
.PP
|
.PP
|
||||||
.BI "long clone3(struct clone_args *" cl_args ", size_t " size );
|
.BR "#include <linux/sched.h>" " /* Definition of " "struct clone_args" " */"
|
||||||
.fi
|
.BR "#include <sched.h>" " /* Definition of " CLONE_* " constants */"
|
||||||
|
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
|
||||||
|
.B #include <unistd.h>
|
||||||
.PP
|
.PP
|
||||||
.IR Note :
|
.BI "long syscall(SYS_clone3, struct clone_args *" cl_args ", size_t " size );
|
||||||
There is no glibc wrapper for
|
.fi
|
||||||
.BR clone3 ();
|
|
||||||
see NOTES.
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
These system calls
|
These system calls
|
||||||
create a new ("child") process, in a manner similar to
|
create a new ("child") process, in a manner similar to
|
||||||
|
@ -1541,11 +1541,6 @@ One use of these systems calls
|
||||||
is to implement threads: multiple flows of control in a program that
|
is to implement threads: multiple flows of control in a program that
|
||||||
run concurrently in a shared address space.
|
run concurrently in a shared address space.
|
||||||
.PP
|
.PP
|
||||||
Glibc does not provide a wrapper for
|
|
||||||
.BR clone3 ();
|
|
||||||
call it using
|
|
||||||
.BR syscall (2).
|
|
||||||
.PP
|
|
||||||
Note that the glibc
|
Note that the glibc
|
||||||
.BR clone ()
|
.BR clone ()
|
||||||
wrapper function makes some changes
|
wrapper function makes some changes
|
||||||
|
|
Loading…
Reference in New Issue