Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Rename sys_ptrace_lwpstatus.c to sys_process_lwpsta...



details:   https://anonhg.NetBSD.org/src/rev/a7e62c133fcf
branches:  trunk
changeset: 466866:a7e62c133fcf
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Jan 04 03:46:19 2020 +0000

description:
Rename sys_ptrace_lwpstatus.c to sys_process_lwpstatus.c

Keep the names of functions internally as ptrace intact as this code
is shared with core_elf32.c that already reaches ptrace(2) specifc symbols.

No functional change intended.

diffstat:

 sys/kern/files.kern              |   4 +-
 sys/kern/sys_process_lwpstatus.c |  69 ++++++++++++++++++++++++++++++++++
 sys/kern/sys_ptrace_lwpstatus.c  |  81 ----------------------------------------
 3 files changed, 71 insertions(+), 83 deletions(-)

diffs (178 lines):

diff -r c2a0d84cbd44 -r a7e62c133fcf sys/kern/files.kern
--- a/sys/kern/files.kern       Sat Jan 04 03:43:18 2020 +0000
+++ b/sys/kern/files.kern       Sat Jan 04 03:46:19 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.kern,v 1.41 2019/12/26 08:52:38 kamil Exp $
+#      $NetBSD: files.kern,v 1.42 2020/01/04 03:46:19 kamil Exp $
 
 #
 # kernel sources
@@ -161,9 +161,9 @@
 file   kern/sys_lwp.c                  kern
 file   kern/sys_pipe.c                 !pipe_socketpair
 file   kern/sys_process.c              ptrace_hooks | ktrace
+file   kern/sys_process_lwpstatus.c    kern
 file   kern/sys_ptrace.c               ptrace
 file   kern/sys_ptrace_common.c        ptrace
-file   kern/sys_ptrace_lwpstatus.c     kern
 file   kern/sys_pset.c                 kern
 file   kern/sys_select.c               kern
 file   kern/sys_sig.c                  kern
diff -r c2a0d84cbd44 -r a7e62c133fcf sys/kern/sys_process_lwpstatus.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/kern/sys_process_lwpstatus.c  Sat Jan 04 03:46:19 2020 +0000
@@ -0,0 +1,69 @@
+/*     $NetBSD: sys_process_lwpstatus.c,v 1.1 2020/01/04 03:46:19 kamil Exp $  */
+
+/*-
+ * Copyright (c) 2019 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: sys_process_lwpstatus.c,v 1.1 2020/01/04 03:46:19 kamil Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/errno.h>
+#include <sys/lwp.h>
+#include <sys/ptrace.h>
+
+
+void
+ptrace_read_lwpstatus(struct lwp *l, struct ptrace_lwpstatus *pls)
+{
+
+       KASSERT(l->l_lid == pls->pl_lwpid);
+
+       memcpy(&pls->pl_sigmask, &l->l_sigmask, sizeof(pls->pl_sigmask));
+       memcpy(&pls->pl_sigpend, &l->l_sigpend.sp_set, sizeof(pls->pl_sigpend));
+
+       if (l->l_name == NULL)
+               memset(&pls->pl_name, 0, PL_LNAMELEN);
+       else {
+               KASSERT(strlen(l->l_name) < PL_LNAMELEN);
+               strncpy(pls->pl_name, l->l_name, PL_LNAMELEN);
+       }
+
+#ifdef PTRACE_LWP_GETPRIVATE
+       pls->pl_private = (void *)(intptr_t)PTRACE_LWP_GETPRIVATE(l);
+#else
+       pls->pl_private = l->l_private;
+#endif
+}
+
+void
+process_read_lwpstatus(struct lwp *l, struct ptrace_lwpstatus *pls)
+{
+
+       pls->pl_lwpid = l->l_lid;
+
+       ptrace_read_lwpstatus(l, pls);
+}
diff -r c2a0d84cbd44 -r a7e62c133fcf sys/kern/sys_ptrace_lwpstatus.c
--- a/sys/kern/sys_ptrace_lwpstatus.c   Sat Jan 04 03:43:18 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*     $NetBSD: sys_ptrace_lwpstatus.c,v 1.1 2019/12/26 08:52:38 kamil Exp $   */
-
-/*-
- * Copyright (c) 2019 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_lwpstatus.c,v 1.1 2019/12/26 08:52:38 kamil Exp $");
-
-#ifdef _KERNEL_OPT
-#include "opt_ptrace.h"
-#include "opt_ktrace.h"
-#include "opt_pax.h"
-#include "opt_compat_netbsd32.h"
-#endif
-
-#if defined(__HAVE_COMPAT_NETBSD32) && !defined(COMPAT_NETBSD32) \
-    && !defined(_RUMPKERNEL)
-#define COMPAT_NETBSD32
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/errno.h>
-#include <sys/lwp.h>
-#include <sys/ptrace.h>
-
-
-void
-ptrace_read_lwpstatus(struct lwp *l, struct ptrace_lwpstatus *pls)
-{
-
-       KASSERT(l->l_lid == pls->pl_lwpid);
-
-       memcpy(&pls->pl_sigmask, &l->l_sigmask, sizeof(pls->pl_sigmask));
-       memcpy(&pls->pl_sigpend, &l->l_sigpend.sp_set, sizeof(pls->pl_sigpend));
-
-       if (l->l_name == NULL)
-               memset(&pls->pl_name, 0, PL_LNAMELEN);
-       else {
-               KASSERT(strlen(l->l_name) < PL_LNAMELEN);
-               strncpy(pls->pl_name, l->l_name, PL_LNAMELEN);
-       }
-
-#ifdef PTRACE_LWP_GETPRIVATE
-       pls->pl_private = (void *)(intptr_t)PTRACE_LWP_GETPRIVATE(l);
-#else
-       pls->pl_private = l->l_private;
-#endif
-}
-
-void
-process_read_lwpstatus(struct lwp *l, struct ptrace_lwpstatus *pls)
-{
-
-       pls->pl_lwpid = l->l_lid;
-
-       ptrace_read_lwpstatus(l, pls);
-}



Home | Main Index | Thread Index | Old Index