From 01daf6f09b8fa9da82ea275389bd9e5530120e85 Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 3 Aug 2022 10:42:02 +0000 Subject: Pull up following revision(s) (requested by wiz in ticket #1484): lib/libc/sys/clone.2: revision 1.14 lib/libc/sys/clone.2: revision 1.15 include/sched.h: revision 1.13 include/sched.h: revision 1.14 include/sched.h: revision 1.15 Remove mentions of CLONE_PID and CLONE_STOPPED CLONE_PID was removed in Linux 2.5.15 and recycled for CLONE_PIDFD since Linux 5.2. CLONE_STOPPED was removed in Linux 2.6.38 and recycled for CLONE_NEWCGROUP since Linux 4.6. sched.h: Linux documents clone and __clone as only available when_GNU_SOURCE is defined - follow suit. Ok martin@ clone(2): document that _GNU_SOURCE must be defined for the prototypes sched.h: format comment to follow KNF requested by thorpej@ sched.h: keep __clone() visible under _NETBSD_SOURCE --- include/sched.h | 24 ++++++++++++++++++------ 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 -- cgit