Module Name: src
Committed By: martin
Date: Wed Aug 3 10:42:02 UTC 2022
Modified Files:
src/include [netbsd-9]: sched.h
src/lib/libc/sys [netbsd-9]: clone.2
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.52.1 src/include/sched.h
cvs rdiff -u -r1.13 -r1.13.42.1 src/lib/libc/sys/clone.2
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/include/sched.h
diff -u src/include/sched.h:1.12 src/include/sched.h:1.12.52.1
--- src/include/sched.h:1.12 Sun Jan 11 03:04:12 2009
+++ src/include/sched.h Wed Aug 3 10:42:02 2022
@@ -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_ */
Index: src/lib/libc/sys/clone.2
diff -u src/lib/libc/sys/clone.2:1.13 src/lib/libc/sys/clone.2:1.13.42.1
--- src/lib/libc/sys/clone.2:1.13 Sun Jan 29 11:44:54 2012
+++ src/lib/libc/sys/clone.2 Wed Aug 3 10:42:02 2022
@@ -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 implementa
.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