Source-Changes-HG archive

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

[src/netbsd-10]: src/sys Pull up following revision(s) (requested by gutterid...



details:   https://anonhg.NetBSD.org/src/rev/716950bed91c
branches:  netbsd-10
changeset: 376041:716950bed91c
user:      martin <martin%NetBSD.org@localhost>
date:      Sun May 28 09:43:26 2023 +0000

description:
Pull up following revision(s) (requested by gutteridge in ticket #175):

        sys/sys/proc.h: revision 1.371
        sys/kern/vfs_lookup.c: revision 1.234

Default PROC_MACHINE_ARCH to machine_arch and use this for magic
symlinks to resolve "@machine_arch".

This keeps behaviour of magic symlinks and 'uname -p' output the same.
Fixes PR 57320.

diffstat:

 sys/kern/vfs_lookup.c |  8 ++++----
 sys/sys/proc.h        |  6 +++++-
 2 files changed, 9 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r df64bf13c4ed -r 716950bed91c sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c     Tue May 16 16:27:44 2023 +0000
+++ b/sys/kern/vfs_lookup.c     Sun May 28 09:43:26 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_lookup.c,v 1.232 2022/08/22 09:14:59 hannken Exp $ */
+/*     $NetBSD: vfs_lookup.c,v 1.232.4.1 2023/05/28 09:43:26 martin Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.232 2022/08/22 09:14:59 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.232.4.1 2023/05/28 09:43:26 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_magiclinks.h"
@@ -137,8 +137,8 @@ symlink_magic(struct proc *p, char *cp, 
                 * to frequency of use.
                 */
                if (MATCH("machine_arch")) {
-                       slen = VNL(MACHINE_ARCH);
-                       SUBSTITUTE("machine_arch", MACHINE_ARCH, slen);
+                       slen = strlen(PROC_MACHINE_ARCH(p));
+                       SUBSTITUTE("machine_arch", PROC_MACHINE_ARCH(p), slen);
                } else if (MATCH("machine")) {
                        slen = VNL(MACHINE);
                        SUBSTITUTE("machine", MACHINE, slen);
diff -r df64bf13c4ed -r 716950bed91c sys/sys/proc.h
--- a/sys/sys/proc.h    Tue May 16 16:27:44 2023 +0000
+++ b/sys/sys/proc.h    Sun May 28 09:43:26 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.370 2022/05/09 13:27:24 wiz Exp $   */
+/*     $NetBSD: proc.h,v 1.370.4.1 2023/05/28 09:43:26 martin Exp $    */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -593,6 +593,10 @@ static __inline struct proc *
 #define PROC_DBREGSZ(p) (((p)->p_flag & PK_32) ? \
     sizeof(process_dbreg32) : sizeof(struct dbreg))
 
+#ifndef PROC_MACHINE_ARCH
+#define PROC_MACHINE_ARCH(p) machine_arch
+#endif
+
 /*
  * PROCLIST_FOREACH: iterate on the given proclist, skipping PK_MARKER ones.
  */



Home | Main Index | Thread Index | Old Index