CVS commit: src/usr.bin/netstat

2022-12-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Dec 12 05:09:33 UTC 2022

Modified Files:
src/usr.bin/netstat: if.c

Log Message:
Use warn() instead of warnx() and simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/netstat/if.c

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



CVS commit: src/usr.bin/netstat

2022-12-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Dec 12 05:09:33 UTC 2022

Modified Files:
src/usr.bin/netstat: if.c

Log Message:
Use warn() instead of warnx() and simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/netstat/if.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/netstat/if.c
diff -u src/usr.bin/netstat/if.c:1.107 src/usr.bin/netstat/if.c:1.108
--- src/usr.bin/netstat/if.c:1.107	Sat Nov 19 14:42:35 2022
+++ src/usr.bin/netstat/if.c	Mon Dec 12 05:09:33 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.107 2022/11/19 14:42:35 taca Exp $	*/
+/*	$NetBSD: if.c,v 1.108 2022/12/12 05:09:33 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)if.c	8.2 (Berkeley) 2/21/94";
 #else
-__RCSID("$NetBSD: if.c,v 1.107 2022/11/19 14:42:35 taca Exp $");
+__RCSID("$NetBSD: if.c,v 1.108 2022/12/12 05:09:33 msaitoh Exp $");
 #endif
 #endif /* not lint */
 
@@ -182,9 +182,8 @@ if_data_ext_get(const char *ifname, stru
 	snprintf(namebuf, sizeof(namebuf),
 	"net.interfaces.%s.sndq.drops", ifname);
 	len = sizeof(drops);
-	if (sysctlbyname(namebuf, , , NULL, 0)
-	== -1) {
-		warnx("'%s' not found", namebuf);
+	if (sysctlbyname(namebuf, , , NULL, 0) == -1) {
+		warn("%s", namebuf);
 		dext->ifi_oqdrops = 0;
 		return -1;
 	} else



CVS commit: src/sys/arch/ia64

2022-12-11 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Mon Dec 12 01:07:53 UTC 2022

Modified Files:
src/sys/arch/ia64/acpi: madt.c
src/sys/arch/ia64/ia64: mainbus.c

Log Message:
madt.c & mainbus.c: fix build with acpica 20221020

AcpiTbChecksum() was renamed AcpiUtChecksum() during code consolidation.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/acpi/madt.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/ia64/ia64/mainbus.c

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



CVS commit: src/sys/arch/ia64

2022-12-11 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Mon Dec 12 01:07:53 UTC 2022

Modified Files:
src/sys/arch/ia64/acpi: madt.c
src/sys/arch/ia64/ia64: mainbus.c

Log Message:
madt.c & mainbus.c: fix build with acpica 20221020

AcpiTbChecksum() was renamed AcpiUtChecksum() during code consolidation.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/acpi/madt.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/ia64/ia64/mainbus.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/ia64/acpi/madt.c
diff -u src/sys/arch/ia64/acpi/madt.c:1.4 src/sys/arch/ia64/acpi/madt.c:1.5
--- src/sys/arch/ia64/acpi/madt.c:1.4	Mon Apr 29 16:39:58 2019
+++ src/sys/arch/ia64/acpi/madt.c	Mon Dec 12 01:07:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: madt.c,v 1.4 2019/04/29 16:39:58 scole Exp $	*/
+/*	$NetBSD: madt.c,v 1.5 2022/12/12 01:07:52 gutteridge Exp $	*/
 /*-
  * Copyright (c) 2001 Doug Rabson
  * All rights reserved.
@@ -149,7 +149,7 @@ ia64_probe_sapics(void)
 
 		if (strncmp(table->Header.Signature, ACPI_SIG_MADT,
 		ACPI_NAMESEG_SIZE) != 0 ||
-		ACPI_FAILURE(AcpiTbChecksum((void *)table,
+		ACPI_FAILURE(AcpiUtChecksum((void *)table,
 		table->Header.Length)))
 			continue;
 
@@ -243,7 +243,7 @@ ia64_count_cpus(void)
 
 		if (strncmp(table->Header.Signature, ACPI_SIG_MADT,
 		ACPI_NAMESEG_SIZE) != 0 ||
-		ACPI_FAILURE(AcpiTbChecksum((void *)table,
+		ACPI_FAILURE(AcpiUtChecksum((void *)table,
 			table->Header.Length)))
 			continue;
 

Index: src/sys/arch/ia64/ia64/mainbus.c
diff -u src/sys/arch/ia64/ia64/mainbus.c:1.13 src/sys/arch/ia64/ia64/mainbus.c:1.14
--- src/sys/arch/ia64/ia64/mainbus.c:1.13	Sat Aug  7 16:18:56 2021
+++ src/sys/arch/ia64/ia64/mainbus.c	Mon Dec 12 01:07:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.13 2021/08/07 16:18:56 thorpej Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.14 2022/12/12 01:07:52 gutteridge Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.13 2021/08/07 16:18:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.14 2022/12/12 01:07:52 gutteridge Exp $");
 
 #include "acpica.h"
 
@@ -98,7 +98,7 @@ mainbus_attach(device_t parent, device_t
 		if (strncmp(sig, ACPI_SIG_MADT, ACPI_NAMESEG_SIZE) != 0)
 			continue;
 		len = table->Header.Length;
-		if (ACPI_FAILURE(AcpiTbChecksum((void *)table, len)))
+		if (ACPI_FAILURE(AcpiUtChecksum((void *)table, len)))
 			continue;
 
 		end = (char *)table + table->Header.Length;



CVS commit: src/usr.sbin/sysinst

2022-12-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Dec 11 19:32:57 UTC 2022

Modified Files:
src/usr.sbin/sysinst: disklabel.c

Log Message:
When generating a script for disklabel(8) do not use the "pretty printed"
file system type names, but the raw ones that disklabel(8) actually
knows about.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/sysinst/disklabel.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/sysinst/disklabel.c
diff -u src/usr.sbin/sysinst/disklabel.c:1.49 src/usr.sbin/sysinst/disklabel.c:1.50
--- src/usr.sbin/sysinst/disklabel.c:1.49	Fri Jun 24 22:28:11 2022
+++ src/usr.sbin/sysinst/disklabel.c	Sun Dec 11 19:32:57 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.c,v 1.49 2022/06/24 22:28:11 tsutsui Exp $	*/
+/*	$NetBSD: disklabel.c,v 1.50 2022/12/11 19:32:57 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -435,7 +435,7 @@ disklabel_write_to_disk(struct disk_part
 		scripting_fprintf(f, "\t:p%c#%" PRIu32 ":o%c#%" PRIu32
 		":t%c=%s:", 'a'+i, (uint32_t)lp[i].p_size,
 		'a'+i, (uint32_t)lp[i].p_offset, 'a'+i,
-		getfslabelname(lp[i].p_fstype, 0));
+		fstypenames[lp[i].p_fstype]);
 		if (lp[i].p_fstype == FS_BSDLFS ||
 		lp[i].p_fstype == FS_BSDFFS)
 			scripting_fprintf (f, "b%c#%" PRIu32 ":f%c#%" PRIu32



CVS commit: src/usr.sbin/sysinst

2022-12-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Dec 11 19:32:57 UTC 2022

Modified Files:
src/usr.sbin/sysinst: disklabel.c

Log Message:
When generating a script for disklabel(8) do not use the "pretty printed"
file system type names, but the raw ones that disklabel(8) actually
knows about.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/sysinst/disklabel.c

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



CVS commit: src/sys/arch/vax

2022-12-11 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sun Dec 11 18:02:40 UTC 2022

Modified Files:
src/sys/arch/vax/include: cpu.h pcb.h
src/sys/arch/vax/vax: pmap.c trap.c

Log Message:
Support save/restore of AST levels in the PCB for context switching.

Code written by ragge@ , tested by oster@.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/vax/include/cpu.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/vax/include/pcb.h
cvs rdiff -u -r1.194 -r1.195 src/sys/arch/vax/vax/pmap.c
cvs rdiff -u -r1.136 -r1.137 src/sys/arch/vax/vax/trap.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/vax/include/cpu.h
diff -u src/sys/arch/vax/include/cpu.h:1.105 src/sys/arch/vax/include/cpu.h:1.106
--- src/sys/arch/vax/include/cpu.h:1.105	Sat Aug 14 17:51:19 2021
+++ src/sys/arch/vax/include/cpu.h	Sun Dec 11 18:02:40 2022
@@ -1,4 +1,4 @@
-/*  $NetBSD: cpu.h,v 1.105 2021/08/14 17:51:19 ryo Exp $  */
+/*  $NetBSD: cpu.h,v 1.106 2022/12/11 18:02:40 oster Exp $  */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden
@@ -157,9 +157,11 @@ extern int cpu_printfataltraps;
 #define	curlwp			((struct lwp *)mfpr(PR_SSP))
 #define	cpu_number()		(curcpu()->ci_cpuid)
 #define	cpu_need_resched(ci, l, flags)		\
-	do {	\
-		__USE(flags);			\
-		mtpr(AST_OK,PR_ASTLVL);		\
+	do {			\
+		struct pcb *pcb = lwp_getpcb(curlwp);		\
+		__USE(flags);	\
+		pcb->P0LR = (pcb->P0LR & ~AST_MASK) | AST_ON;	\
+		mtpr(AST_OK,PR_ASTLVL);\
 	} while (/*CONSTCOND*/ 0)
 #define	cpu_proc_fork(x, y)	do { } while (/*CONSCOND*/0)
 
@@ -198,7 +200,12 @@ extern char vax_mp_tramp;
  * process as soon as possible.
  */
 
-#define cpu_signotify(l) mtpr(AST_OK,PR_ASTLVL)
+#define cpu_signotify(l)	\
+	do {			\
+		struct pcb *pcb = lwp_getpcb(l);		\
+		pcb->P0LR = (pcb->P0LR & ~AST_MASK) | AST_ON;	\
+		mtpr(AST_OK,PR_ASTLVL);\
+	} while (/*CONSTCOND*/ 0)
 
 
 /*
@@ -206,7 +213,13 @@ extern char vax_mp_tramp;
  * buffer pages are invalid.  On the hp300, request an ast to send us
  * through trap, marking the proc as needing a profiling tick.
  */
-#define cpu_need_proftick(l) do { (l)->l_pflag |= LP_OWEUPC; mtpr(AST_OK,PR_ASTLVL); } while (/*CONSTCOND*/ 0)
+#define cpu_need_proftick(l) 	\
+	do {			\
+		struct pcb *pcb = lwp_getpcb(l);		\
+		(l)->l_pflag |= LP_OWEUPC;			\
+		pcb->P0LR = (pcb->P0LR & ~AST_MASK) | AST_ON;	\
+		mtpr(AST_OK,PR_ASTLVL);\
+	} while (/*CONSTCOND*/ 0)
 
 /*
  * This defines the I/O device register space size in pages.

Index: src/sys/arch/vax/include/pcb.h
diff -u src/sys/arch/vax/include/pcb.h:1.15 src/sys/arch/vax/include/pcb.h:1.16
--- src/sys/arch/vax/include/pcb.h:1.15	Mon May 22 17:12:11 2017
+++ src/sys/arch/vax/include/pcb.h	Sun Dec 11 18:02:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcb.h,v 1.15 2017/05/22 17:12:11 ragge Exp $	*/
+/*	$NetBSD: pcb.h,v 1.16 2022/12/11 18:02:40 oster Exp $	*/
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -49,6 +49,7 @@ struct pcb {
 	long	P0LR;		/*  Page 0 Length Register*/
 	struct	pte *P1BR;	/*  Page 1 Base Register  */
 	long	P1LR;		/*  Page 1 Length Register*/
+	long	ASN;		/*  Address space number  */
 
 	/* Software registers, only used by kernel software */
 	void   *pcb_onfault;	/* Tells whether fault copy */
@@ -58,7 +59,8 @@ struct pcb {
 };
 
 #define	AST_MASK 0x0700
-#define	AST_PCB	 0x0400
+#define	AST_PCB	 0x0400	/* disable AST */
+#define	AST_ON	 0x0300	/* request AST */
 
 /* machine-specific core dump; save trapframe */
 struct	md_coredump {

Index: src/sys/arch/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.194 src/sys/arch/vax/vax/pmap.c:1.195
--- src/sys/arch/vax/vax/pmap.c:1.194	Fri Feb 11 17:26:55 2022
+++ src/sys/arch/vax/vax/pmap.c	Sun Dec 11 18:02:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.194 2022/02/11 17:26:55 riastradh Exp $	   */
+/*	$NetBSD: pmap.c,v 1.195 2022/12/11 18:02:40 oster Exp $	   */
 /*
  * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.194 2022/02/11 17:26:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.195 2022/12/11 18:02:40 oster Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -552,7 +552,7 @@ update_pcbs(struct pmap *pm)
 	for (pcb = pm->pm_pcbs; pcb != NULL; pcb = pcb->pcb_pmnext) {
 		KASSERT(pcb->pcb_pm == pm);
 		pcb->P0BR = pm->pm_p0br;
-		pcb->P0LR = pm->pm_p0lr|AST_PCB;
+		pcb->P0LR = pm->pm_p0lr | (pcb->P0LR & AST_MASK);
 		pcb->P1BR = pm->pm_p1br;
 		pcb->P1LR = pm->pm_p1lr;
 		
@@ -561,7 +561,7 @@ update_pcbs(struct pmap *pm)
 	/* If curlwp uses this pmap update the regs too */ 
 	if (pm == curproc->p_vmspace->vm_map.pmap) {
 		mtpr((uintptr_t)pm->pm_p0br, PR_P0BR);
-		mtpr(pm->pm_p0lr|AST_PCB, PR_P0LR);
+		mtpr(pm->pm_p0lr, 

CVS commit: src/sys/arch/vax

2022-12-11 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sun Dec 11 18:02:40 UTC 2022

Modified Files:
src/sys/arch/vax/include: cpu.h pcb.h
src/sys/arch/vax/vax: pmap.c trap.c

Log Message:
Support save/restore of AST levels in the PCB for context switching.

Code written by ragge@ , tested by oster@.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/vax/include/cpu.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/vax/include/pcb.h
cvs rdiff -u -r1.194 -r1.195 src/sys/arch/vax/vax/pmap.c
cvs rdiff -u -r1.136 -r1.137 src/sys/arch/vax/vax/trap.c

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



CVS commit: src/doc

2022-12-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 11 17:58:43 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Update tzcode to 2022g


To generate a diff of this commit:
cvs rdiff -u -r1.1904 -r1.1905 src/doc/3RDPARTY
cvs rdiff -u -r1.2938 -r1.2939 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1904 src/doc/3RDPARTY:1.1905
--- src/doc/3RDPARTY:1.1904	Sun Dec 11 02:01:55 2022
+++ src/doc/3RDPARTY	Sun Dec 11 12:58:42 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1904 2022/12/11 07:01:55 kre Exp $
+#	$NetBSD: 3RDPARTY,v 1.1905 2022/12/11 17:58:42 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1424,14 +1424,14 @@ Location:	external/bsd/tradcpp
 Notes:
 
 Package:	tz
-Version:	tzcode2022f / tzdata2022ggtz
+Version:	tzcode2022g / tzdata2022ggtz
 Current Vers:	tzcode2022g / tzdata2022g
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/
 Old Archive Site:	ftp://elsie.nci.nih.gov/pub/
 Home Page:	http://www.iana.org/time-zones
-Date:		2022-10-29
+Date:		2022-12-11
 Mailing List:	t...@iana.org
 Responsible:	kleink, christos, kre
 License:	Public domain

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2938 src/doc/CHANGES:1.2939
--- src/doc/CHANGES:1.2938	Sun Dec 11 02:01:56 2022
+++ src/doc/CHANGES	Sun Dec 11 12:58:42 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2938 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2939 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -756,3 +756,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		tprof(8). [msaitoh 20221208]
 	acpi(4): Updated ACPICA to 20221020. [christos 20221210]
 	tzdata: updated to 2022g (using the 2022ggtz fork) [kre 20221211]
+	tzcode: Updated to 2022g. [christos 20221211]



CVS commit: src/doc

2022-12-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 11 17:58:43 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Update tzcode to 2022g


To generate a diff of this commit:
cvs rdiff -u -r1.1904 -r1.1905 src/doc/3RDPARTY
cvs rdiff -u -r1.2938 -r1.2939 src/doc/CHANGES

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



CVS commit: src/lib/libc/time

2022-12-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 11 17:57:23 UTC 2022

Modified Files:
src/lib/libc/time: Makefile NEWS ctime.3 localtime.c private.h
strftime.c theory.html time2posix.3 tzfile.5 tzselect.8 tzset.3
version zdump.8 zdump.c zic.8 zic.c

Log Message:
Merge in 2022g:

Although tzcode still works with C89, bugs found in recent routine
maintenance indicate that bitrot has set in and that in practice
C89 is no longer used to build tzcode.  As it is a maintenance
burden, support for C89 is planned to be removed soon.  Instead,
please use compilers compatible with C99, C11, C17, or C23.

timegm, which tzcode implemented in 1989, will finally be
standardized 34 years later as part of C23, so timegm is now
supported even if STD_INSPIRED is not defined.

Fix bug in zdump's tzalloc emulation on hosts that lack tm_zone.
(Problem reported by Đoàn Trần Công Danh.)

Fix bug in zic on hosts where malloc(0) yields NULL on success.
(Problem reported by Tim McBrayer for AIX 6.1.)

Fix zic configuration to avoid linkage failures on some platforms.
(Problems reported by Gilmore Davidson and Igor Ivanov.)

Work around MS-Windows nmake incompatibility with POSIX.
(Problem reported by Manuela Friedrich.)

Port mktime and strftime to debugging platforms where accessing
uninitialized data has undefined behavior (strftime problem
reported by Robert Elz).

Check more carefully for unlikely integer overflows, preferring
C23  to overflow checking by hand, as the latter has
had obscure bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/time/Makefile
cvs rdiff -u -r1.39 -r1.40 src/lib/libc/time/NEWS
cvs rdiff -u -r1.68 -r1.69 src/lib/libc/time/ctime.3
cvs rdiff -u -r1.135 -r1.136 src/lib/libc/time/localtime.c
cvs rdiff -u -r1.63 -r1.64 src/lib/libc/time/private.h
cvs rdiff -u -r1.50 -r1.51 src/lib/libc/time/strftime.c
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/time/theory.html
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/time/time2posix.3 \
src/lib/libc/time/version
cvs rdiff -u -r1.32 -r1.33 src/lib/libc/time/tzfile.5
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/time/tzselect.8
cvs rdiff -u -r1.44 -r1.45 src/lib/libc/time/tzset.3
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/time/zdump.8
cvs rdiff -u -r1.58 -r1.59 src/lib/libc/time/zdump.c
cvs rdiff -u -r1.40 -r1.41 src/lib/libc/time/zic.8
cvs rdiff -u -r1.85 -r1.86 src/lib/libc/time/zic.c

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

Modified files:

Index: src/lib/libc/time/Makefile
diff -u src/lib/libc/time/Makefile:1.53 src/lib/libc/time/Makefile:1.54
--- src/lib/libc/time/Makefile:1.53	Sat Oct 29 09:55:50 2022
+++ src/lib/libc/time/Makefile	Sun Dec 11 12:57:23 2022
@@ -196,6 +196,7 @@ PACKRATLIST=
 UTF8_LOCALE=	en_US.utf8
 
 # Non-default libraries needed to link.
+# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0.
 LDLIBS=
 
 # Add the following to the end of the "CFLAGS=" line as needed to override
@@ -208,14 +209,18 @@ LDLIBS=
 #	For example, N is 252460800 on AmigaOS.
 #  -DHAVE_DECL_ASCTIME_R=0 if  does not declare asctime_r
 #  -DHAVE_DECL_ENVIRON if  declares 'environ'
+#  -DHAVE_DECL_TIMEGM=0 if  does not declare timegm
 #  -DHAVE_DIRECT_H if mkdir needs  (MS-Windows)
-#  -DHAVE_GENERIC=0 if _Generic does not work
-#  -DHAVE_GETRANDOM if getgrandom works (e.g., GNU/Linux)*
-#  -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)*
+#  -DHAVE_GENERIC=0 if _Generic does not work*
+#  -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux),
+#	-DHAVE_GETRANDOM=0 to avoid using getrandom
+#  -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris),
+#	where LDLIBS also needs to contain -lintl on some hosts;
+#	-DHAVE_GETTEXT=0 to avoid using gettext
 #  -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares
 #	ctime_r and asctime_r incompatibly with the POSIX standard
 #	(Solaris when _POSIX_PTHREAD_SEMANTICS is not defined).
-#  -DHAVE_INTTYPES_H if you have a non-C99 compiler with 
+#  -DHAVE_INTTYPES_H=0 if  does not work*
 #  -DHAVE_LINK=0 if your system lacks a link function
 #  -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
 #  -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
@@ -225,15 +230,17 @@ LDLIBS=
 #	functions like 'link' or variables like 'tzname' required by POSIX
 #  -DHAVE_SETENV=0 if your system lacks the setenv function
 #  -DHAVE_SNPRINTF=0 if your system lacks the snprintf function
-#  -DHAVE_STDINT_H if you have a non-C99 compiler with *
+#  -DHAVE_STDCKDINT_H=0 if neither  nor substitutes like
+#	__builtin_add_overflow work*
+#  -DHAVE_STDINT_H=0 if  does not work*
 #  -DHAVE_STRFTIME_L if  declares locale_t and strftime_l
 #  -DHAVE_STRDUP=0 if your system lacks the strdup function
 #  -DHAVE_STRTOLL=0 if your system lacks the 

CVS commit: src/lib/libc/time

2022-12-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 11 17:57:23 UTC 2022

Modified Files:
src/lib/libc/time: Makefile NEWS ctime.3 localtime.c private.h
strftime.c theory.html time2posix.3 tzfile.5 tzselect.8 tzset.3
version zdump.8 zdump.c zic.8 zic.c

Log Message:
Merge in 2022g:

Although tzcode still works with C89, bugs found in recent routine
maintenance indicate that bitrot has set in and that in practice
C89 is no longer used to build tzcode.  As it is a maintenance
burden, support for C89 is planned to be removed soon.  Instead,
please use compilers compatible with C99, C11, C17, or C23.

timegm, which tzcode implemented in 1989, will finally be
standardized 34 years later as part of C23, so timegm is now
supported even if STD_INSPIRED is not defined.

Fix bug in zdump's tzalloc emulation on hosts that lack tm_zone.
(Problem reported by Đoàn Trần Công Danh.)

Fix bug in zic on hosts where malloc(0) yields NULL on success.
(Problem reported by Tim McBrayer for AIX 6.1.)

Fix zic configuration to avoid linkage failures on some platforms.
(Problems reported by Gilmore Davidson and Igor Ivanov.)

Work around MS-Windows nmake incompatibility with POSIX.
(Problem reported by Manuela Friedrich.)

Port mktime and strftime to debugging platforms where accessing
uninitialized data has undefined behavior (strftime problem
reported by Robert Elz).

Check more carefully for unlikely integer overflows, preferring
C23  to overflow checking by hand, as the latter has
had obscure bugs.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/time/Makefile
cvs rdiff -u -r1.39 -r1.40 src/lib/libc/time/NEWS
cvs rdiff -u -r1.68 -r1.69 src/lib/libc/time/ctime.3
cvs rdiff -u -r1.135 -r1.136 src/lib/libc/time/localtime.c
cvs rdiff -u -r1.63 -r1.64 src/lib/libc/time/private.h
cvs rdiff -u -r1.50 -r1.51 src/lib/libc/time/strftime.c
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/time/theory.html
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/time/time2posix.3 \
src/lib/libc/time/version
cvs rdiff -u -r1.32 -r1.33 src/lib/libc/time/tzfile.5
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/time/tzselect.8
cvs rdiff -u -r1.44 -r1.45 src/lib/libc/time/tzset.3
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/time/zdump.8
cvs rdiff -u -r1.58 -r1.59 src/lib/libc/time/zdump.c
cvs rdiff -u -r1.40 -r1.41 src/lib/libc/time/zic.8
cvs rdiff -u -r1.85 -r1.86 src/lib/libc/time/zic.c

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



CVS commit: src/etc/etc.amd64

2022-12-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Dec 11 17:35:56 UTC 2022

Modified Files:
src/etc/etc.amd64: MAKEDEV.conf

Log Message:
Don't forget pci17


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/etc/etc.amd64/MAKEDEV.conf

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

Modified files:

Index: src/etc/etc.amd64/MAKEDEV.conf
diff -u src/etc/etc.amd64/MAKEDEV.conf:1.34 src/etc/etc.amd64/MAKEDEV.conf:1.35
--- src/etc/etc.amd64/MAKEDEV.conf:1.34	Fri Aug 12 11:15:41 2022
+++ src/etc/etc.amd64/MAKEDEV.conf	Sun Dec 11 17:35:56 2022
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.34 2022/08/12 11:15:41 riastradh Exp $
+# $NetBSD: MAKEDEV.conf,v 1.35 2022/12/11 17:35:56 kre Exp $
 
 # As of 2003-04-17, the "init" case must not create more than 890 entries.
 all_md)
@@ -39,7 +39,7 @@ all_md)
 	makedev agp0
 	makedev pci0 pci1 pci2 pci3 pci4 pci5 pci6 pci7
 	makedev pci8 pci9 pci10 pci11 pci12 pci13 pci14
-	makedev pci15 pci16 pci18 pci19
+	makedev pci15 pci16 pci17 pci18 pci19
 	makedev altq
 	makedev cir0 cir1 irframe0 irframe1
 	makedev kttcp



CVS commit: src/etc/etc.amd64

2022-12-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Dec 11 17:35:56 UTC 2022

Modified Files:
src/etc/etc.amd64: MAKEDEV.conf

Log Message:
Don't forget pci17


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/etc/etc.amd64/MAKEDEV.conf

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



CVS commit: src/sys/fs/autofs

2022-12-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec 11 11:31:55 UTC 2022

Modified Files:
src/sys/fs/autofs: autofs_vnops.c

Log Message:
Use genfs_pathconf for VOP_PATHCONF.
Fixes bin/57103.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/fs/autofs/autofs_vnops.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/fs/autofs/autofs_vnops.c
diff -u src/sys/fs/autofs/autofs_vnops.c:1.7 src/sys/fs/autofs/autofs_vnops.c:1.8
--- src/sys/fs/autofs/autofs_vnops.c:1.7	Tue Jun 29 22:34:06 2021
+++ src/sys/fs/autofs/autofs_vnops.c	Sun Dec 11 11:31:55 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs_vnops.c,v 1.7 2021/06/29 22:34:06 dholland Exp $	*/
+/*	$NetBSD: autofs_vnops.c,v 1.8 2022/12/11 11:31:55 mlelstv Exp $	*/
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
  * Copyright (c) 2016 The DragonFly Project
@@ -34,7 +34,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.7 2021/06/29 22:34:06 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.8 2022/12/11 11:31:55 mlelstv Exp $");
 
 #include "autofs.h"
 
@@ -604,6 +604,7 @@ static const struct vnodeopv_entry_desc 
 	{ _islocked_desc,	genfs_islocked },
 	{ _getpages_desc,	genfs_getpages },
 	{ _putpages_desc,	genfs_putpages },
+	{ _pathconf_desc,	genfs_pathconf },
 	{ NULL, NULL }
 };
 



CVS commit: src/sys/fs/autofs

2022-12-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec 11 11:31:55 UTC 2022

Modified Files:
src/sys/fs/autofs: autofs_vnops.c

Log Message:
Use genfs_pathconf for VOP_PATHCONF.
Fixes bin/57103.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/fs/autofs/autofs_vnops.c

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



CVS commit: src/tests/lib/libpthread

2022-12-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Dec 11 10:02:53 UTC 2022

Modified Files:
src/tests/lib/libpthread: t_condwait.c

Log Message:
This test makes (made) a false assumption about the way that
process scheduling works.   That a process (or in this case,
a thread) is no longer blocked at time T does not mean that it
will resume execution at time T.   The OS is free to devote
resources to other processes/threads instead - all we should
normally be able to expect is that if it is not unblocked before
time T, that it will not start running before then.

In general though, the pthread_cond_*wait() functions don't guarantee
even that - but for this test, the possibility of something else
randomly signalling the condvar isn't believable, so don't worry about
that possibility (but do fail without calling strerror(0) on the off
chance it does happen).

Once we cease testing that the process resumed running before some
particular time, we can stop dealing with qemu timekeeping issues,
it might (seem to) take qemu twice as long as was requested before
the thread resumes, but that's OK - the same thing could happen on
a loaded system for other reasons.

Beyond that, the test also has (had) a race condition.   When using
CLOCK_REALTIME though that clock needed to have advanced to T before
the ETIMEDOUT should happen, there is no guarantee that it will stay >T
(CLOCK_REALTIME is allowed to be reset backwards).   So, only test
that the current time (after ETIMEDOUT) >= T when we're using
CLOCK_MONOTONIC - for CLOCK_REALTIME the time might have stepped
back between when the ETIMEDOUT happened and when the thread
obtains the current clock reading.  For that case, all we can test
is that the ETIMEDOUT actually happens.

With much of what was there now gone, the code can be simplified,
we no longer need to do timespec arithmetic, just one comparison
(simpler to test that Tend >= Tstart+period than Tend-Tstart > period
as we need Tstart+period for the abstime value for the timeout anyway).

Note that this still tests for the issue reported in PR lib/47703
which is where the test came from in the first place.

ps: we seem to be missing pthread_cond_clockwait() which is the same
as pthread_cond_timedwait() except that the clock to use is passed
as a parameter, rather than as an attribute of the condition variable.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libpthread/t_condwait.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/lib/libpthread/t_condwait.c
diff -u src/tests/lib/libpthread/t_condwait.c:1.9 src/tests/lib/libpthread/t_condwait.c:1.10
--- src/tests/lib/libpthread/t_condwait.c:1.9	Sat Apr 16 18:15:22 2022
+++ src/tests/lib/libpthread/t_condwait.c	Sun Dec 11 10:02:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: t_condwait.c,v 1.9 2022/04/16 18:15:22 andvar Exp $ */
+/* $NetBSD: t_condwait.c,v 1.10 2022/12/11 10:02:53 kre Exp $ */
 
 /*
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_condwait.c,v 1.9 2022/04/16 18:15:22 andvar Exp $");
+__RCSID("$NetBSD: t_condwait.c,v 1.10 2022/12/11 10:02:53 kre Exp $");
 
 #include 
 #include 
@@ -50,7 +50,7 @@ static const int debug = 1;
 static void *
 run(void *param)
 {
-	struct timespec ts, to, te, twmin, twmax;
+	struct timespec ts, to, te;
 	clockid_t clck;
 	pthread_condattr_t attr;
 	pthread_cond_t cond;
@@ -78,30 +78,18 @@ run(void *param)
 	case ETIMEDOUT:
 		/* Timeout */
 		ATF_REQUIRE_EQ(clock_gettime(clck, ), 0);
-		timespecsub(, , );
 		if (debug) {
 			printf("timeout: %lld.%09ld sec\n",
 			(long long)te.tv_sec, te.tv_nsec);
+			timespecsub(, , );
 			printf("elapsed: %lld.%09ld sec\n",
 			(long long)to.tv_sec, to.tv_nsec);
 		}
-		twmin.tv_sec = WAITTIME;
-		twmin.tv_nsec = 0;
-		if (isQEMU()) {
-			struct timespec td, t;
-			// td.tv_sec = 0;
-			// td.tv_nsec = 9;
-			t = twmin;
-			// timespecsub(, , );
-			td.tv_sec = 2;
-			td.tv_nsec = 5;
-			timespecadd(, , );
-		} else {
-			twmax = twmin;
-			twmax.tv_sec++;
-		}
-		ATF_REQUIRE(timespeccmp(, , >=));
-		ATF_REQUIRE(timespeccmp(, , <=));
+		if (clck == CLOCK_MONOTONIC)
+			ATF_REQUIRE(timespeccmp(, , >=));
+		break;
+	case 0:
+		atf_tc_fail("pthread_cond_timedwait returned before timeout");
 		break;
 	default:
 		ATF_REQUIRE_MSG(0, "pthread_cond_timedwait: %s", strerror(ret));



CVS commit: src/tests/lib/libpthread

2022-12-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Dec 11 10:02:53 UTC 2022

Modified Files:
src/tests/lib/libpthread: t_condwait.c

Log Message:
This test makes (made) a false assumption about the way that
process scheduling works.   That a process (or in this case,
a thread) is no longer blocked at time T does not mean that it
will resume execution at time T.   The OS is free to devote
resources to other processes/threads instead - all we should
normally be able to expect is that if it is not unblocked before
time T, that it will not start running before then.

In general though, the pthread_cond_*wait() functions don't guarantee
even that - but for this test, the possibility of something else
randomly signalling the condvar isn't believable, so don't worry about
that possibility (but do fail without calling strerror(0) on the off
chance it does happen).

Once we cease testing that the process resumed running before some
particular time, we can stop dealing with qemu timekeeping issues,
it might (seem to) take qemu twice as long as was requested before
the thread resumes, but that's OK - the same thing could happen on
a loaded system for other reasons.

Beyond that, the test also has (had) a race condition.   When using
CLOCK_REALTIME though that clock needed to have advanced to T before
the ETIMEDOUT should happen, there is no guarantee that it will stay >T
(CLOCK_REALTIME is allowed to be reset backwards).   So, only test
that the current time (after ETIMEDOUT) >= T when we're using
CLOCK_MONOTONIC - for CLOCK_REALTIME the time might have stepped
back between when the ETIMEDOUT happened and when the thread
obtains the current clock reading.  For that case, all we can test
is that the ETIMEDOUT actually happens.

With much of what was there now gone, the code can be simplified,
we no longer need to do timespec arithmetic, just one comparison
(simpler to test that Tend >= Tstart+period than Tend-Tstart > period
as we need Tstart+period for the abstime value for the timeout anyway).

Note that this still tests for the issue reported in PR lib/47703
which is where the test came from in the first place.

ps: we seem to be missing pthread_cond_clockwait() which is the same
as pthread_cond_timedwait() except that the clock to use is passed
as a parameter, rather than as an attribute of the condition variable.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libpthread/t_condwait.c

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



CVS commit: src/external/public-domain/tz/dist

2022-12-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Dec 11 08:32:02 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: backward

Log Message:
Undo the previous revert - turns out that vers 1.7 was correct after
all, and I am simply unable to read or comprehend (properly).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/public-domain/tz/dist/backward

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

Modified files:

Index: src/external/public-domain/tz/dist/backward
diff -u src/external/public-domain/tz/dist/backward:1.9 src/external/public-domain/tz/dist/backward:1.10
--- src/external/public-domain/tz/dist/backward:1.9	Sun Dec 11 07:14:05 2022
+++ src/external/public-domain/tz/dist/backward	Sun Dec 11 08:32:02 2022
@@ -160,6 +160,7 @@ Link	America/Tijuana		America/Ensenada
 Link	America/Indiana/Indianapolis	America/Fort_Wayne
 Link	America/Toronto		America/Montreal
 Link	America/Toronto		America/Nipigon
+Link	America/Iqaluit		America/Pangnirtung
 Link	America/Rio_Branco	America/Porto_Acre
 Link	America/Winnipeg	America/Rainy_River
 Link	America/Argentina/Cordoba	America/Rosario



CVS commit: src/external/public-domain/tz/dist

2022-12-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Dec 11 08:32:02 UTC 2022

Modified Files:
src/external/public-domain/tz/dist: backward

Log Message:
Undo the previous revert - turns out that vers 1.7 was correct after
all, and I am simply unable to read or comprehend (properly).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/public-domain/tz/dist/backward

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



CVS commit: src/bin/sh

2022-12-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Dec 11 08:23:11 UTC 2022

Modified Files:
src/bin/sh: miscbltin.c sh.1

Log Message:
It appears that POSIX intends to add a -d X option to the read command
in its next version, so it can be used as -d '' (to specify a \0 end
character for the record read, rather than the default \n) to accompany
find -print0 and xargs -0 options (also likely to be added).

Add support for -d now.   While here fix a bug where escaped nul
chars (\ \0) in non-raw mode were not being dropped, as they are
when not escaped (if not dropped, they're still not used in any
useful way, they just ended the value at that point).


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/bin/sh/miscbltin.c
cvs rdiff -u -r1.251 -r1.252 src/bin/sh/sh.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/sh/miscbltin.c
diff -u src/bin/sh/miscbltin.c:1.52 src/bin/sh/miscbltin.c:1.53
--- src/bin/sh/miscbltin.c:1.52	Fri Aug 19 12:52:31 2022
+++ src/bin/sh/miscbltin.c	Sun Dec 11 08:23:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: miscbltin.c,v 1.52 2022/08/19 12:52:31 kre Exp $	*/
+/*	$NetBSD: miscbltin.c,v 1.53 2022/12/11 08:23:10 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)miscbltin.c	8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: miscbltin.c,v 1.52 2022/08/19 12:52:31 kre Exp $");
+__RCSID("$NetBSD: miscbltin.c,v 1.53 2022/12/11 08:23:10 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -91,6 +91,7 @@ readcmd(int argc, char **argv)
 {
 	char **ap;
 	char c;
+	char end;
 	int rflag;
 	char *prompt;
 	const char *ifs;
@@ -102,13 +103,21 @@ readcmd(int argc, char **argv)
 	int saveall = 0;
 	ptrdiff_t wordlen = 0;
 
+	end = '\n';/* record delimiter */
 	rflag = 0;
 	prompt = NULL;
-	while ((i = nextopt("p:r")) != '\0') {
-		if (i == 'p')
+	while ((i = nextopt("d:p:r")) != '\0') {
+		switch (i) {
+		case 'd':
+			end = *optionarg;	/* even if '\0' */
+			break;
+		case 'p':
 			prompt = optionarg;
-		else
+			break;
+		case 'r':
 			rflag = 1;
+			break;
+		}
 	}
 
 	if (*(ap = argptr) == NULL)
@@ -131,19 +140,19 @@ readcmd(int argc, char **argv)
 			status = 1;
 			break;
 		}
-		if (c == '\0')
-			continue;
-		if (c == '\\' && !rflag) {
+		if (c == '\\' && c != end && !rflag) {
 			if (read(0, , 1) != 1) {
 status = 1;
 break;
 			}
-			if (c != '\n')
+			if (c != '\n')	/* \ \n is always just removed */
 goto wdch;
 			continue;
 		}
-		if (c == '\n')
+		if (c == end)
 			break;
+		if (c == '\0')
+			continue;
 		if (strchr(ifs, c))
 			is_ifs = strchr(" \t\n", c) ? 1 : 2;
 		else
@@ -167,6 +176,8 @@ readcmd(int argc, char **argv)
 
 		if (is_ifs == 0) {
   wdch:;
+			if (c == '\0')	/* always ignore attempts to input \0 */
+continue;
 			/* append this character to the current variable */
 			startword = 0;
 			if (saveall)

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.251 src/bin/sh/sh.1:1.252
--- src/bin/sh/sh.1:1.251	Sun Oct 30 01:19:08 2022
+++ src/bin/sh/sh.1	Sun Dec 11 08:23:10 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.251 2022/10/30 01:19:08 kre Exp $
+.\"	$NetBSD: sh.1,v 1.252 2022/12/11 08:23:10 kre Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -31,8 +31,7 @@
 .\"
 .\"	@(#)sh.1	8.6 (Berkeley) 5/4/95
 .\"
-.\" RIP Noi, October 6, 1959 --
-.Dd August 26, 2022
+.Dd December 9, 2022
 .Dt SH 1
 .\" everything except c o and s (keep them ordered)
 .ds flags abCEeFfhIiLlmnpquVvXx
@@ -3583,15 +3582,21 @@ the program will use
 and the built-in uses a separately cached value.
 .\"
 .Pp
-.It Ic read Oo Fl p Ar prompt Oc Oo Fl r Oc Ar variable Op Ar ...
+.It Ic read Oo Fl d Ar delim Oc Oo Fl p Ar prompt Oc Oo Fl r Oc Ar variable Op Ar ...
 The
 .Ar prompt
 is printed on standard error if the
 .Fl p
 option is specified and the standard input is a terminal.
-Then a line is read from the standard input.
-The trailing newline is deleted from the
-line and the line is split as described in the field splitting section of the
+Then a record, terminated by the
+first character of
+.Ar delim
+if the
+.Fl d
+option was given, or a newline character otherwise,
+is read from the standard input.
+The ending delimiter is deleted from the
+record which is then split as described in the field splitting section of the
 .Sx Word Expansions
 section above.
 The pieces are assigned to the
@@ -3614,17 +3619,41 @@ which case failure is returned.
 By default, unless the
 .Fl r
 option is specified, the backslash
-.Dq \e
-acts as an escape character, causing the following character to be treated
-literally.
+.Pq Ql \e
+acts as an escape character,
+causing the following character,
+when that character is the escape character, or end delimiter character,
+to be treated literally when reading the record.
 This is the only form of quoting that applies.
 If an 

CVS commit: src/bin/sh

2022-12-11 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Dec 11 08:23:11 UTC 2022

Modified Files:
src/bin/sh: miscbltin.c sh.1

Log Message:
It appears that POSIX intends to add a -d X option to the read command
in its next version, so it can be used as -d '' (to specify a \0 end
character for the record read, rather than the default \n) to accompany
find -print0 and xargs -0 options (also likely to be added).

Add support for -d now.   While here fix a bug where escaped nul
chars (\ \0) in non-raw mode were not being dropped, as they are
when not escaped (if not dropped, they're still not used in any
useful way, they just ended the value at that point).


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/bin/sh/miscbltin.c
cvs rdiff -u -r1.251 -r1.252 src/bin/sh/sh.1

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



CVS commit: src/sys/netinet

2022-12-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec 11 08:09:20 UTC 2022

Modified Files:
src/sys/netinet: tcp_vtw.h

Log Message:
Need larger fat pointers for 128bit cache lines.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/netinet/tcp_vtw.h

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



CVS commit: src/sys/netinet

2022-12-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec 11 08:09:20 UTC 2022

Modified Files:
src/sys/netinet: tcp_vtw.h

Log Message:
Need larger fat pointers for 128bit cache lines.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/netinet/tcp_vtw.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/netinet/tcp_vtw.h
diff -u src/sys/netinet/tcp_vtw.h:1.9 src/sys/netinet/tcp_vtw.h:1.10
--- src/sys/netinet/tcp_vtw.h:1.9	Thu Apr 19 21:21:44 2018
+++ src/sys/netinet/tcp_vtw.h	Sun Dec 11 08:09:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_vtw.h,v 1.9 2018/04/19 21:21:44 christos Exp $	*/
+/*	$NetBSD: tcp_vtw.h,v 1.10 2022/12/11 08:09:20 mlelstv Exp $	*/
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -151,7 +151,11 @@
  */
 struct fatp_mi;
 
+#if CACHE_LINE_SIZE == 128
+typedef uint64_t fatp_word_t;
+#else
 typedef uint32_t fatp_word_t;
+#endif
 
 typedef struct fatp_mi	fatp_t;
 
@@ -161,7 +165,7 @@ typedef struct fatp_mi	fatp_t;
 #define	FATP_NTAGS	(CACHE_LINE_SIZE / sizeof(fatp_word_t) - 1)
 #define	FATP_NXT_WIDTH	(sizeof(fatp_word_t) * NBBY - FATP_NTAGS)
 
-#define	FATP_MAX	(1 << FATP_NXT_WIDTH)
+#define	FATP_MAX	(1 << (FATP_NXT_WIDTH < 31 ? FATP_NXT_WIDTH : 31))
 
 /* Worked example: ULP32 with 64-byte cacheline (32-bit x86):
  * 15 tags per cacheline.  At most 2^17 fat pointers per fatp_ctl_t.