CVS commit: src/sys/dev/hpc

2021-06-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun  5 02:27:08 UTC 2021

Modified Files:
src/sys/dev/hpc: hpcfb.c

Log Message:
hpcfb_cnattach(): If fbconf == NULL, this is for early console output
(used for hpcmips/VR41xx machines), and wsdisplay_preattach() should be
used instead of wsdisplay_cnattach().

Fix KASSERT failure for double attach of wsdisplay, reported in port-mips.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/hpc/hpcfb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/hpc/hpcfb.c
diff -u src/sys/dev/hpc/hpcfb.c:1.61 src/sys/dev/hpc/hpcfb.c:1.62
--- src/sys/dev/hpc/hpcfb.c:1.61	Sat Apr 24 23:36:54 2021
+++ src/sys/dev/hpc/hpcfb.c	Sat Jun  5 02:27:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpcfb.c,v 1.61 2021/04/24 23:36:54 thorpej Exp $	*/
+/*	$NetBSD: hpcfb.c,v 1.62 2021/06/05 02:27:08 rin Exp $	*/
 
 /*-
  * Copyright (c) 1999
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.61 2021/04/24 23:36:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.62 2021/06/05 02:27:08 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_hpcfb.h"
@@ -410,8 +410,17 @@ hpcfb_cnattach(struct hpcfb_fbconf *fbco
 	hpcfb_console_wsscreen.capabilities = hpcfb_console_dc.dc_rinfo.ri_caps;
 	hpcfb_allocattr(_console_dc,
 			WSCOL_WHITE, WSCOL_BLACK, 0, );
-	wsdisplay_cnattach(_console_wsscreen, _console_dc,
-	0, 0, defattr);
+#if NBIVIDEO > 0
+	/*
+	 * This is early console. Do not really attach wsdisplay.
+	 */
+	if (fbconf == &__fbconf)
+		wsdisplay_preattach(_console_wsscreen, _console_dc,
+		0, 0, defattr);
+	else
+#endif
+		wsdisplay_cnattach(_console_wsscreen, _console_dc,
+		0, 0, defattr);
 	hpcfbconsole = 1;
 
 	return (0);



CVS commit: src/sys/dev/isa

2021-06-04 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Jun  5 01:40:53 UTC 2021

Modified Files:
src/sys/dev/isa: itesio_isavar.h

Log Message:
Add IT8625 chip id.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/isa/itesio_isavar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/isa/itesio_isavar.h
diff -u src/sys/dev/isa/itesio_isavar.h:1.12 src/sys/dev/isa/itesio_isavar.h:1.13
--- src/sys/dev/isa/itesio_isavar.h:1.12	Tue Jul 23 09:38:53 2019
+++ src/sys/dev/isa/itesio_isavar.h	Sat Jun  5 01:40:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: itesio_isavar.h,v 1.12 2019/07/23 09:38:53 msaitoh Exp $	*/
+/*	$NetBSD: itesio_isavar.h,v 1.13 2021/06/05 01:40:53 nonaka Exp $	*/
 /*	$OpenBSD: itvar.h,v 1.2 2003/11/05 20:57:10 grange Exp $	*/
 
 /*
@@ -57,6 +57,7 @@
 #define ITESIO_CHIPID2	0x21	/* Chip ID 2 */
 #define ITESIO_DEVREV	0x22	/* Device Revision */
 
+#define ITESIO_ID8625	0x8625
 #define ITESIO_ID8628	0x8628
 #define ITESIO_ID8655	0x8655
 #define ITESIO_ID8705	0x8705



CVS commit: src/sys/arch/x86/pci

2021-06-04 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Jun  5 01:38:22 UTC 2021

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
amdzentemp(4): Add Zen 3 support.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/pci/amdzentemp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.11 src/sys/arch/x86/pci/amdzentemp.c:1.12
--- src/sys/arch/x86/pci/amdzentemp.c:1.11	Sat Apr 25 15:26:18 2020
+++ src/sys/arch/x86/pci/amdzentemp.c	Sat Jun  5 01:38:22 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.11 2020/04/25 15:26:18 bouyer Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.12 2021/06/05 01:38:22 nonaka Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.11 2020/04/25 15:26:18 bouyer Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.12 2021/06/05 01:38:22 nonaka Exp $ ");
 
 #include 
 #include 
@@ -177,6 +177,7 @@ amdzentemp_attach(device_t parent, devic
 		sc->sc_sme->sme_refresh = amdzentemp_family15_refresh;
 		break;
 	case 0x17:
+	case 0x19:
 		sc->sc_sme->sme_refresh = amdzentemp_family17_refresh;
 		break;
 	default:



CVS commit: src/tests/lib/libcurses

2021-06-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Jun  4 23:07:39 UTC 2021

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
Fix debug_test so it actually works and does not do damage
* disable blind clearing of /tmp.  The comment says this is needed for 
getwin/putwin
  those tests need to be looked at to correct this.
* remove invalid -I option from director arguments for now.
* fix paths to executables so debug_test will work with installed versions by 
default
  the previous version was using the src tree locations but basedir was wrong 
for that.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/debug_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/debug_test
diff -u src/tests/lib/libcurses/debug_test:1.4 src/tests/lib/libcurses/debug_test:1.5
--- src/tests/lib/libcurses/debug_test:1.4	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/debug_test	Fri Jun  4 23:07:39 2021
@@ -8,7 +8,7 @@ INCLUDE_PATH="${BASEDIR}/tests/"
 export INCLUDE_PATH
 #
 CURSES_TRACE_FILE="/tmp/ctrace"
-SLAVE="${BASEDIR}/slave/slave"
+SLAVE="${BASEDIR}/slave"
 
 usage() {
 	echo "Set up the environment to run the test frame.  Option flags:"
@@ -31,10 +31,11 @@ usage() {
 
 # This is needed for getwin/putwin test case and /tmp can be used for any file
 # related tests.
-rm -rf /tmp/*
+#rm -rf /tmp/*
 
 #
-ARGS="-T ${BASEDIR} -I ${INCLUDE_PATH} -C ${CHECK_PATH}"
+#ARGS="-T ${BASEDIR} -I ${INCLUDE_PATH} -C ${CHECK_PATH}"
+ARGS="-T ${BASEDIR} -C ${CHECK_PATH}"
 #
 while getopts cf:L:s:vg opt
 do
@@ -90,4 +91,4 @@ then
 	exit 1
 fi
 #
-exec ${BASEDIR}/director/director ${ARGS} -s ${SLAVE} "${INCLUDE_PATH}/$1"
+exec ${BASEDIR}/director ${ARGS} -s ${SLAVE} "${INCLUDE_PATH}/$1"



CVS commit: src/sbin/mount_chfs

2021-06-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  4 22:41:36 UTC 2021

Modified Files:
src/sbin/mount_chfs: mount_chfs.c mount_chfs.h

Log Message:
mount_chfs(8): Remove some vestiges of chewiefs name.

Add RCS id while here and nix some needless whitespace.

No functional change intended.

Patch from Andrius V.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/mount_chfs/mount_chfs.c
cvs rdiff -u -r1.1 -r1.2 src/sbin/mount_chfs/mount_chfs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/mount_chfs/mount_chfs.c
diff -u src/sbin/mount_chfs/mount_chfs.c:1.2 src/sbin/mount_chfs/mount_chfs.c:1.3
--- src/sbin/mount_chfs/mount_chfs.c:1.2	Fri Sep 13 21:03:29 2013
+++ src/sbin/mount_chfs/mount_chfs.c	Fri Jun  4 22:41:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_chfs.c,v 1.2 2013/09/13 21:03:29 joerg Exp $	*/
+/*	$NetBSD: mount_chfs.c,v 1.3 2021/06/04 22:41:36 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -116,12 +116,11 @@ mount_chfs(int argc, char *argv[])
 	struct ufs_args args;
 	char canon_dev[MAXPATHLEN], fs_name[MAXPATHLEN];
 	int mntflags;
-	
 
 	mount_chfs_parseargs(argc, argv, , ,
 	canon_dev, fs_name);
 
-	if (mount(MOUNT_CHEWIEFS, fs_name, mntflags, , sizeof args) == -1) {
+	if (mount(MOUNT_CHFS, fs_name, mntflags, , sizeof args) == -1) {
 		err(EXIT_FAILURE, "chfs on %s", fs_name);
 	}
 

Index: src/sbin/mount_chfs/mount_chfs.h
diff -u src/sbin/mount_chfs/mount_chfs.h:1.1 src/sbin/mount_chfs/mount_chfs.h:1.2
--- src/sbin/mount_chfs/mount_chfs.h:1.1	Thu Nov 24 15:54:55 2011
+++ src/sbin/mount_chfs/mount_chfs.h	Fri Jun  4 22:41:36 2021
@@ -1,3 +1,5 @@
+/*	$NetBSD: mount_chfs.h,v 1.2 2021/06/04 22:41:36 riastradh Exp $	*/
+
 /*
  * Copyright (c) 2008 The NetBSD Foundation.  All Rights Reserved.
  *
@@ -23,18 +25,17 @@
  * SUCH DAMAGE.
  */
 
-#ifndef _SBIN_MOUNT_CHEWIEFS_MOUNT_CHEWIEFS_H_
-#define _SBIN_MOUNT_CHEWIEFS_MOUNT_CHEWIEFS_H_
+#ifndef _SBIN_MOUNT_CHFS_MOUNT_CHFS_H_
+#define _SBIN_MOUNT_CHFS_MOUNT_CHFS_H_
 
 #include 
 
-#ifndef MOUNT_CHEWIEFS
-#define MOUNT_CHEWIEFS "chfs"
+#ifndef MOUNT_CHFS
+#define MOUNT_CHFS "chfs"
 #endif
 
-
 int	 mount_chfs(int, char **);
 void mount_chfs_parseargs(int, char **, struct ufs_args *, int *,
 char *, char *);
 
-#endif /* _SBIN_MOUNT_CHEWIEFS_MOUNT_CHEWIEFS_H_ */
+#endif /* _SBIN_MOUNT_CHFS_MOUNT_CHFS_H_ */



CVS commit: src/bin/ps

2021-06-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun  4 22:39:41 UTC 2021

Modified Files:
src/bin/ps: ps.c

Log Message:
use parsenum like everywhere else in the code.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/bin/ps/ps.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/ps/ps.c
diff -u src/bin/ps/ps.c:1.95 src/bin/ps/ps.c:1.96
--- src/bin/ps/ps.c:1.95	Fri Jun  4 04:17:53 2021
+++ src/bin/ps/ps.c	Fri Jun  4 18:39:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ps.c,v 1.95 2021/06/04 08:17:53 wiz Exp $	*/
+/*	$NetBSD: ps.c,v 1.96 2021/06/04 22:39:41 christos Exp $	*/
 
 /*
  * Copyright (c) 2000-2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 19
 #if 0
 static char sccsid[] = "@(#)ps.c	8.4 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: ps.c,v 1.95 2021/06/04 08:17:53 wiz Exp $");
+__RCSID("$NetBSD: ps.c,v 1.96 2021/06/04 22:39:41 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -257,20 +257,13 @@ main(int argc, char *argv[])
 		case 'G':
 			if (*optarg != '\0') {
 struct group *gr;
-char *ep;
 
 what = KERN_PROC_GID;
 gr = getgrnam(optarg);
 if (gr == NULL) {
-	errno = 0;
-	flag = strtoul(optarg, , 10);
-	if (errno)
-		err(1, "%s", optarg);
-	if (*ep != '\0')
-		errx(1, "%s: illegal group",
-			optarg);
-	} else
-		flag = gr->gr_gid;
+	flag = parsenum(optarg, "group id");
+} else
+	flag = gr->gr_gid;
 			}
 			break;
 
@@ -359,7 +352,7 @@ main(int argc, char *argv[])
 what = KERN_PROC_UID;
 pw = getpwnam(optarg);
 if (pw == NULL) {
-	flag = parsenum(optarg, "user name");
+	flag = parsenum(optarg, "user id");
 } else
 	flag = pw->pw_uid;
 			}



CVS commit: src/usr.bin/xlint/lint1

2021-06-04 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun  4 21:12:10 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: ckgetopt.c

Log Message:
lint: fix function name in check for getopt

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/xlint/lint1/ckgetopt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/ckgetopt.c
diff -u src/usr.bin/xlint/lint1/ckgetopt.c:1.9 src/usr.bin/xlint/lint1/ckgetopt.c:1.10
--- src/usr.bin/xlint/lint1/ckgetopt.c:1.9	Sun Apr 18 17:36:18 2021
+++ src/usr.bin/xlint/lint1/ckgetopt.c	Fri Jun  4 21:12:10 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ckgetopt.c,v 1.9 2021/04/18 17:36:18 rillig Exp $ */
+/* $NetBSD: ckgetopt.c,v 1.10 2021/06/04 21:12:10 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: ckgetopt.c,v 1.9 2021/04/18 17:36:18 rillig Exp $");
+__RCSID("$NetBSD: ckgetopt.c,v 1.10 2021/06/04 21:12:10 rillig Exp $");
 #endif
 
 #include 
@@ -81,8 +81,9 @@ static struct {
 			return false;	\
 	} while (false)
 
+/* Return whether tn has the form 'getopt(argc, argv, "literal") != -1'. */
 static bool
-is_getopt_call(const tnode_t *tn, char **out_options)
+is_getopt_condition(const tnode_t *tn, char **out_options)
 {
 	NEED(tn != NULL);
 	NEED(tn->tn_op == NE);
@@ -144,7 +145,7 @@ void
 check_getopt_begin_while(const tnode_t *tn)
 {
 	if (ck.while_level == 0) {
-		if (!is_getopt_call(tn, ))
+		if (!is_getopt_condition(tn, ))
 			return;
 		ck.options_pos = curr_pos;
 	}
@@ -158,7 +159,6 @@ check_getopt_begin_switch(void)
 		ck.switch_level++;
 }
 
-
 void
 check_getopt_case_label(int64_t value)
 {



CVS commit: src/usr.bin/xlint/common

2021-06-04 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Jun  4 20:54:18 UTC 2021

Modified Files:
src/usr.bin/xlint/common: tyname.c

Log Message:
lint: fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/xlint/common/tyname.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.40 src/usr.bin/xlint/common/tyname.c:1.41
--- src/usr.bin/xlint/common/tyname.c:1.40	Sun Apr 18 17:47:32 2021
+++ src/usr.bin/xlint/common/tyname.c	Fri Jun  4 20:54:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.40 2021/04/18 17:47:32 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.41 2021/06/04 20:54:18 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.40 2021/04/18 17:47:32 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.41 2021/06/04 20:54:18 rillig Exp $");
 #endif
 
 #include 
@@ -197,7 +197,7 @@ sametype(const type_t *t1, const type_t 
 	if (t1->t_tspec != t2->t_tspec)
 		return false;
 
-	/* Ignore const/void */
+	/* Ignore const/volatile */
 
 	switch (t = t1->t_tspec) {
 	case BOOL:



CVS commit: src/sys/arch/hp300/dev

2021-06-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jun  4 17:12:08 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: rdvar.h

Log Message:
Consistently use #define as rdreg.h.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp300/dev/rdvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hp300/dev/rdvar.h
diff -u src/sys/arch/hp300/dev/rdvar.h:1.23 src/sys/arch/hp300/dev/rdvar.h:1.24
--- src/sys/arch/hp300/dev/rdvar.h:1.23	Tue Apr 14 20:32:35 2015
+++ src/sys/arch/hp300/dev/rdvar.h	Fri Jun  4 17:12:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rdvar.h,v 1.23 2015/04/14 20:32:35 riastradh Exp $	*/
+/*	$NetBSD: rdvar.h,v 1.24 2021/06/04 17:12:08 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -87,16 +87,16 @@ struct	rd_softc {
 /* sc_flags values */
 #define	RDF_ALIVE	0x01
 #define	RDF_SEEK	0x02
-#define RDF_SWAIT	0x04
-#define RDF_OPENING	0x08
-#define RDF_CLOSING	0x10
-#define RDF_WANTED	0x20
-#define RDF_WLABEL	0x40
+#define	RDF_SWAIT	0x04
+#define	RDF_OPENING	0x08
+#define	RDF_CLOSING	0x10
+#define	RDF_WANTED	0x20
+#define	RDF_WLABEL	0x40
 
 #define	rdunit(x)	((int)(minor(x) >> 3))
-#define rdpart(x)	((int)(minor(x) & 0x7))
+#define	rdpart(x)	((int)(minor(x) & 0x7))
 #define	rdpunit(x)	((x) & 7)
-#define rdlabdev(d)	(dev_t)(((int)(d)&~7)|2)	/* rd?c */
+#define	rdlabdev(d)	(dev_t)(((int)(d)&~7)|2)	/* rd?c */
 
 #define	RDRETRY		5
-#define RDWAITC		1	/* min time for timeout in seconds */
+#define	RDWAITC		1	/* min time for timeout in seconds */



CVS commit: src/distrib/common/bootimage

2021-06-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jun  4 17:09:36 UTC 2021

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Check and remove a stale work file for UEFI images with incorrect size.

Fixes PR/56132 (build.sh target install-image fails in update-mode).


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/distrib/common/bootimage/Makefile.bootimage

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.26 src/distrib/common/bootimage/Makefile.bootimage:1.27
--- src/distrib/common/bootimage/Makefile.bootimage:1.26	Wed Aug  5 01:35:18 2020
+++ src/distrib/common/bootimage/Makefile.bootimage	Fri Jun  4 17:09:36 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.26 2020/08/05 01:35:18 jmcneill Exp $
+#	$NetBSD: Makefile.bootimage,v 1.27 2021/06/04 17:09:36 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -294,6 +294,15 @@ WORKFATDIR?=	work.fatdir
 
 .if ${USE_GPT} != "no"
 ${WORKFSTAB}: ${WORKMBR}
+
+.BEGIN:
+	@if [ -f ${WORKMBR} ]; then			 		\
+		st_size=`${TOOL_STAT} -f %z ${WORKMBR}`;		\
+		if [ "$$st_size" -ne "$$((${IMAGESECTORS} * 512))" ]; then \
+			echo Removing stale ${WORKMBR} ...;		\
+			rm -f ${WORKMBR};\
+		fi			\
+	fi
 .endif
 
 ${WORKFSTAB}:



CVS commit: src/tests/libexec/ld.elf_so/helper_ifunc_dso

2021-06-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jun  4 15:37:48 UTC 2021

Modified Files:
src/tests/libexec/ld.elf_so/helper_ifunc_dso: h_helper_ifunc.c

Log Message:
PR/56230: Don't try to use ifunc with arm and oabi


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/tests/libexec/ld.elf_so/helper_ifunc_dso/h_helper_ifunc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/libexec/ld.elf_so/helper_ifunc_dso/h_helper_ifunc.c
diff -u src/tests/libexec/ld.elf_so/helper_ifunc_dso/h_helper_ifunc.c:1.8 src/tests/libexec/ld.elf_so/helper_ifunc_dso/h_helper_ifunc.c:1.9
--- src/tests/libexec/ld.elf_so/helper_ifunc_dso/h_helper_ifunc.c:1.8	Tue May  5 16:47:14 2020
+++ src/tests/libexec/ld.elf_so/helper_ifunc_dso/h_helper_ifunc.c	Fri Jun  4 11:37:48 2021
@@ -31,9 +31,9 @@
 #include 
 
 /*
- * Not supported on hppa
+ * Not supported on hppa or on arm with oabi
  */
-#if !defined(__hppa__)
+#if !defined(__hppa__) && !(defined(__arm__) && !defined(__ARM_EABI__))
 
 static long long
 ifunc1(void)



CVS commit: [netbsd-9] src/sys/arch/aarch64/aarch64

2021-06-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun  4 14:00:17 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64 [netbsd-9]: aarch64_machdep.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1278):

sys/arch/aarch64/aarch64/aarch64_machdep.c: revision 1.50
sys/arch/aarch64/aarch64/aarch64_machdep.c: revision 1.60
sys/arch/aarch64/aarch64/aarch64_machdep.c: revision 1.61

G/C

 -

More debug

 -

Two fixes for loading free pages into UVM

- Only consider a boot_physmem (inner loop) range that has its end
   (bp_end) after the bootconfig.dram (outer loop) range start (start).
   This was harmless as a later condition correctly checks there is only
   something to do if start < bp_end.

- Stop processing boot_physmem ranges if all the bootconfig.dram range has
   been passed to UVM.  This fixes a boot problem for simon@


To generate a diff of this commit:
cvs rdiff -u -r1.28.4.3 -r1.28.4.4 \
src/sys/arch/aarch64/aarch64/aarch64_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.28.4.3 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.28.4.4
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.28.4.3	Wed Feb 12 20:10:09 2020
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Fri Jun  4 14:00:17 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.28.4.3 2020/02/12 20:10:09 martin Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.28.4.4 2021/06/04 14:00:17 martin Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.28.4.3 2020/02/12 20:10:09 martin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.28.4.4 2021/06/04 14:00:17 martin Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -275,7 +275,7 @@ initarm_common(vaddr_t kvm_base, vsize_t
 	vaddr_t kernstart, kernend;
 	vaddr_t kernstart_l2 __unused, kernend_l2;	/* L2 table 2MB aligned */
 	vaddr_t kernelvmstart;
-	int i;
+	size_t i;
 
 	cputype = cpu_idnum();	/* for compatible arm */
 
@@ -398,17 +398,24 @@ initarm_common(vaddr_t kvm_base, vsize_t
 		end = start + bootconfig.dram[i].pages;
 
 		int vm_freelist = VM_FREELIST_DEFAULT;
+
+		VPRINTF("block %2zu start %08lx  end %08lx\n", i, ptoa(start),
+		ptoa(end));
+
 		/*
 		 * This assumes the bp list is sorted in ascending
 		 * order.
 		 */
 		paddr_t segend = end;
-		for (size_t j = 0; j < nbp; j++ /*, start = segend, segend = end */) {
+		for (size_t j = 0; j < nbp && start < end; j++) {
 			paddr_t bp_start = bp[j].bp_start;
 			paddr_t bp_end = bp_start + bp[j].bp_pages;
 
+			VPRINTF("   bp %2zu start %08lx  end %08lx\n",
+			j, ptoa(bp_start), ptoa(bp_end));
+
 			KASSERT(bp_start < bp_end);
-			if (start > bp_end || segend < bp_start)
+			if (start >= bp_end || segend < bp_start)
 continue;
 
 			if (start < bp_start)
@@ -420,8 +427,13 @@ initarm_common(vaddr_t kvm_base, vsize_t
 }
 vm_freelist = bp[j].bp_freelist;
 
+VPRINTF(" start %08lx  end %08lx"
+"... loading in freelist %d\n", ptoa(start),
+ptoa(segend), vm_freelist);
+
 uvm_page_physload(start, segend, start, segend,
 vm_freelist);
+
 memsize_total += ptoa(segend - start);
 start = segend;
 segend = end;



CVS commit: src/share/man/man8

2021-06-04 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Jun  4 12:43:14 UTC 2021

Modified Files:
src/share/man/man8: afterboot.8

Log Message:
actually, an anchor is needed so the period is appended


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/share/man/man8/afterboot.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man8/afterboot.8
diff -u src/share/man/man8/afterboot.8:1.81 src/share/man/man8/afterboot.8:1.82
--- src/share/man/man8/afterboot.8:1.81	Fri Jun  4 12:29:33 2021
+++ src/share/man/man8/afterboot.8	Fri Jun  4 12:43:14 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: afterboot.8,v 1.81 2021/06/04 12:29:33 nia Exp $
+.\"	$NetBSD: afterboot.8,v 1.82 2021/06/04 12:43:14 nia Exp $
 .\"	$OpenBSD: afterboot.8,v 1.72 2002/02/22 02:02:33 miod Exp $
 .\"
 .\" Originally created by Marshall M. Midden -- 1997-10-20, m...@umn.edu
@@ -179,7 +179,7 @@ variable found in
 contains more information about this file.
 .Ss Security alerts
 All significant and easily fixed problems will be reported at
-.Lk http://www.NetBSD.org/support/security/
+.Lk https://www.NetBSD.org/support/security/ the security advisories web page .
 It is recommended that you check this page regularly.
 .Pp
 Additionally, you should set



CVS commit: src/share/man/man8

2021-06-04 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Jun  4 12:29:33 UTC 2021

Modified Files:
src/share/man/man8: afterboot.8

Log Message:
remove empty anchor text


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/share/man/man8/afterboot.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man8/afterboot.8
diff -u src/share/man/man8/afterboot.8:1.80 src/share/man/man8/afterboot.8:1.81
--- src/share/man/man8/afterboot.8:1.80	Fri Jun  4 12:12:02 2021
+++ src/share/man/man8/afterboot.8	Fri Jun  4 12:29:33 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: afterboot.8,v 1.80 2021/06/04 12:12:02 nia Exp $
+.\"	$NetBSD: afterboot.8,v 1.81 2021/06/04 12:29:33 nia Exp $
 .\"	$OpenBSD: afterboot.8,v 1.72 2002/02/22 02:02:33 miod Exp $
 .\"
 .\" Originally created by Marshall M. Midden -- 1997-10-20, m...@umn.edu
@@ -179,7 +179,7 @@ variable found in
 contains more information about this file.
 .Ss Security alerts
 All significant and easily fixed problems will be reported at
-.Lk http://www.NetBSD.org/support/security/ .
+.Lk http://www.NetBSD.org/support/security/
 It is recommended that you check this page regularly.
 .Pp
 Additionally, you should set



CVS commit: src/share/man/man8

2021-06-04 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Jun  4 12:12:02 UTC 2021

Modified Files:
src/share/man/man8: afterboot.8

Log Message:
re-order initial sections in the order a user is likely to be able
to address them. add a section on NPF. attempt to make various things
easier to find.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/share/man/man8/afterboot.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man8/afterboot.8
diff -u src/share/man/man8/afterboot.8:1.79 src/share/man/man8/afterboot.8:1.80
--- src/share/man/man8/afterboot.8:1.79	Fri Jun  4 11:56:47 2021
+++ src/share/man/man8/afterboot.8	Fri Jun  4 12:12:02 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: afterboot.8,v 1.79 2021/06/04 11:56:47 wiz Exp $
+.\"	$NetBSD: afterboot.8,v 1.80 2021/06/04 12:12:02 nia Exp $
 .\"	$OpenBSD: afterboot.8,v 1.72 2002/02/22 02:02:33 miod Exp $
 .\"
 .\" Originally created by Marshall M. Midden -- 1997-10-20, m...@umn.edu
@@ -88,46 +88,6 @@ command, type:
 Administrators will rapidly become more familiar with
 .Nx
 if they get used to using the manual pages.
-.Ss Security alerts
-By the time that you have installed your system, it is quite likely that
-bugs in the release have been found.
-All significant and easily fixed problems will be reported at
-.Lk http://www.NetBSD.org/support/security/ .
-It is recommended that you check this page regularly.
-.Pp
-Additionally, you should set
-.Dq fetch_pkg_vulnerabilities=YES
-in
-.Pa /etc/daily.conf
-to allow your system to automatically update the local database of known
-vulnerable packages to the latest version available on-line.
-The system will later check, on a daily basis, if any of your installed
-packages are vulnerable based on the contents of this database.
-See
-.Xr daily.conf 5
-and
-.Xr security.conf 5
-for more details.
-.Ss Entropy
-If your machine does not have a hardware random number generator, it
-may not be safe to use on the internet until it has enough entropy to
-generate unpredictable secrets for programs like web browsers and
-.Xr ssh 1 .
-You can use
-.Xr rndctl 8
-to list the entropy sources with
-.Ic rndctl -l ,
-or save entropy from another machine running
-.Nx
-with
-.Ic rndctl -S
-and load it on this one with
-.Ic rndctl -L
-(as long as there are no eavesdroppers on the medium between the two
-machines).
-See
-.Xr entropy 7
-for more details.
 .Ss Login
 On a fresh install with no other user accounts, login as
 .Dq Ic root .
@@ -217,6 +177,44 @@ variable found in
 .Pp
 .Xr wscons.conf 5
 contains more information about this file.
+.Ss Security alerts
+All significant and easily fixed problems will be reported at
+.Lk http://www.NetBSD.org/support/security/ .
+It is recommended that you check this page regularly.
+.Pp
+Additionally, you should set
+.Dq fetch_pkg_vulnerabilities=YES
+in
+.Pa /etc/daily.conf
+to allow your system to automatically update the local database of known
+vulnerable packages to the latest version available on-line.
+The system will later check, on a daily basis, if any of your installed
+packages are vulnerable based on the contents of this database.
+See
+.Xr daily.conf 5
+and
+.Xr security.conf 5
+for more details.
+.Ss Entropy
+If your machine does not have a hardware random number generator, it
+may not be safe to use on the internet until it has enough entropy to
+generate unpredictable secrets for programs like web browsers and
+.Xr ssh 1 .
+You can use
+.Xr rndctl 8
+to list the entropy sources with
+.Ic rndctl -l ,
+or save entropy from another machine running
+.Nx
+with
+.Ic rndctl -S
+and load it on this one with
+.Ic rndctl -L
+(as long as there are no eavesdroppers on the medium between the two
+machines).
+See
+.Xr entropy 7
+for more details.
 .Ss Check hostname
 Use the
 .Ic hostname
@@ -260,9 +258,8 @@ and then using
 to manually configure it
 if you do not wish to reboot.
 .Pp
-Alternatively, you can configure interfaces automatically via DHCP with
-.Xr dhcpcd 8
-if you have a DHCP server running somewhere on your network.
+Alternatively, many networks allow interfaces to be configured
+automatically via DHCP.
 To get
 .Xr dhcpcd 8
 to start automatically on boot,
@@ -276,6 +273,8 @@ See
 and
 .Xr dhcpcd.conf 5
 for more information on setting up a DHCP client.
+For information on setting up Wi-Fi, see
+.Sx Wireless networking .
 .Pp
 You can add new
 .Dq virtual interfaces
@@ -436,6 +435,12 @@ and either rebooting or running the foll
 .Ic service mdnsd start
 .Ed
 .Pp
+You may also wish to enable mdnsd as a source for host lookups
+in
+.Pa /etc/nsswitch.conf ,
+see
+.Xr nsswitch.conf 5 .
+.Pp
 If your network does not have a usable DNS resolver, e.g. one provided
 by DHCP, you can run a local caching recursive resolver by setting
 .Dq named=YES
@@ -513,7 +518,7 @@ you will need to have this line in
 .Pa /etc/rc.conf :
 .Pp
 .Dl rpcbind=YES
-.Ss YP (NIS) Setup
+.Ss 

CVS commit: src/share/man/man8

2021-06-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun  4 11:56:47 UTC 2021

Modified Files:
src/share/man/man8: afterboot.8

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/share/man/man8/afterboot.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man8/afterboot.8
diff -u src/share/man/man8/afterboot.8:1.78 src/share/man/man8/afterboot.8:1.79
--- src/share/man/man8/afterboot.8:1.78	Fri Jun  4 11:48:18 2021
+++ src/share/man/man8/afterboot.8	Fri Jun  4 11:56:47 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: afterboot.8,v 1.78 2021/06/04 11:48:18 nia Exp $
+.\"	$NetBSD: afterboot.8,v 1.79 2021/06/04 11:56:47 wiz Exp $
 .\"	$OpenBSD: afterboot.8,v 1.72 2002/02/22 02:02:33 miod Exp $
 .\"
 .\" Originally created by Marshall M. Midden -- 1997-10-20, m...@umn.edu
@@ -633,7 +633,7 @@ See
 and
 .Xr timed 8
 for more information on setting the system's date.
-.Ss Insalling packages
+.Ss Installing packages
 The
 .Nx
 packages collection, pkgsrc, includes a large set of third-party software.



CVS commit: src/sbin/mount

2021-06-04 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Fri Jun  4 11:55:45 UTC 2021

Modified Files:
src/sbin/mount: mount.8 mount.c

Log Message:
Remove the warning about autoselecting nfs based on : or @.

Ok jmcneill@, mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sbin/mount/mount.8
cvs rdiff -u -r1.103 -r1.104 src/sbin/mount/mount.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/mount/mount.8
diff -u src/sbin/mount/mount.8:1.88 src/sbin/mount/mount.8:1.89
--- src/sbin/mount/mount.8:1.88	Sat Oct 24 10:51:34 2020
+++ src/sbin/mount/mount.8	Fri Jun  4 11:55:45 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mount.8,v 1.88 2020/10/24 10:51:34 nia Exp $
+.\"	$NetBSD: mount.8,v 1.89 2021/06/04 11:55:45 simonb Exp $
 .\"
 .\" Copyright (c) 1980, 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)mount.8	8.8 (Berkeley) 6/16/94
 .\"
-.Dd October 24, 2020
+.Dd June 4, 2021
 .Dt MOUNT 8
 .Os
 .Sh NAME
@@ -137,10 +137,7 @@ or at sign
 .Pq Ql \&@ ,
 then the
 .Li nfs
-type is inferred, but this behaviour is deprecated, and will be
-removed in a future version of
-.Nm .
-.Pp
+type is inferred.
 In
 .Nx ,
 the file-system mounting policy is dictated by the running security models.

Index: src/sbin/mount/mount.c
diff -u src/sbin/mount/mount.c:1.103 src/sbin/mount/mount.c:1.104
--- src/sbin/mount/mount.c:1.103	Sun Oct 18 10:57:30 2020
+++ src/sbin/mount/mount.c	Fri Jun  4 11:55:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.c,v 1.103 2020/10/18 10:57:30 mlelstv Exp $	*/
+/*	$NetBSD: mount.c,v 1.104 2021/06/04 11:55:45 simonb Exp $	*/
 
 /*
  * Copyright (c) 1980, 1989, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)mount.c	8.25 (Berkeley) 5/8/95";
 #else
-__RCSID("$NetBSD: mount.c,v 1.103 2020/10/18 10:57:30 mlelstv Exp $");
+__RCSID("$NetBSD: mount.c,v 1.104 2021/06/04 11:55:45 simonb Exp $");
 #endif
 #endif /* not lint */
 
@@ -294,11 +294,6 @@ out:
 			err(EXIT_FAILURE, "%s", buf);
 		if (vfslist == NULL) {
 			if (strpbrk(argv[0], ":@") != NULL) {
-fprintf(stderr, "WARNING: autoselecting nfs "
-"based on : or @ in the device name is "
-"deprecated!\n"
-"WARNING: This behaviour will be removed "
-"in a future release\n");
 vfstype = "nfs";
 			} else {
 vfstype = getfslab(mntfromname);



CVS commit: src/share/man/man8

2021-06-04 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Jun  4 11:48:18 UTC 2021

Modified Files:
src/share/man/man8: afterboot.8

Log Message:
adjust layout of afterboot(8) to make things easier to find


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/share/man/man8/afterboot.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man8/afterboot.8
diff -u src/share/man/man8/afterboot.8:1.77 src/share/man/man8/afterboot.8:1.78
--- src/share/man/man8/afterboot.8:1.77	Fri Jun  4 11:33:18 2021
+++ src/share/man/man8/afterboot.8	Fri Jun  4 11:48:18 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: afterboot.8,v 1.77 2021/06/04 11:33:18 nia Exp $
+.\"	$NetBSD: afterboot.8,v 1.78 2021/06/04 11:48:18 nia Exp $
 .\"	$OpenBSD: afterboot.8,v 1.72 2002/02/22 02:02:33 miod Exp $
 .\"
 .\" Originally created by Marshall M. Midden -- 1997-10-20, m...@umn.edu
@@ -160,8 +160,11 @@ user, add said user to the
 .Dq wheel
 group, then use the
 .Xr su 1
-command when root privileges are required.
-This process is described in more detail later.
+command when root privileges are required:
+.Bd -literal -offset indent
+.Ic useradd -G wheel -m myuser
+.Ic passwd myuser
+.Ed
 .Ss Root password
 Change the password for the root user.
 (Note that throughout the documentation, the term
@@ -207,7 +210,7 @@ Set the time zone to Eastern Europe Summ
 .Ss Console settings
 One of the first things you will likely need to do is to set up your
 keyboard map (and maybe some other aspects about the system console).
-To change your keyboard encoding, edit the
+To change your keyboard layout, edit the
 .Dq Va encoding
 variable found in
 .Pa /etc/wscons.conf .
@@ -422,7 +425,9 @@ first, and then the DNS resolver specifi
 .Pa /etc/resolv.conf .
 .Pp
 Multicast DNS and DNS Service Discovery are usually not enabled by
-default on a fresh NetBSD system, and can be enabled by setting
+default on a fresh
+.Nx
+system, and can be enabled by setting
 .Dq mdnsd=YES
 in
 .Pa /etc/rc.conf ,
@@ -610,36 +615,6 @@ Refer to the above example and
 for information on the format of this file.
 .Pp
 You may wish to do NFS mounts now too, or you can do them later.
-.Ss Concatenated disks (ccd)
-If you are using
-.Xr ccd 4
-concatenated disks, edit
-.Pa /etc/ccd.conf .
-You may wish to take a look to
-.Xr ccdconfig 8
-for more information about this file.
-Use the
-.Ic ccdconfig -U
-command to unload and the
-.Ic ccdconfig -C
-command to create tables internal to the kernel for the concatenated disks.
-You then
-.Xr mount 8 ,
-.Xr umount 8 ,
-and edit
-.Pa /etc/fstab
-as needed.
-.Ss Automounter daemon (AMD)
-To use the
-.Xr amd 8
-automounter, create the
-.Pa /etc/amd
-directory, copy example config files from
-.Pa /usr/share/examples/amd
-to
-.Pa /etc/amd
-and customize them as needed.
-Alternatively, you can get your maps with YP.
 .Ss Clock synchronization
 In order to make sure the system clock is synchronized
 to that of a publicly accessible NTP server,
@@ -658,6 +633,30 @@ See
 and
 .Xr timed 8
 for more information on setting the system's date.
+.Ss Insalling packages
+The
+.Nx
+packages collection, pkgsrc, includes a large set of third-party software.
+A lot of it is available as binary packages that you can download from
+.Lk https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/
+or a mirror.
+.Pp
+For most users, using pkgin to manage binary packages is recommended.
+.Pp
+To install pkgin, if it was not done by the installer:
+.Bd -literal -offset indent
+.Ic PKG_PATH=https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/[...]
+.Ic export PKG_PATH
+.Ic pkg_add pkgin
+.Ic pkgin update
+.Ic pkgin install bash mpg123 fluxbox ...
+.Ed
+.Pp
+See
+.Lk https://www.pkgsrc.org/
+and
+.Pa pkgsrc/doc/pkgsrc.txt
+for more details.
 .Sh CHANGING /etc FILES
 The system should be usable now, but you may wish to do more customizing,
 such as adding users, etc.
@@ -747,6 +746,36 @@ directly, edit only
 See
 .Xr rc.conf 5
 for further information.
+.Ss Automounter daemon (AMD)
+To use the
+.Xr amd 8
+automounter, create the
+.Pa /etc/amd
+directory, copy example config files from
+.Pa /usr/share/examples/amd
+to
+.Pa /etc/amd
+and customize them as needed.
+Alternatively, you can get your maps with YP.
+.Ss Concatenated disks (ccd)
+If you are using
+.Xr ccd 4
+concatenated disks, edit
+.Pa /etc/ccd.conf .
+You may wish to take a look to
+.Xr ccdconfig 8
+for more information about this file.
+Use the
+.Ic ccdconfig -U
+command to unload and the
+.Ic ccdconfig -C
+command to create tables internal to the kernel for the concatenated disks.
+You then
+.Xr mount 8 ,
+.Xr umount 8 ,
+and edit
+.Pa /etc/fstab
+as needed.
 .Ss X Display Manager
 If you've installed X, you may want to turn on
 .Xr xdm 1 ,
@@ -933,46 +962,14 @@ Use
 and
 .Xr chown 8
 as needed.
-.Ss Packages
-Install your own packages.
-The
-.Nx
-packages collection, pkgsrc, includes a large set of 

CVS commit: src/share/man/man8

2021-06-04 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Jun  4 11:33:19 UTC 2021

Modified Files:
src/share/man/man8: afterboot.8

Log Message:
capitalization police, etc


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/share/man/man8/afterboot.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man8/afterboot.8
diff -u src/share/man/man8/afterboot.8:1.76 src/share/man/man8/afterboot.8:1.77
--- src/share/man/man8/afterboot.8:1.76	Sun Jan 10 23:24:26 2021
+++ src/share/man/man8/afterboot.8	Fri Jun  4 11:33:18 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: afterboot.8,v 1.76 2021/01/10 23:24:26 riastradh Exp $
+.\"	$NetBSD: afterboot.8,v 1.77 2021/06/04 11:33:18 nia Exp $
 .\"	$OpenBSD: afterboot.8,v 1.72 2002/02/22 02:02:33 miod Exp $
 .\"
 .\" Originally created by Marshall M. Midden -- 1997-10-20, m...@umn.edu
@@ -59,7 +59,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 5, 2020
+.Dd June 4, 2021
 .Dt AFTERBOOT 8
 .Os
 .Sh NAME
@@ -451,7 +451,7 @@ Then, to make the system use it, put the
 nameserver 127.0.0.1
 .Ed
 .Ss Wireless networking
-To configure the system to connect to a wireless network with a password
+To configure the system to connect to a Wi-Fi network with a password
 using WPA:
 .Bd -literal -offset indent
 .Ic wpa_passphrase networkname password >> /etc/wpa_supplicant.conf
@@ -939,21 +939,22 @@ The
 .Nx
 packages collection, pkgsrc, includes a large set of third-party software.
 A lot of it is available as binary packages that you can download from
-.Lk https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/
+.Lk https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/
 or a mirror.
 .Pp
 For most users, using pkgin to manage binary packages is recommended.
 .Pp
 To install pkgin, if it was not done by the installer:
 .Bd -literal -offset indent
-.Ic export PKG_PATH=https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r | cut -d_ -f1)/All
+.Ic PKG_PATH=https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/[...]
+.Ic export PKG_PATH
 .Ic pkg_add pkgin
 .Ic pkgin update
 .Ic pkgin install bash mpg123 fluxbox ...
 .Ed
 .Pp
 See
-.Lk https://www.NetBSD.org/docs/pkgsrc/
+.Lk https://www.pkgsrc.org/
 and
 .Pa pkgsrc/doc/pkgsrc.txt
 for more details.



CVS commit: src/games/fortune/datfiles

2021-06-04 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Jun  4 11:18:31 UTC 2021

Modified Files:
src/games/fortune/datfiles: netbsd-tips

Log Message:
SIGINFO is a useful tip


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/games/fortune/datfiles/netbsd-tips

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/fortune/datfiles/netbsd-tips
diff -u src/games/fortune/datfiles/netbsd-tips:1.9 src/games/fortune/datfiles/netbsd-tips:1.10
--- src/games/fortune/datfiles/netbsd-tips:1.9	Fri Jun  4 10:56:55 2021
+++ src/games/fortune/datfiles/netbsd-tips	Fri Jun  4 11:18:31 2021
@@ -159,3 +159,6 @@ on its extension.  For example, to extra
 You can use progress(1) to monitor the progress of data in a pipe:
 
 	zcat example.tar.gz | progress tar xf -
+%
+Press CTRL+T to send SIGINFO and see the current status of the
+command running in the current terminal.



CVS commit: src/games/fortune/datfiles

2021-06-04 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Jun  4 10:56:55 UTC 2021

Modified Files:
src/games/fortune/datfiles: netbsd-tips

Log Message:
add some tips


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/games/fortune/datfiles/netbsd-tips

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/fortune/datfiles/netbsd-tips
diff -u src/games/fortune/datfiles/netbsd-tips:1.8 src/games/fortune/datfiles/netbsd-tips:1.9
--- src/games/fortune/datfiles/netbsd-tips:1.8	Sun Jun  7 15:41:03 2020
+++ src/games/fortune/datfiles/netbsd-tips	Fri Jun  4 10:56:55 2021
@@ -141,3 +141,21 @@ To do so:
   cd /usr/tests
   atf-run | atf-report
 %
+To share files from your NetBSD system, you can use the built-in
+httpd(8).  Uncomment the 'http' lines in /etc/inetd.conf, reload inetd
+with service(8), and then any files in /var/www will be published to
+http://127.0.0.1/.
+%
+You can schedule simple periodic tasks for your NetBSD system to run
+without using cron(8) by editing the sh(1) scripts /etc/daily.local,
+/etc/weekly.local, and /etc/monthly.local.
+%
+NetBSD's tar(1) command can handle a wide range of file types, e.g.
+zip, 7z, and rar, and will autodetect the type of the file based
+on its extension.  For example, to extract a zip file:
+
+	tar xvf example.zip
+%
+You can use progress(1) to monitor the progress of data in a pipe:
+
+	zcat example.tar.gz | progress tar xf -



CVS commit: src/tests/fs/nfs

2021-06-04 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Jun  4 10:48:07 UTC 2021

Modified Files:
src/tests/fs/nfs: t_mountd.c

Log Message:
Test "mountdhup" has to pass now.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/nfs/t_mountd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/nfs/t_mountd.c
diff -u src/tests/fs/nfs/t_mountd.c:1.7 src/tests/fs/nfs/t_mountd.c:1.8
--- src/tests/fs/nfs/t_mountd.c:1.7	Tue Jul 16 17:29:17 2019
+++ src/tests/fs/nfs/t_mountd.c	Fri Jun  4 10:48:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_mountd.c,v 1.7 2019/07/16 17:29:17 martin Exp $	*/
+/*	$NetBSD: t_mountd.c,v 1.8 2021/06/04 10:48:07 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -105,11 +105,8 @@ ATF_TC_BODY(mountdhup, tc)
 
 	FSTEST_DESTRUCTOR(tc, nfs, voidargs);
 
-	atf_tc_expect_fail("PR kern/5844");
 	if (fail)
 		atf_tc_fail("op failed with EACCES");
-	else
-		atf_tc_fail("race did not trigger this time");
 }
 
 ATF_TP_ADD_TCS(tp)



CVS commit: src/usr.sbin/mountd

2021-06-04 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Jun  4 10:46:57 UTC 2021

Modified Files:
src/usr.sbin/mountd: mountd.c

Log Message:
Change get_exportlist() to collect all exports and emit all
exports for a single mount in one call to nfssvc(2).

Should finally fix PR kern/5844 (NFS server sends "permission denied"
while mound re-read exports).


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/usr.sbin/mountd/mountd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/mountd/mountd.c
diff -u src/usr.sbin/mountd/mountd.c:1.135 src/usr.sbin/mountd/mountd.c:1.136
--- src/usr.sbin/mountd/mountd.c:1.135	Fri Jun  4 10:46:01 2021
+++ src/usr.sbin/mountd/mountd.c	Fri Jun  4 10:46:57 2021
@@ -1,4 +1,4 @@
-/* 	$NetBSD: mountd.c,v 1.135 2021/06/04 10:46:01 hannken Exp $	 */
+/* 	$NetBSD: mountd.c,v 1.136 2021/06/04 10:46:57 hannken Exp $	 */
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)mountd.c  8.15 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: mountd.c,v 1.135 2021/06/04 10:46:01 hannken Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.136 2021/06/04 10:46:57 hannken Exp $");
 #endif
 #endif/* not lint */
 
@@ -235,6 +235,8 @@ static struct uucred def_anon = {
 	0,
 	{ 0 }
 };
+static struct mountd_exports_list *mel_tab;
+static int mel_tab_len;
 
 int  opt_flags;
 static int	have_v6 = 1;
@@ -1207,6 +1209,18 @@ nextline:
 }
 
 /*
+ * Compare two export lists by path.
+ */
+static int
+mel_compare(const void *a, const void *b)
+{
+	const struct mountd_exports_list *mela = a;
+	const struct mountd_exports_list *melb = b;
+
+	return strcmp(mela->mel_path, melb->mel_path);
+}
+
+/*
  * Get the export list
  */
 /* ARGSUSED */
@@ -1216,7 +1230,7 @@ get_exportlist(int n)
 	struct exportlist *ep, *ep2;
 	struct grouplist *grp, *tgrp;
 	struct statvfs *fsp;
-	int num, i;
+	int i, j;
 	FILE *exp_file;
 
 
@@ -1243,20 +1257,14 @@ get_exportlist(int n)
 	 * And delete exports that are in the kernel for all local
 	 * file systems.
 	 */
-	num = getmntinfo(, MNT_NOWAIT);
-	for (i = 0; i < num; i++) {
-		struct mountd_exports_list mel;
-
-		/* Delete all entries from the export list. */
-		mel.mel_path = fsp->f_mntonname;
-		mel.mel_nexports = 0;
-		if (nfssvc(NFSSVC_SETEXPORTSLIST, ) == -1 &&
-		errno != EOPNOTSUPP)
-			syslog(LOG_ERR, "Can't delete exports for %s (%m)",
-			fsp->f_mntonname);
-
-		fsp++;
+	mel_tab_len = getmntinfo(, MNT_NOWAIT);
+	mel_tab = ecalloc(mel_tab_len, sizeof(*mel_tab));
+	for (i = 0; i < mel_tab_len; i++) {
+		mel_tab[i].mel_path = estrdup(fsp[i].f_mntonname);
+		mel_tab[i].mel_nexports = 0;
+		mel_tab[i].mel_exports = NULL;
 	}
+	qsort(mel_tab, mel_tab_len, sizeof(mel_tab[0]), mel_compare);
 
 	/*
 	 * Read in the exports file and build the list, calling
@@ -1278,6 +1286,30 @@ get_exportlist(int n)
 
 		(void)fclose(exp_file);
 	}
+
+	for (i = 0; i < mel_tab_len; i++) {
+		struct mountd_exports_list *mel = _tab[i];
+
+		if (nfssvc(NFSSVC_REPLACEEXPORTSLIST, mel) == -1 &&
+		(mel->mel_nexports > 0 || errno != EOPNOTSUPP))
+			syslog(LOG_ERR, "Can't update exports for %s (%m)",
+			mel_tab[i].mel_path);
+		for (j = 0; j < (int)mel_tab->mel_nexports; j++) {
+			struct export_args *export = >mel_exports[j];
+
+			if (export->ex_indexfile)
+free(export->ex_indexfile);
+			if (export->ex_addr)
+free(export->ex_addr);
+			if (export->ex_mask)
+free(export->ex_mask);
+		}
+		if (mel->mel_nexports > 0)
+			free(mel->mel_exports);
+		free(__UNCONST(mel->mel_path));
+	}
+	free(mel_tab);
+	mel_tab_len = 0;
 }
 
 /*
@@ -1923,31 +1955,39 @@ add_export_arg(const char *path, int exf
 struct sockaddr *addrp, int addrlen, struct sockaddr *maskp, int masklen,
 char *indexfile)
 {
-	struct mountd_exports_list mel;
-	struct export_args export;
-	int error;
+	const struct mountd_exports_list mel_key = { .mel_path = path };
+	struct mountd_exports_list *mel;
+	struct export_args *export;
 
 	if (addrp != NULL && addrp->sa_family == AF_INET6 && have_v6 == 0)
 		return 0;
 
-	mel.mel_path = path;
-	mel.mel_nexports = 1;
-	mel.mel_exports = 
-
-	export.ex_flags = exflags;
-	export.ex_anon = *anoncrp;
-	export.ex_indexfile = indexfile;
-	export.ex_addr = addrp;
-	export.ex_addrlen = addrlen;
-	export.ex_mask = maskp;
-	export.ex_masklen = masklen;
-
-	error = nfssvc(NFSSVC_SETEXPORTSLIST, );
-
-	if (error) {
-		syslog(LOG_ERR, "Can't change attributes for %s: %m", path);
+	mel = bsearch(_key, mel_tab, mel_tab_len, sizeof(mel_tab[0]),
+	mel_compare);
+	if (mel == NULL) {
+		syslog(LOG_ERR, "Can't change attributes for %s: not found",
+		path);
 		return 1;
 	}
+	ereallocarr(>mel_exports, mel->mel_nexports + 1,
+	sizeof(*mel->mel_exports));
+	export = >mel_exports[mel->mel_nexports++];
+	memset(export, 0, sizeof(*export));
+
+	export->ex_flags = 

CVS commit: src/sys/arch

2021-06-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun  4 10:46:11 UTC 2021

Modified Files:
src/sys/arch/m68k/conf: std.m68k
src/sys/arch/playstation2/conf: std.playstation2
src/sys/arch/sh3/conf: std.sh3
src/sys/arch/sparc/conf: std.sparc
src/sys/arch/vax/conf: std.vax

Log Message:
Sprinkle a few VMSWAP_DEFAULT_PLAINTEXT for architectures where we do not
have any spare cpu cycles to waste (encrypted swap still could be
enabled by the admin in /etc/sysctl.conf).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/m68k/conf/std.m68k
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/playstation2/conf/std.playstation2
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sh3/conf/std.sh3
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sparc/conf/std.sparc
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/vax/conf/std.vax

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/m68k/conf/std.m68k
diff -u src/sys/arch/m68k/conf/std.m68k:1.1 src/sys/arch/m68k/conf/std.m68k:1.2
--- src/sys/arch/m68k/conf/std.m68k:1.1	Sun Sep 19 02:09:28 2010
+++ src/sys/arch/m68k/conf/std.m68k	Fri Jun  4 10:46:11 2021
@@ -1,4 +1,4 @@
-# $NetBSD: std.m68k,v 1.1 2010/09/19 02:09:28 tsutsui Exp $
+# $NetBSD: std.m68k,v 1.2 2021/06/04 10:46:11 martin Exp $
 #
 # standard, required NetBSD/m68k options
 
@@ -6,3 +6,6 @@ options 	EXEC_ELF32		# exec ELF binaries
 options 	EXEC_SCRIPT		# exec #! scripts
 
 options 	CPU_IN_CKSUM		# use MD optimized cpu_in_cksum()
+
+options		VMSWAP_DEFAULT_PLAINTEXT	# do not encrypt swap by
+	# default (slow cpu)

Index: src/sys/arch/playstation2/conf/std.playstation2
diff -u src/sys/arch/playstation2/conf/std.playstation2:1.11 src/sys/arch/playstation2/conf/std.playstation2:1.12
--- src/sys/arch/playstation2/conf/std.playstation2:1.11	Mon Mar 31 11:43:53 2014
+++ src/sys/arch/playstation2/conf/std.playstation2	Fri Jun  4 10:46:11 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: std.playstation2,v 1.11 2014/03/31 11:43:53 martin Exp $
+#	$NetBSD: std.playstation2,v 1.12 2021/06/04 10:46:11 martin Exp $
 
 machine playstation2 mips
 include		"conf/std"	# MI standard options
@@ -20,3 +20,7 @@ options 	__GP_SUPPORT__
 
 makeoptions	DEFTEXTADDR="0x8001"
 makeoptions	DEFCOPTS="-Os -mmemcpy"
+
+options		VMSWAP_DEFAULT_PLAINTEXT	# do not encrypt swap by
+# default (slow cpu)
+

Index: src/sys/arch/sh3/conf/std.sh3
diff -u src/sys/arch/sh3/conf/std.sh3:1.6 src/sys/arch/sh3/conf/std.sh3:1.7
--- src/sys/arch/sh3/conf/std.sh3:1.6	Sat Feb  2 03:06:04 2008
+++ src/sys/arch/sh3/conf/std.sh3	Fri Jun  4 10:46:11 2021
@@ -1,4 +1,4 @@
-# $NetBSD: std.sh3,v 1.6 2008/02/02 03:06:04 uwe Exp $
+# $NetBSD: std.sh3,v 1.7 2021/06/04 10:46:11 martin Exp $
 #
 # standard, required NetBSD/sh3 'options'
 
@@ -6,3 +6,7 @@ options 	EXEC_ELF32	# exec ELF binaries
 options 	EXEC_SCRIPT	# exec #! scripts
 
 options 	CPU_IN_CKSUM	# use assembler version of cpu_in_cksum()
+
+options		VMSWAP_DEFAULT_PLAINTEXT	# do not encrypt swap by
+# default (slow cpu)
+

Index: src/sys/arch/sparc/conf/std.sparc
diff -u src/sys/arch/sparc/conf/std.sparc:1.23 src/sys/arch/sparc/conf/std.sparc:1.24
--- src/sys/arch/sparc/conf/std.sparc:1.23	Mon Sep 20 10:21:10 2010
+++ src/sys/arch/sparc/conf/std.sparc	Fri Jun  4 10:46:11 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: std.sparc,v 1.23 2010/09/20 10:21:10 tsutsui Exp $
+#	$NetBSD: std.sparc,v 1.24 2021/06/04 10:46:11 martin Exp $
 
 #
 # Mandatory NetBSD/sparc kernel options.
@@ -12,3 +12,7 @@ options 	EXEC_ELF32	# execve(2) support 
 options 	EXEC_SCRIPT	# execve(2) support for scripts
 
 options 	CPU_IN_CKSUM	# use MD optimized cpu_in_cksum()
+
+options		VMSWAP_DEFAULT_PLAINTEXT	# do not encrypt swap by
+# default (slow cpu)
+

Index: src/sys/arch/vax/conf/std.vax
diff -u src/sys/arch/vax/conf/std.vax:1.16 src/sys/arch/vax/conf/std.vax:1.17
--- src/sys/arch/vax/conf/std.vax:1.16	Sun Dec 11 12:19:34 2005
+++ src/sys/arch/vax/conf/std.vax	Fri Jun  4 10:46:11 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: std.vax,v 1.16 2005/12/11 12:19:34 christos Exp $
+#	$NetBSD: std.vax,v 1.17 2021/06/04 10:46:11 martin Exp $
 #
 # Std vaxfiles
 #
@@ -8,3 +8,7 @@ include		"conf/std"	# MI standard option
 options 	EXEC_AOUT	# execve(2) support for a.out binaries
 options 	EXEC_SCRIPT	# execve(2) support for scripts
 options 	EXEC_ELF32	# execve(2) support for ELF32 binaries
+
+options		VMSWAP_DEFAULT_PLAINTEXT	# do not encrypt swap by
+# default (slow cpu)
+



CVS commit: src/usr.sbin/mountd

2021-06-04 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Jun  4 10:46:01 UTC 2021

Modified Files:
src/usr.sbin/mountd: mountd.c

Log Message:
Restructure do_nfssvc() and simplify the left cases GT_HOST and GT_NET.

Add a helper add_export_arg() that emits a single export_args item and
does the IPv6 check.
Always use the path of the mount point for the export.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/usr.sbin/mountd/mountd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/mountd/mountd.c
diff -u src/usr.sbin/mountd/mountd.c:1.134 src/usr.sbin/mountd/mountd.c:1.135
--- src/usr.sbin/mountd/mountd.c:1.134	Tue Feb 16 10:00:27 2021
+++ src/usr.sbin/mountd/mountd.c	Fri Jun  4 10:46:01 2021
@@ -1,4 +1,4 @@
-/* 	$NetBSD: mountd.c,v 1.134 2021/02/16 10:00:27 hannken Exp $	 */
+/* 	$NetBSD: mountd.c,v 1.135 2021/06/04 10:46:01 hannken Exp $	 */
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)mountd.c  8.15 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: mountd.c,v 1.134 2021/02/16 10:00:27 hannken Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.135 2021/06/04 10:46:01 hannken Exp $");
 #endif
 #endif/* not lint */
 
@@ -1918,6 +1918,40 @@ get_ht(void)
 	return (hp);
 }
 
+static int
+add_export_arg(const char *path, int exflags, struct uucred *anoncrp,
+struct sockaddr *addrp, int addrlen, struct sockaddr *maskp, int masklen,
+char *indexfile)
+{
+	struct mountd_exports_list mel;
+	struct export_args export;
+	int error;
+
+	if (addrp != NULL && addrp->sa_family == AF_INET6 && have_v6 == 0)
+		return 0;
+
+	mel.mel_path = path;
+	mel.mel_nexports = 1;
+	mel.mel_exports = 
+
+	export.ex_flags = exflags;
+	export.ex_anon = *anoncrp;
+	export.ex_indexfile = indexfile;
+	export.ex_addr = addrp;
+	export.ex_addrlen = addrlen;
+	export.ex_mask = maskp;
+	export.ex_masklen = masklen;
+
+	error = nfssvc(NFSSVC_SETEXPORTSLIST, );
+
+	if (error) {
+		syslog(LOG_ERR, "Can't change attributes for %s: %m", path);
+		return 1;
+	}
+
+	return 0;
+}
+
 /*
  * Do the nfssvc syscall to push the export info into the kernel.
  */
@@ -1930,92 +1964,37 @@ do_nfssvc(const char *line, size_t linen
 	struct sockaddr_storage ss;
 	struct addrinfo *ai;
 	int addrlen;
-	int done;
-	struct export_args export;
 
-	export.ex_flags = exflags;
-	export.ex_anon = *anoncrp;
-	export.ex_indexfile = ep->ex_indexfile;
 	if (grp->gr_type == GT_HOST) {
-		ai = grp->gr_ptr.gt_addrinfo;
-		addrp = ai->ai_addr;
-		addrlen = ai->ai_addrlen;
-	} else {
-		addrp = NULL;
-		ai = NULL;	/* XXXGCC -Wuninitialized */
-		addrlen = 0;	/* XXXGCC -Wuninitialized */
-	}
-	done = FALSE;
-	while (!done) {
-		struct mountd_exports_list mel;
-
-		switch (grp->gr_type) {
-		case GT_HOST:
-			if (addrp != NULL && addrp->sa_family == AF_INET6 &&
-			have_v6 == 0)
-goto skip;
-			export.ex_addr = addrp;
-			export.ex_addrlen = addrlen;
-			export.ex_masklen = 0;
-			break;
-		case GT_NET:
-			export.ex_addr = (struct sockaddr *)
-			>gr_ptr.gt_net.nt_net;
-			if (export.ex_addr->sa_family == AF_INET6 &&
-			have_v6 == 0)
-goto skip;
-			export.ex_addrlen = export.ex_addr->sa_len;
-			memset(, 0, sizeof ss);
-			ss.ss_family = export.ex_addr->sa_family;
-			ss.ss_len = export.ex_addr->sa_len;
-			if (allones(, grp->gr_ptr.gt_net.nt_len) != 0) {
-syslog(LOG_ERR,
-"\"%s\", line %ld: Bad network flag",
-line, (unsigned long)lineno);
-return (1);
-			}
-			export.ex_mask = (struct sockaddr *)
-			export.ex_masklen = ss.ss_len;
-			break;
-		default:
-			syslog(LOG_ERR, "\"%s\", line %ld: Bad netgroup type",
+		for (ai = grp->gr_ptr.gt_addrinfo; ai; ai = ai->ai_next) {
+			addrp = ai->ai_addr;
+			addrlen = ai->ai_addrlen;
+			if (add_export_arg(fsb->f_mntonname, exflags, anoncrp,
+			addrp, addrlen, NULL, 0, ep->ex_indexfile) != 0)
+return 1;
+		}
+	} else if (grp->gr_type == GT_NET) {
+		addrp = (struct sockaddr *)>gr_ptr.gt_net.nt_net;
+		addrlen = addrp->sa_len;
+		memset(, 0, sizeof ss);
+		ss.ss_family = addrp->sa_family;
+		ss.ss_len = addrp->sa_len;
+		if (allones(, grp->gr_ptr.gt_net.nt_len) != 0) {
+			syslog(LOG_ERR, "\"%s\", line %ld: Bad network flag",
 			line, (unsigned long)lineno);
-			return (1);
-		};
-
-		/*
-		 * XXX:
-		 * Maybe I should just use the fsb->f_mntonname path?
-		 */
-
-		mel.mel_path = dirp;
-		mel.mel_nexports = 1;
-		mel.mel_exports = 
-
-		if (nfssvc(NFSSVC_SETEXPORTSLIST, ) != 0) {
-			syslog(LOG_ERR,
-	"\"%s\", line %ld: Can't change attributes for %s to %s: %m",
-			line, (unsigned long)lineno,
-			dirp, (grp->gr_type == GT_HOST) ?
-			grp->gr_ptr.gt_addrinfo->ai_canonname :
-			(grp->gr_type == GT_NET) ?
-			grp->gr_ptr.gt_net.nt_name :
-			"Unknown");
-			return (1);
+			return 1;
 		}
-skip:
-		if (addrp) {
-			ai = 

CVS commit: src/sys/nfs

2021-06-04 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Jun  4 10:44:59 UTC 2021

Modified Files:
src/sys/nfs: nfs.h nfs_export.c nfs_syscalls.c nfs_var.h

Log Message:
Add flag/command NFSSVC_REPLACEEXPORTSLIST to nfssvc(2) system call.

Works like NFSSVC_SETEXPORTSLIST but supports "mel_nexports > 1"
and will atomically update the complete exports list for a file system.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/nfs/nfs.h
cvs rdiff -u -r1.62 -r1.63 src/sys/nfs/nfs_export.c
cvs rdiff -u -r1.162 -r1.163 src/sys/nfs/nfs_syscalls.c
cvs rdiff -u -r1.94 -r1.95 src/sys/nfs/nfs_var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/nfs/nfs.h
diff -u src/sys/nfs/nfs.h:1.78 src/sys/nfs/nfs.h:1.79
--- src/sys/nfs/nfs.h:1.78	Wed Aug 22 01:05:24 2018
+++ src/sys/nfs/nfs.h	Fri Jun  4 10:44:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs.h,v 1.78 2018/08/22 01:05:24 msaitoh Exp $	*/
+/*	$NetBSD: nfs.h,v 1.79 2021/06/04 10:44:58 hannken Exp $	*/
 /*
  * Copyright (c) 1989, 1993, 1995
  *	The Regents of the University of California.  All rights reserved.
@@ -285,6 +285,7 @@ struct nfsstats {
 #define	NFSSVC_AUTHINFAIL 0x080
 #define	NFSSVC_MNTD	0x100
 #define	NFSSVC_SETEXPORTSLIST	0x200
+#define	NFSSVC_REPLACEEXPORTSLIST	0x400
 
 /*
  * fs.nfs sysctl(3) identifiers

Index: src/sys/nfs/nfs_export.c
diff -u src/sys/nfs/nfs_export.c:1.62 src/sys/nfs/nfs_export.c:1.63
--- src/sys/nfs/nfs_export.c:1.62	Fri Jan 17 20:08:09 2020
+++ src/sys/nfs/nfs_export.c	Fri Jun  4 10:44:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_export.c,v 1.62 2020/01/17 20:08:09 ad Exp $	*/
+/*	$NetBSD: nfs_export.c,v 1.63 2021/06/04 10:44:58 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2008, 2019 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_export.c,v 1.62 2020/01/17 20:08:09 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_export.c,v 1.63 2021/06/04 10:44:58 hannken Exp $");
 
 #include 
 #include 
@@ -233,17 +233,14 @@ netexport_fini(void)
  * Returns zero on success or an appropriate error code otherwise.
  *
  * Helper function for the nfssvc(2) system call (NFSSVC_SETEXPORTSLIST
- * command).
+ * and NFSSVC_REPLACEEXPORTSLIST command).
  */
 int
 mountd_set_exports_list(const struct mountd_exports_list *mel, struct lwp *l,
-struct mount *nmp)
+struct mount *nmp, int cmd)
 {
 	int error;
-#ifdef notyet
-	/* XXX: See below to see the reason why this is disabled. */
 	size_t i;
-#endif
 	struct mount *mp;
 	struct netexport *ne;
 	struct pathbuf *pb;
@@ -302,31 +299,24 @@ mountd_set_exports_list(const struct mou
 	KASSERT(ne != NULL);
 	KASSERT(ne->ne_mount == mp);
 
-	/*
-	 * XXX: The part marked as 'notyet' works fine from the kernel's
-	 * point of view, in the sense that it is able to atomically update
-	 * the complete exports list for a file system.  However, supporting
-	 * this in mountd(8) requires a lot of work; so, for now, keep the
-	 * old behavior of updating a single entry per call.
-	 *
-	 * When mountd(8) is fixed, just remove the second branch of this
-	 * preprocessor conditional and enable the first one.
-	 */
-#ifdef notyet
-	netexport_clear(ne);
-	for (i = 0; error == 0 && i < mel->mel_nexports; i++)
-		error = export(ne, >mel_exports[i]);
-#else
-	if (mel->mel_nexports == 0)
+	if (cmd == NFSSVC_SETEXPORTSLIST) {
+		if (mel->mel_nexports == 0)
+			netexport_clear(ne);
+		else if (mel->mel_nexports == 1)
+			error = export(ne, >mel_exports[0]);
+		else {
+			printf("%s: Cannot set more than one "
+			"entry at once (unimplemented)\n", __func__);
+			error = EOPNOTSUPP;
+		}
+	} else if (cmd == NFSSVC_REPLACEEXPORTSLIST) {
 		netexport_clear(ne);
-	else if (mel->mel_nexports == 1)
-		error = export(ne, >mel_exports[0]);
-	else {
-		printf("%s: Cannot set more than one "
-		"entry at once (unimplemented)\n", __func__);
+		for (i = 0; error == 0 && i < mel->mel_nexports; i++)
+			error = export(ne, >mel_exports[i]);
+	} else {
+		printf("%s: Command %#x not implemented\n", __func__, cmd);
 		error = EOPNOTSUPP;
 	}
-#endif
 
 out:
 	netexport_wrunlock();
@@ -455,7 +445,7 @@ nfs_export_update_30(struct mount *mp, c
 		mel.mel_exports = (void *)>eargs;
 	}
 
-	return mountd_set_exports_list(, curlwp, mp);
+	return mountd_set_exports_list(, curlwp, mp, NFSSVC_SETEXPORTSLIST);
 }
 
 /*

Index: src/sys/nfs/nfs_syscalls.c
diff -u src/sys/nfs/nfs_syscalls.c:1.162 src/sys/nfs/nfs_syscalls.c:1.163
--- src/sys/nfs/nfs_syscalls.c:1.162	Sat Mar 14 18:08:39 2020
+++ src/sys/nfs/nfs_syscalls.c	Fri Jun  4 10:44:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_syscalls.c,v 1.162 2020/03/14 18:08:39 ad Exp $	*/
+/*	$NetBSD: nfs_syscalls.c,v 1.163 2021/06/04 10:44:58 hannken Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_syscalls.c,v 1.162 2020/03/14 18:08:39 ad Exp $");

CVS commit: src/sys/dev/audio

2021-06-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  4 08:57:05 UTC 2021

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
audio(4): When closing /dev/audioN, drain before removing from list.

Previously, in revision 1.100, I factored the SLIST_REMOVE out of
audio_unlink and audio_close up into audioclose since it is now used
by /dev/audio, /dev/audioctl, and /dev/mixer alike.  But I didn't
realize that the order

1. audio_track_drain
2. SLIST_REMOVE from sc_files

was significant; it matters because audio_track_drain waits for
wakeups that are delivered by hardware interrupts only to files
listed in sc_files.

This also fixes a bug introduced with the audiobell -- it was missing
the SLIST_REMOVE altogether.

For now, duplicate the SLIST_REMOVE calls in a few more places --
this is suboptimal but I want to make sure the logic works before
factoring it all out to tidy up.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/audio/audio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.102 src/sys/dev/audio/audio.c:1.103
--- src/sys/dev/audio/audio.c:1.102	Tue Jun  1 21:27:36 2021
+++ src/sys/dev/audio/audio.c	Fri Jun  4 08:57:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.102 2021/06/01 21:27:36 riastradh Exp $	*/
+/*	$NetBSD: audio.c,v 1.103 2021/06/04 08:57:05 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -138,7 +138,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.102 2021/06/01 21:27:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.103 2021/06/04 08:57:05 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -1747,20 +1747,25 @@ audioclose(struct file *fp)
 	bound = curlwp_bind();
 	sc = audio_sc_acquire_fromfile(file, _ref);
 	if (sc) {
-		mutex_enter(sc->sc_lock);
-		mutex_enter(sc->sc_intr_lock);
-		SLIST_REMOVE(>sc_files, file, audio_file, entry);
-		mutex_exit(sc->sc_intr_lock);
-		mutex_exit(sc->sc_lock);
 		switch (AUDIODEV(dev)) {
 		case SOUND_DEVICE:
 		case AUDIO_DEVICE:
 			error = audio_close(sc, file);
 			break;
 		case AUDIOCTL_DEVICE:
+			mutex_enter(sc->sc_lock);
+			mutex_enter(sc->sc_intr_lock);
+			SLIST_REMOVE(>sc_files, file, audio_file, entry);
+			mutex_exit(sc->sc_intr_lock);
+			mutex_exit(sc->sc_lock);
 			error = 0;
 			break;
 		case MIXER_DEVICE:
+			mutex_enter(sc->sc_lock);
+			mutex_enter(sc->sc_intr_lock);
+			SLIST_REMOVE(>sc_files, file, audio_file, entry);
+			mutex_exit(sc->sc_intr_lock);
+			mutex_exit(sc->sc_lock);
 			error = mixer_close(sc, file);
 			break;
 		default:
@@ -2569,6 +2574,12 @@ audio_close(struct audio_softc *sc, audi
 		mutex_exit(sc->sc_lock);
 	}
 
+	mutex_enter(sc->sc_lock);
+	mutex_enter(sc->sc_intr_lock);
+	SLIST_REMOVE(>sc_files, file, audio_file, entry);
+	mutex_exit(sc->sc_intr_lock);
+	mutex_exit(sc->sc_lock);
+
 	error = audio_exlock_enter(sc);
 	if (error) {
 		/*



CVS commit: src/bin/ps

2021-06-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun  4 08:17:53 UTC 2021

Modified Files:
src/bin/ps: ps.c

Log Message:
Sort options in usage.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/bin/ps/ps.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/ps/ps.c
diff -u src/bin/ps/ps.c:1.94 src/bin/ps/ps.c:1.95
--- src/bin/ps/ps.c:1.94	Fri Jun  4 06:28:42 2021
+++ src/bin/ps/ps.c	Fri Jun  4 08:17:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ps.c,v 1.94 2021/06/04 06:28:42 cjep Exp $	*/
+/*	$NetBSD: ps.c,v 1.95 2021/06/04 08:17:53 wiz Exp $	*/
 
 /*
  * Copyright (c) 2000-2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 19
 #if 0
 static char sccsid[] = "@(#)ps.c	8.4 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: ps.c,v 1.94 2021/06/04 06:28:42 cjep Exp $");
+__RCSID("$NetBSD: ps.c,v 1.95 2021/06/04 08:17:53 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -965,8 +965,8 @@ usage(void)
 
 	(void)fprintf(stderr,
 	"usage:\t%s\n\t   %s\n\t%s\n",
-	"ps [-AaCcdehjlmrSsTuvwx] [-k key] [-M core] [-N system] [-O fmt]",
-	"[-o fmt] [-p pid] [-t tty] [-U user] [-G group] [-W swap]",
+	"ps [-AaCcdehjlmrSsTuvwx] [-G group] [-k key] [-M core] [-N system]",
+	"[-O fmt] [-o fmt] [-p pid] [-t tty] [-U user] [-W swap]",
 	"ps -L");
 	exit(1);
 	/* NOTREACHED */



CVS commit: src/bin/ps

2021-06-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun  4 08:16:14 UTC 2021

Modified Files:
src/bin/ps: ps.1

Log Message:
Sort options in synopsis.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/bin/ps/ps.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/ps/ps.1
diff -u src/bin/ps/ps.1:1.111 src/bin/ps/ps.1:1.112
--- src/bin/ps/ps.1:1.111	Fri Jun  4 06:28:42 2021
+++ src/bin/ps/ps.1	Fri Jun  4 08:16:14 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ps.1,v 1.111 2021/06/04 06:28:42 cjep Exp $
+.\"	$NetBSD: ps.1,v 1.112 2021/06/04 08:16:14 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -38,6 +38,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl AaCcdehjlmrSsTuvwx
+.Op Fl G Ar group
 .Op Fl k Ar key
 .Op Fl M Ar core
 .Op Fl N Ar system
@@ -46,7 +47,6 @@
 .Op Fl p Ar pid
 .Op Fl t Ar tty
 .Op Fl U Ar user
-.Op Fl G Ar group
 .Op Fl W Ar swap
 .Nm
 .Fl L
@@ -719,6 +719,6 @@ Since
 cannot run faster than the system and is run as any other scheduled
 process, the information it displays can never be exact.
 .Pp
-The 
-.Fl G 
+The
+.Fl G
 option should ideally take a list instead of a single group.



CVS commit: src/bin/ps

2021-06-04 Thread Chris Pinnock
Module Name:src
Committed By:   cjep
Date:   Fri Jun  4 06:28:42 UTC 2021

Modified Files:
src/bin/ps: ps.1 ps.c

Log Message:
PR standards/11223

Add -G to take a single group argument heading towards POSIX.2 compliance.
Patch from jperkin and reviewed by simonb.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/bin/ps/ps.1
cvs rdiff -u -r1.93 -r1.94 src/bin/ps/ps.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/ps/ps.1
diff -u src/bin/ps/ps.1:1.110 src/bin/ps/ps.1:1.111
--- src/bin/ps/ps.1:1.110	Tue Aug  6 18:07:51 2019
+++ src/bin/ps/ps.1	Fri Jun  4 06:28:42 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ps.1,v 1.110 2019/08/06 18:07:51 kamil Exp $
+.\"	$NetBSD: ps.1,v 1.111 2021/06/04 06:28:42 cjep Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -46,6 +46,7 @@
 .Op Fl p Ar pid
 .Op Fl t Ar tty
 .Op Fl U Ar user
+.Op Fl G Ar group
 .Op Fl W Ar swap
 .Nm
 .Fl L
@@ -110,6 +111,9 @@ relative to each other.
 Display the environment as well.
 The environment for other
 users' processes can only be displayed by the super-user.
+.It Fl G Ar group
+Display processes belonging to the users belonging to the specified group,
+given either as a group name or a gid.
 .It Fl h
 Repeat the information header as often as necessary to guarantee one
 header per page of information.
@@ -714,3 +718,7 @@ Since
 .Nm
 cannot run faster than the system and is run as any other scheduled
 process, the information it displays can never be exact.
+.Pp
+The 
+.Fl G 
+option should ideally take a list instead of a single group.

Index: src/bin/ps/ps.c
diff -u src/bin/ps/ps.c:1.93 src/bin/ps/ps.c:1.94
--- src/bin/ps/ps.c:1.93	Sun Sep 15 15:27:50 2019
+++ src/bin/ps/ps.c	Fri Jun  4 06:28:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ps.c,v 1.93 2019/09/15 15:27:50 kamil Exp $	*/
+/*	$NetBSD: ps.c,v 1.94 2021/06/04 06:28:42 cjep Exp $	*/
 
 /*
  * Copyright (c) 2000-2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 19
 #if 0
 static char sccsid[] = "@(#)ps.c	8.4 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: ps.c,v 1.93 2019/09/15 15:27:50 kamil Exp $");
+__RCSID("$NetBSD: ps.c,v 1.94 2021/06/04 06:28:42 cjep Exp $");
 #endif
 #endif /* not lint */
 
@@ -86,6 +86,7 @@ __RCSID("$NetBSD: ps.c,v 1.93 2019/09/15
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -104,8 +105,8 @@ __RCSID("$NetBSD: ps.c,v 1.93 2019/09/15
  * ARGOPTS must contain all option characters that take arguments
  * (except for 't'!) - it is used in kludge_oldps_options()
  */
-#define	GETOPTSTR	"aAcCdeghjk:LlM:mN:O:o:p:rSsTt:U:uvW:wx"
-#define	ARGOPTS		"kMNOopUW"
+#define	GETOPTSTR	"aAcCdegG:hjk:LlM:mN:O:o:p:rSsTt:U:uvW:wx"
+#define	ARGOPTS		"GkMNOopUW"
 
 struct varlist displaylist = SIMPLEQ_HEAD_INITIALIZER(displaylist);
 struct varlist sortlist = SIMPLEQ_HEAD_INITIALIZER(sortlist);
@@ -253,6 +254,26 @@ main(int argc, char *argv[])
 			break;
 		case 'g':
 			break;			/* no-op */
+		case 'G':
+			if (*optarg != '\0') {
+struct group *gr;
+char *ep;
+
+what = KERN_PROC_GID;
+gr = getgrnam(optarg);
+if (gr == NULL) {
+	errno = 0;
+	flag = strtoul(optarg, , 10);
+	if (errno)
+		err(1, "%s", optarg);
+	if (*ep != '\0')
+		errx(1, "%s: illegal group",
+			optarg);
+	} else
+		flag = gr->gr_gid;
+			}
+			break;
+
 		case 'h':
 			prtheader = ws.ws_row > 5 ? ws.ws_row : 22;
 			break;
@@ -945,7 +966,7 @@ usage(void)
 	(void)fprintf(stderr,
 	"usage:\t%s\n\t   %s\n\t%s\n",
 	"ps [-AaCcdehjlmrSsTuvwx] [-k key] [-M core] [-N system] [-O fmt]",
-	"[-o fmt] [-p pid] [-t tty] [-U user] [-W swap]",
+	"[-o fmt] [-p pid] [-t tty] [-U user] [-G group] [-W swap]",
 	"ps -L");
 	exit(1);
 	/* NOTREACHED */