diff options
| -rw-r--r-- | include/sched.h | 24 | ||||
| -rw-r--r-- | lib/libc/sys/clone.2 | 9 |
2 files changed, 21 insertions, 12 deletions
diff --git a/include/sched.h b/include/sched.h index 0a3e423fd27..fabab1ef05d 100644 --- a/include/sched.h +++ b/include/sched.h @@ -1,4 +1,4 @@ -/* $NetBSD: sched.h,v 1.12 2009/01/11 03:04:12 christos Exp $ */ +/* $NetBSD: sched.h,v 1.12.52.1 2022/08/03 10:42:02 martin Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -59,20 +59,32 @@ __END_DECLS #define sched_yield __libc_thr_yield #endif /* __LIBPTHREAD_SOURCE__ */ -#if defined(_NETBSD_SOURCE) - __BEGIN_DECLS +#if defined(_NETBSD_SOURCE) + /* Process affinity functions (not portable) */ int sched_getaffinity_np(pid_t, size_t, cpuset_t *); int sched_setaffinity_np(pid_t, size_t, cpuset_t *); -/* Historical functions, not defined in standard */ +#endif /* _NETBSD_SOURCE */ + +#if defined(_GNU_SOURCE) + +/* + * Historical functions, not defined in standard + * Linux man page documents clone() as only available when + * _GNU_SOURCE is defined + */ pid_t clone(int (*)(void *), void *, int, void *); -pid_t __clone(int (*)(void *), void *, int, void *); +#endif /* _GNU_SOURCE */ -__END_DECLS +#if defined(_NETBSD_SOURCE) + +pid_t __clone(int (*)(void *), void *, int, void *); #endif /* _NETBSD_SOURCE */ +__END_DECLS + #endif /* _SCHED_H_ */ diff --git a/lib/libc/sys/clone.2 b/lib/libc/sys/clone.2 index dbdaf5aad22..931cb3866bb 100644 --- a/lib/libc/sys/clone.2 +++ b/lib/libc/sys/clone.2 @@ -1,4 +1,4 @@ -.\" $NetBSD: clone.2,v 1.13 2012/01/29 11:44:54 wiz Exp $ +.\" $NetBSD: clone.2,v 1.13.42.1 2022/08/03 10:42:02 martin Exp $ .\" .\" Copyright (c) 2001 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 4, 2010 +.Dd August 1, 2022 .Dt CLONE 2 .Os .Sh NAME @@ -37,6 +37,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS +.Fd #define _GNU_SOURCE .In sched.h .Ft pid_t .Fn clone "int (*func)(void *arg)" "void *stack" "int flags" "void *arg" @@ -189,14 +190,10 @@ that are present in the Linux implementation: .It .Dv CLONE_PARENT_SETTID .It -.Dv CLONE_PID -.It .Dv CLONE_PTRACE .It .Dv CLONE_SETTLS .It -.Dv CLONE_STOPPED -.It .Dv CLONE_SYSVSEM .It .Dv CLONE_THREAD |
