CVS commit: src/lib/libm/src

2024-05-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May  4 19:21:51 UTC 2024

Modified Files:
src/lib/libm/src: s_rintl.c

Log Message:
s_rintl.c: Reduce FreeBSD diff and fix on ld128 platforms.

EXT_FRACBITS, the number of bits in the _binary encoding_ that stores
the trailing significand field, is never 113.  In IEEE 754 binary128,
it is 112, even though there are 113 bits of precision in the set of
floating-point numbers -- the leading 1 bit is implicit in binary128.
So ld128 platforms like aarch64 and sparc64 were skipping the real
definition and just defining rintl as an alias for rint, which is
wrong.

In contrast, LDBL_MANT_DIG, the number of bits of precision in the set
of floating-point numbers (p, in IEEE 754 parlance), is 113 in IEEE 754
binary128.  This is also the constant used in FreeBSD libm anyway.  So
let's just use that instead of trying to translate it to our private
EXT_FRACBITS (not defined in FreeBSD) with a fencepos terror.  And
delete the buggy rintl=rint alias.

PR lib/58054


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/s_rintl.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/libm/src/s_rintl.c
diff -u src/lib/libm/src/s_rintl.c:1.6 src/lib/libm/src/s_rintl.c:1.7
--- src/lib/libm/src/s_rintl.c:1.6	Tue Apr  2 18:39:51 2024
+++ src/lib/libm/src/s_rintl.c	Sat May  4 19:21:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_rintl.c,v 1.6 2024/04/02 18:39:51 christos Exp $	*/
+/*	$NetBSD: s_rintl.c,v 1.7 2024/05/04 19:21:51 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 David Schultz 
@@ -30,7 +30,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/lib/msun/src/s_rintl.c,v 1.5 2008/02/22 11:59:05 bde Exp $");
 #else
-__RCSID("$NetBSD: s_rintl.c,v 1.6 2024/04/02 18:39:51 christos Exp $");
+__RCSID("$NetBSD: s_rintl.c,v 1.7 2024/05/04 19:21:51 riastradh Exp $");
 #endif
 
 #include 
@@ -39,20 +39,17 @@ __RCSID("$NetBSD: s_rintl.c,v 1.6 2024/0
 #include "math.h"
 #include "math_private.h"
 
-#ifdef __HAVE_LONG_DOUBLE
+#define	BIAS	(LDBL_MAX_EXP - 1)
 
-# if EXT_FRACBITS == 64 || EXT_FRACBITS == 113 && LDBL_MAX_EXP == 0x4000
-
-#  define BIAS (LDBL_MAX_EXP - 1)
 static const float
 shift[2] = {
-#  if EXT_FRACBITS == 64
+#if LDBL_MANT_DIG == 64
 	0x1.0p63, -0x1.0p63
-#  elif EXT_FRACBITS == 113
+#elif LDBL_MANT_DIG == 113
 	0x1.0p112, -0x1.0p112
-#  else
-#   error "Unsupported long double format"
-#  endif
+#else
+#error "Unsupported long double format"
+#endif
 };
 static const float zero[2] = { 0.0, -0.0 };
 
@@ -64,12 +61,11 @@ rintl(long double x)
 	int ex, sign;
 
 	u.extu_ld = x;
-	u.extu_ext.ext_frach &= ~0x8000;
 	expsign = GET_EXPSIGN();
 	ex = expsign & 0x7fff;
 
-	if (ex >= BIAS + EXT_FRACBITS - 1) {
-		if (ex == BIAS + EXT_FRACBITS)
+	if (ex >= BIAS + LDBL_MANT_DIG - 1) {
+		if (ex == BIAS + LDBL_MAX_EXP)
 			return (x + x);	/* Inf, NaN, or unsupported format */
 		return (x);		/* finite and already an integer */
 	}
@@ -94,13 +90,3 @@ rintl(long double x)
 
 	return (x);
 }
-# else
-
-long double
-rintl(long double x)
-{
-	return rint(x);
-}
-
-# endif
-#endif /* __HAVE_LONG_DOUBLE */



CVS commit: src/lib/libm/src

2024-05-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May  4 19:21:51 UTC 2024

Modified Files:
src/lib/libm/src: s_rintl.c

Log Message:
s_rintl.c: Reduce FreeBSD diff and fix on ld128 platforms.

EXT_FRACBITS, the number of bits in the _binary encoding_ that stores
the trailing significand field, is never 113.  In IEEE 754 binary128,
it is 112, even though there are 113 bits of precision in the set of
floating-point numbers -- the leading 1 bit is implicit in binary128.
So ld128 platforms like aarch64 and sparc64 were skipping the real
definition and just defining rintl as an alias for rint, which is
wrong.

In contrast, LDBL_MANT_DIG, the number of bits of precision in the set
of floating-point numbers (p, in IEEE 754 parlance), is 113 in IEEE 754
binary128.  This is also the constant used in FreeBSD libm anyway.  So
let's just use that instead of trying to translate it to our private
EXT_FRACBITS (not defined in FreeBSD) with a fencepos terror.  And
delete the buggy rintl=rint alias.

PR lib/58054


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/s_rintl.c

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



CVS commit: src/lib/libc/arch/hppa/gen

2024-05-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  4 14:48:28 UTC 2024

Modified Files:
src/lib/libc/arch/hppa/gen: _setjmp.S

Log Message:
Remove magic numbers. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/hppa/gen/_setjmp.S

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



CVS commit: src/lib/libc/arch/riscv/gen

2024-05-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  4 12:43:36 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/gen: makecontext.c

Log Message:
makecontext: correct the type to setup register based arguments.

Use __greg_t rather than int for register based arguments. This fixes
various atf tests.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/riscv/gen/makecontext.c

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



CVS commit: src/lib/libc/arch/riscv/gen

2024-05-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  4 12:43:36 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/gen: makecontext.c

Log Message:
makecontext: correct the type to setup register based arguments.

Use __greg_t rather than int for register based arguments. This fixes
various atf tests.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/riscv/gen/makecontext.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/arch/riscv/gen/makecontext.c
diff -u src/lib/libc/arch/riscv/gen/makecontext.c:1.2 src/lib/libc/arch/riscv/gen/makecontext.c:1.3
--- src/lib/libc/arch/riscv/gen/makecontext.c:1.2	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/makecontext.c	Sat May  4 12:43:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: makecontext.c,v 1.2 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: makecontext.c,v 1.3 2024/05/04 12:43:36 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.2 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: makecontext.c,v 1.3 2024/05/04 12:43:36 skrll Exp $");
 #endif
 
 #include 
@@ -75,7 +75,7 @@ makecontext(ucontext_t *ucp, void (*func
 	va_start(ap, argc);
 	/* Up to the first eight arguments are passed in a0(x10)-a7(x17) */
 	for (i = 0; i < argc && i < 8; i++)
-		gr[_REG_A0 + i] = va_arg(ap, int);
+		gr[_REG_A0 + i] = va_arg(ap, __greg_t);
 	/* Pass remaining arguments on the stack above the backchain/lr gap. */
 	for (sp += 0; i < argc; i++)
 		*sp++ = va_arg(ap, long);



CVS commit: src/lib/libc/stdio

2024-05-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  4 05:50:49 UTC 2024

Modified Files:
src/lib/libc/stdio: mktemp.3

Log Message:
mktemp.3: mkdtemp is no longer nonstandard

Reported by Aleksey Cheusov on tech-userlevel.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/lib/libc/stdio/mktemp.3

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



CVS commit: src/lib/libc/stdio

2024-05-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May  4 05:50:49 UTC 2024

Modified Files:
src/lib/libc/stdio: mktemp.3

Log Message:
mktemp.3: mkdtemp is no longer nonstandard

Reported by Aleksey Cheusov on tech-userlevel.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/lib/libc/stdio/mktemp.3

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/stdio/mktemp.3
diff -u src/lib/libc/stdio/mktemp.3:1.32 src/lib/libc/stdio/mktemp.3:1.33
--- src/lib/libc/stdio/mktemp.3:1.32	Thu Oct 28 09:51:39 2021
+++ src/lib/libc/stdio/mktemp.3	Sat May  4 05:50:49 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mktemp.3,v 1.32 2021/10/28 09:51:39 kim Exp $
+.\"	$NetBSD: mktemp.3,v 1.33 2024/05/04 05:50:49 rillig Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)mktemp.3	8.1 (Berkeley) 6/4/93
 .\"
-.Dd July 25, 2021
+.Dd May 4, 2024
 .Dt MKTEMP 3
 .Os
 .Sh NAME
@@ -304,13 +304,12 @@ It was however removed from the specific
 revision.
 The
 .Fn mkstemp
-and
+function conforms to
+.St -p1003.1-2004 .
+The
 .Fn mkdtemp
-functions conform to
-.St -p1003.1-2004
-and
-.St -p1003.1-2008 ,
-respectively.
+function conforms to
+.St -p1003.1-2008 .
 .Sh HISTORY
 A
 .Fn mktemp
@@ -372,10 +371,6 @@ For this reason,
 .Xr ld 1
 will output a warning message whenever it links code that uses
 .Fn mktemp .
-.Pp
-The
-.Fn mkdtemp
-function is nonstandard and should not be used if portability is required.
 .Sh SECURITY CONSIDERATIONS
 The use of
 .Fn mktemp



CVS commit: src/lib/libutil

2024-05-02 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu May  2 18:34:01 UTC 2024

Modified Files:
src/lib/libutil: parsedate.3

Log Message:
parsedate.3: resolve contradictory values for 'next'


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/lib/libutil/parsedate.3

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



CVS commit: src/lib/libutil

2024-05-02 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu May  2 18:34:01 UTC 2024

Modified Files:
src/lib/libutil: parsedate.3

Log Message:
parsedate.3: resolve contradictory values for 'next'


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/lib/libutil/parsedate.3

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

Modified files:

Index: src/lib/libutil/parsedate.3
diff -u src/lib/libutil/parsedate.3:1.26 src/lib/libutil/parsedate.3:1.27
--- src/lib/libutil/parsedate.3:1.26	Sun May 16 19:42:35 2021
+++ src/lib/libutil/parsedate.3	Thu May  2 18:34:01 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: parsedate.3,v 1.26 2021/05/16 19:42:35 kre Exp $
+.\" $NetBSD: parsedate.3,v 1.27 2024/05/02 18:34:01 rillig Exp $
 .\"
 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -96,7 +96,8 @@ The following words have the indicated n
 .Dv first , next ,
 or
 .Dv one =
-1,
+1
+.Pq but see the BUGS section below ,
 .Dv second
 is unused so that it is not confused with
 .Dq seconds ,



CVS commit: src/lib/libutil

2024-05-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May  2 14:19:56 UTC 2024

Modified Files:
src/lib/libutil: parsedate.y

Log Message:
revert previous.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/lib/libutil/parsedate.y

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

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.39 src/lib/libutil/parsedate.y:1.40
--- src/lib/libutil/parsedate.y:1.39	Wed May  1 15:59:07 2024
+++ src/lib/libutil/parsedate.y	Thu May  2 10:19:56 2024
@@ -12,7 +12,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.39 2024/05/01 19:59:07 christos Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.40 2024/05/02 14:19:56 christos Exp $");
 #endif
 
 #include 
@@ -546,7 +546,7 @@ static const TABLE OtherTable[] = {
 { "now",		tMINUTE_UNIT,	0 },
 { "last",		tUNUMBER,	-1 },
 { "this",		tMINUTE_UNIT,	0 },
-{ "next",		tUNUMBER,	1 },
+{ "next",		tUNUMBER,	2 },	/* it is more useful this way */
 { "first",		tUNUMBER,	1 },
 { "one",		tUNUMBER,	1 },
 /*  { "second",		tUNUMBER,	2 }, */



CVS commit: src/lib/libutil

2024-05-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May  2 14:19:56 UTC 2024

Modified Files:
src/lib/libutil: parsedate.y

Log Message:
revert previous.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/lib/libutil/parsedate.y

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



Re: CVS commit: src/lib/libutil

2024-05-01 Thread Robert Elz
Date:Wed, 1 May 2024 22:27:02 +0200
From:Roland Illig 
Message-ID:  <754bd755-be0a-4eff-aa7b-d53fce9b4...@gmx.de>

  | > Log Message:
  | > next should increement by 1 not 2.
  |
  | Are you sure?

I agree, that change should be reverted.

"next" is even documented to be two ...

 6  Despite what is stated above, ?next? is actually 2.  The input ?next
January?, instead of producing a timestamp for January of the
following year, produces one for January 2nd, of the current year.
Use caution with ?next? it rarely does what humans expect.  For
example, on a Sunday ?next sunday? means the following Sunday (7 days
hence) whereas ?next monday? means the monday that follows that (8
days hence) rather than ?tomorrow? or just ?Mon? (without the ?next?)
which is the nearest subsequent Monday.

and is actually more useful that way.   It is peculiar, but that's how it
has worked ~forever.

There are limits to how sane a half hearted (but still useful) attempt
to understand English idiom can possibly work, we really don't want to
attempt to turn parsedate into an AI machine.

kre




Re: CVS commit: src/lib/libutil

2024-05-01 Thread Roland Illig
Am 01.05.2024 um 21:59 schrieb Christos Zoulas:
> Module Name:  src
> Committed By: christos
> Date: Wed May  1 19:59:08 UTC 2024
>
> Modified Files:
>   src/lib/libutil: parsedate.y
>
> Log Message:
> next should increement by 1 not 2.

Are you sure? I get these test results:

> t_parsedate (2/5): 7 test cases
> atsecs: [0.006548s] Passed.
> dates: [0.007241s] Passed.
> dsttimes: [0.007517s] Passed.
> gibberish: [0.007637s] Passed.
> relative: [0.287375s] Failed: 2258 checks failed; see output for more 
> details
> times: [0.008402s] Passed.
> zones: [0.007586s] Passed.

After your change, "next sunday" goes backward in time, for example:

> From 28110552 (Sun Nov 22 08:29:12 1970) using "next sunday",
> obtained 2808 (Sun Nov 22 00:00:00 1970);
> expected 28684800 (Sun Nov 29 00:00:00 1970)



CVS commit: src/lib/libutil

2024-05-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  1 19:59:08 UTC 2024

Modified Files:
src/lib/libutil: parsedate.y

Log Message:
next should increement by 1 not 2.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libutil/parsedate.y

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

Modified files:

Index: src/lib/libutil/parsedate.y
diff -u src/lib/libutil/parsedate.y:1.38 src/lib/libutil/parsedate.y:1.39
--- src/lib/libutil/parsedate.y:1.38	Thu Feb 29 15:55:35 2024
+++ src/lib/libutil/parsedate.y	Wed May  1 15:59:07 2024
@@ -12,7 +12,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.38 2024/02/29 20:55:35 rillig Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.39 2024/05/01 19:59:07 christos Exp $");
 #endif
 
 #include 
@@ -546,7 +546,7 @@ static const TABLE OtherTable[] = {
 { "now",		tMINUTE_UNIT,	0 },
 { "last",		tUNUMBER,	-1 },
 { "this",		tMINUTE_UNIT,	0 },
-{ "next",		tUNUMBER,	2 },
+{ "next",		tUNUMBER,	1 },
 { "first",		tUNUMBER,	1 },
 { "one",		tUNUMBER,	1 },
 /*  { "second",		tUNUMBER,	2 }, */



CVS commit: src/lib/libutil

2024-05-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  1 19:59:08 UTC 2024

Modified Files:
src/lib/libutil: parsedate.y

Log Message:
next should increement by 1 not 2.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libutil/parsedate.y

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



CVS commit: src/lib/libc/compiler_rt

2024-05-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  1 18:38:15 UTC 2024

Modified Files:
src/lib/libc/compiler_rt: Makefile.inc

Log Message:
fix clang lint build.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/lib/libc/compiler_rt/Makefile.inc

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/compiler_rt/Makefile.inc
diff -u src/lib/libc/compiler_rt/Makefile.inc:1.47 src/lib/libc/compiler_rt/Makefile.inc:1.48
--- src/lib/libc/compiler_rt/Makefile.inc:1.47	Sun Mar 10 14:00:13 2024
+++ src/lib/libc/compiler_rt/Makefile.inc	Wed May  1 14:38:15 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.47 2024/03/10 18:00:13 rillig Exp $
+# $NetBSD: Makefile.inc,v 1.48 2024/05/01 18:38:15 christos Exp $
 
 COMPILER_RT_DIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt
 COMPILER_RT_SRCDIR=	${COMPILER_RT_DIR}/dist
@@ -380,6 +380,7 @@ LINTFLAGS.floatuntidf.c += -X 122,141,26
 LINTFLAGS.floatuntisf.c += -X 351
 LINTFLAGS.floatuntixf.c += -X 122,351
 LINTFLAGS.floatuntixf.c += -X 141 # alpha
+LINTFLAGS.gcc_personality_v0.c += -X 132,231
 LINTFLAGS.int_util.c += -X 231
 LINTFLAGS.lshrti3.c += -X 351
 LINTFLAGS.moddi3.c += -X 117 # vax



CVS commit: src/lib/libc/compiler_rt

2024-05-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  1 18:38:15 UTC 2024

Modified Files:
src/lib/libc/compiler_rt: Makefile.inc

Log Message:
fix clang lint build.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/lib/libc/compiler_rt/Makefile.inc

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



CVS commit: src/lib/libc/sys

2024-04-28 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr 28 23:10:26 UTC 2024

Modified Files:
src/lib/libc/sys: execve.2

Log Message:
execve(2): brush up markup


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/lib/libc/sys/execve.2

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/sys/execve.2
diff -u src/lib/libc/sys/execve.2:1.46 src/lib/libc/sys/execve.2:1.47
--- src/lib/libc/sys/execve.2:1.46	Sun Apr 28 22:21:21 2024
+++ src/lib/libc/sys/execve.2	Sun Apr 28 23:10:26 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: execve.2,v 1.46 2024/04/28 22:21:21 rillig Exp $
+.\"	$NetBSD: execve.2,v 1.47 2024/04/28 23:10:26 uwe Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -75,35 +75,32 @@ and
 .Xr a.out 5 .
 .Pp
 An interpreter file begins with a line of the form:
-.Pp
-.Bd -ragged -offset indent -compact
-.Sy 

CVS commit: src/lib/libc/sys

2024-04-28 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr 28 23:10:26 UTC 2024

Modified Files:
src/lib/libc/sys: execve.2

Log Message:
execve(2): brush up markup


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/lib/libc/sys/execve.2

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



CVS commit: src/lib/libc/gen

2024-04-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr 28 22:57:16 UTC 2024

Modified Files:
src/lib/libc/gen: time.3

Log Message:
time.3: clarify that *tloc is always set if tloc != NULL


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/gen/time.3

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/gen/time.3
diff -u src/lib/libc/gen/time.3:1.16 src/lib/libc/gen/time.3:1.17
--- src/lib/libc/gen/time.3:1.16	Sat Nov  5 18:17:29 2011
+++ src/lib/libc/gen/time.3	Sun Apr 28 22:57:16 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: time.3,v 1.16 2011/11/05 18:17:29 christos Exp $
+.\"	$NetBSD: time.3,v 1.17 2024/04/28 22:57:16 rillig Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\" @(#)time.3	8.1 (Berkeley) 6/4/93
 .\"
-.Dd November 5, 2011
+.Dd April 29, 2024
 .Dt TIME 3
 .Os
 .Sh NAME
@@ -52,21 +52,17 @@ function
 returns the value of time in seconds since 0 hours, 0 minutes,
 0 seconds, January 1, 1970, Coordinated Universal Time.
 .Pp
-A copy of the time value may be saved to the area indicated by the
-pointer
-.Fa tloc .
 If
 .Fa tloc
-is a
-.Dv NULL
-pointer, no value is stored.
+is not a null pointer, a copy of the time value is saved in
+.Fa *tloc .
 .Pp
 Upon successful completion,
 .Fn time
 returns the value of time.
 Otherwise a value of
 .Po
-.Po Fa time_t Pc \-1
+.Po Fa time_t Pc Ns \-1
 .Pc
 is returned and the global variable
 .Va errno



CVS commit: src/lib/libc/gen

2024-04-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr 28 22:57:16 UTC 2024

Modified Files:
src/lib/libc/gen: time.3

Log Message:
time.3: clarify that *tloc is always set if tloc != NULL


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/gen/time.3

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



CVS commit: src/lib/libc/gen

2024-04-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr 28 22:43:30 UTC 2024

Modified Files:
src/lib/libc/gen: setmode.3

Log Message:
setmode.3: fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/gen/setmode.3

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/gen/setmode.3
diff -u src/lib/libc/gen/setmode.3:1.23 src/lib/libc/gen/setmode.3:1.24
--- src/lib/libc/gen/setmode.3:1.23	Sat Mar 12 17:31:39 2022
+++ src/lib/libc/gen/setmode.3	Sun Apr 28 22:43:30 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: setmode.3,v 1.23 2022/03/12 17:31:39 christos Exp $
+.\"	$NetBSD: setmode.3,v 1.24 2024/04/28 22:43:30 rillig Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -51,16 +51,15 @@ function accepts a string representation
 compiles it to binary form, and returns an abstract representation
 that may be passed to
 .Fn getmode .
-The string may be an numeric (octal) or symbolic string of the form
+The string may be a numeric (octal) or symbolic string of the form
 accepted by
 .Xr chmod 1 ,
 and may represent either an exact mode to set or a change to make to
-the existing mode.
+an existing mode.
 .Pp
 The
 .Fn getmode
-function
-adjusts the file permission bits given by
+function adjusts the file permission bits given by
 .Fa mode
 according to the compiled change representation
 .Fa set ,
@@ -116,7 +115,7 @@ or
 .Xr strtol 3 .
 In addition,
 .Fn setmode
-will fail and set
+may fail and set
 .Va errno
 to:
 .Bl -tag -width Er



CVS commit: src/lib/libc/gen

2024-04-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr 28 22:43:30 UTC 2024

Modified Files:
src/lib/libc/gen: setmode.3

Log Message:
setmode.3: fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/gen/setmode.3

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



CVS commit: src/lib/libc/sys

2024-04-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr 28 22:21:21 UTC 2024

Modified Files:
src/lib/libc/sys: execve.2

Log Message:
execve.2: fix typo in markup


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/lib/libc/sys/execve.2

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/sys/execve.2
diff -u src/lib/libc/sys/execve.2:1.45 src/lib/libc/sys/execve.2:1.46
--- src/lib/libc/sys/execve.2:1.45	Wed Sep 18 04:57:53 2019
+++ src/lib/libc/sys/execve.2	Sun Apr 28 22:21:21 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: execve.2,v 1.45 2019/09/18 04:57:53 wiz Exp $
+.\"	$NetBSD: execve.2,v 1.46 2024/04/28 22:21:21 rillig Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -83,7 +83,7 @@ An interpreter file begins with a line o
 .Ed
 .Pp
 When an interpreter file is
-.Sy execve Ar d ,
+.Sy execve Ap d ,
 the system actually
 .Sy execve Ap s
 the specified



CVS commit: src/lib/libc/sys

2024-04-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr 28 22:21:21 UTC 2024

Modified Files:
src/lib/libc/sys: execve.2

Log Message:
execve.2: fix typo in markup


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/lib/libc/sys/execve.2

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



CVS commit: src/lib/libc/gen

2024-04-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 22 21:25:29 UTC 2024

Modified Files:
src/lib/libc/gen: usleep.3

Log Message:
it's nanosleep(2), not nanosleep(3)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/gen/usleep.3

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



CVS commit: src/lib/libc/gen

2024-04-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 22 21:25:29 UTC 2024

Modified Files:
src/lib/libc/gen: usleep.3

Log Message:
it's nanosleep(2), not nanosleep(3)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/gen/usleep.3

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/gen/usleep.3
diff -u src/lib/libc/gen/usleep.3:1.20 src/lib/libc/gen/usleep.3:1.21
--- src/lib/libc/gen/usleep.3:1.20	Mon Apr 22 21:02:18 2024
+++ src/lib/libc/gen/usleep.3	Mon Apr 22 21:25:29 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usleep.3,v 1.20 2024/04/22 21:02:18 jdolecek Exp $
+.\"	$NetBSD: usleep.3,v 1.21 2024/04/22 21:25:29 jdolecek Exp $
 .\"
 .\" Copyright (c) 1986, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -44,7 +44,7 @@
 .Sh DESCRIPTION
 .Bf -symbolic
 This interface is obsoleted by
-.Xr nanosleep 3 .
+.Xr nanosleep 2 .
 .Ef
 .Pp
 The



CVS commit: src/lib/libc/gen

2024-04-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 22 21:02:18 UTC 2024

Modified Files:
src/lib/libc/gen: usleep.3 usleep.c

Log Message:
allow usleep(3) with useconds >= 100

update manpage to mention this interface is obsolete, remove
EINVAL from the ERRORS and mention EINTR instead.

PR lib/58184 by Taylor R Campbell


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/gen/usleep.3
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/gen/usleep.c

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



CVS commit: src/lib/libc/gen

2024-04-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 22 21:02:18 UTC 2024

Modified Files:
src/lib/libc/gen: usleep.3 usleep.c

Log Message:
allow usleep(3) with useconds >= 100

update manpage to mention this interface is obsolete, remove
EINVAL from the ERRORS and mention EINTR instead.

PR lib/58184 by Taylor R Campbell


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/gen/usleep.3
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/gen/usleep.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/gen/usleep.3
diff -u src/lib/libc/gen/usleep.3:1.19 src/lib/libc/gen/usleep.3:1.20
--- src/lib/libc/gen/usleep.3:1.19	Thu Apr 29 17:29:56 2010
+++ src/lib/libc/gen/usleep.3	Mon Apr 22 21:02:18 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usleep.3,v 1.19 2010/04/29 17:29:56 jruoho Exp $
+.\"	$NetBSD: usleep.3,v 1.20 2024/04/22 21:02:18 jdolecek Exp $
 .\"
 .\" Copyright (c) 1986, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)usleep.3	8.1 (Berkeley) 6/4/93
 .\"
-.Dd April 29, 2010
+.Dd April 22, 2024
 .Dt USLEEP 3
 .Os
 .Sh NAME
@@ -42,6 +42,11 @@
 .Ft int
 .Fn usleep "useconds_t microseconds"
 .Sh DESCRIPTION
+.Bf -symbolic
+This interface is obsoleted by
+.Xr nanosleep 3 .
+.Ef
+.Pp
 The
 .Fn usleep
 function
@@ -53,13 +58,6 @@ action is to invoke a signal catching fu
 process.
 The suspension time may be longer than requested due to the
 scheduling of other activity by the system.
-.Pp
-The
-.Fa microseconds
-argument must be less than 1,000,000.
-If the value of
-.Fa microseconds
-is 0, then the call has no effect.
 .Sh RETURN VALUES
 On successful completion,
 .Fn usleep
@@ -72,10 +70,9 @@ The
 .Fn usleep
 function may fail if:
 .Bl -tag -width Er
-.It Bq Er EINVAL
-The
-.Fa microseconds
-interval specified 1,000,000 or more microseconds.
+.It Bq Er EINTR
+.Nm
+was interrupted by the delivery of a signal.
 .El
 .Sh SEE ALSO
 .Xr nanosleep 2 ,

Index: src/lib/libc/gen/usleep.c
diff -u src/lib/libc/gen/usleep.c:1.20 src/lib/libc/gen/usleep.c:1.21
--- src/lib/libc/gen/usleep.c:1.20	Mon Jun 25 22:32:44 2012
+++ src/lib/libc/gen/usleep.c	Mon Apr 22 21:02:18 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: usleep.c,v 1.20 2012/06/25 22:32:44 abs Exp $	*/
+/*	$NetBSD: usleep.c,v 1.21 2024/04/22 21:02:18 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: usleep.c,v 1.20 2012/06/25 22:32:44 abs Exp $");
+__RCSID("$NetBSD: usleep.c,v 1.21 2024/04/22 21:02:18 jdolecek Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -51,13 +51,8 @@ usleep(useconds_t useconds)
 	if (useconds == 0)
 		return (0);
 
-	if (useconds >= 100) {
-		errno = EINVAL;
-		return (-1);
-	}
-
-	ts.tv_sec  = 0;
-	ts.tv_nsec = useconds * 1000;
+	ts.tv_sec  = (useconds / 100);
+	ts.tv_nsec = (useconds % 100) * 1000;
 
 	nanosleep(, NULL);
 



CVS commit: src/lib/libc/arch/hppa

2024-04-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 20 14:09:40 UTC 2024

Modified Files:
src/lib/libc/arch/hppa: genassym.cf
src/lib/libc/arch/hppa/gen: __setjmp14.S

Log Message:
Remove some magic numbers by using genassym.cf


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/hppa/genassym.cf
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/hppa/gen/__setjmp14.S

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/arch/hppa/genassym.cf
diff -u src/lib/libc/arch/hppa/genassym.cf:1.4 src/lib/libc/arch/hppa/genassym.cf:1.5
--- src/lib/libc/arch/hppa/genassym.cf:1.4	Sun Jun 26 14:37:12 2022
+++ src/lib/libc/arch/hppa/genassym.cf	Sat Apr 20 14:09:40 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.4 2022/06/26 14:37:12 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.5 2024/04/20 14:09:40 skrll Exp $
 
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -104,3 +104,16 @@ define _UC_GREGS_R28	offsetof(ucontext_t
 define _UC_GREGS_R29	offsetof(ucontext_t, uc_mcontext.__gregs[29])
 define _UC_GREGS_R30	offsetof(ucontext_t, uc_mcontext.__gregs[30])
 define _UC_GREGS_R31	offsetof(ucontext_t, uc_mcontext.__gregs[31])
+
+define SIZEOF_SIGCONTEXT	sizeof(struct sigcontext)
+define _SC_ONSTACK	offsetof(struct sigcontext, sc_onstack)
+define _SC_MASK13	offsetof(struct sigcontext, __sc_mask13)
+define _SC_REGS_SP	offsetof(struct sigcontext, sc_sp)
+define _SC_REGS_FP	offsetof(struct sigcontext, sc_fp)
+define _SC_REGS_AP	offsetof(struct sigcontext, sc_ap)
+define _SC_REGS_PCSQH	offsetof(struct sigcontext, sc_pcsqh)
+define _SC_REGS_PCOQH	offsetof(struct sigcontext, sc_pcoqh)
+define _SC_REGS_PCSQT	offsetof(struct sigcontext, sc_pcsqt)
+define _SC_REGS_PCOQT	offsetof(struct sigcontext, sc_pcoqt)
+define _SC_REGS_PS	offsetof(struct sigcontext, sc_ps)
+define _SC_MASK		offsetof(struct sigcontext, sc_mask)

Index: src/lib/libc/arch/hppa/gen/__setjmp14.S
diff -u src/lib/libc/arch/hppa/gen/__setjmp14.S:1.9 src/lib/libc/arch/hppa/gen/__setjmp14.S:1.10
--- src/lib/libc/arch/hppa/gen/__setjmp14.S:1.9	Tue May  5 06:20:55 2020
+++ src/lib/libc/arch/hppa/gen/__setjmp14.S	Sat Apr 20 14:09:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: __setjmp14.S,v 1.9 2020/05/05 06:20:55 skrll Exp $	*/
+/*	$NetBSD: __setjmp14.S,v 1.10 2024/04/20 14:09:40 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -29,12 +29,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "assym.h"
+
 #include 
 #include 
 #include 
 
 #if defined(LIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: __setjmp14.S,v 1.9 2020/05/05 06:20:55 skrll Exp $")
+	RCSID("$NetBSD: __setjmp14.S,v 1.10 2024/04/20 14:09:40 skrll Exp $")
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -54,21 +56,21 @@ ENTRY(__setjmp14,0)
 	stw	%arg0, HPPA_FRAME_ARG(0)(%sp)
 
 	/* A sigcontext is at the beginning of our jmp_buf. */
-	stw	%r0, 4(%arg0)		; unused word (old style signal mask)
-	stw	%sp, 8(%arg0)		; sc.sc_sp = %sp
-	stw	%r0, 16(%arg0)		; sc.sc_ap = NULL
+	stw	%r0, _SC_MASK13(%arg0)		; unused word (old style signal mask)
+	stw	%sp, _SC_REGS_SP(%arg0)		; sc.sc_sp = %sp
+	stw	%r0, _SC_REGS_AP(%arg0)		; sc.sc_ap = NULL
 	mfsp	%sr0, %r1
-	stw	%r1, 20(%arg0)		; sc.sc_pcsqh = %sr0
-	stw	%rp, 24(%arg0)		; sc.sc_pcoqh = %rp
-	stw	%r1, 28(%arg0)		; sc.sc_pcsqh = %sr0
+	stw	%r1, _SC_REGS_PCSQH(%arg0)	; sc.sc_pcsqh = %sr0
+	stw	%rp, _SC_REGS_PCOQH(%arg0)	; sc.sc_pcoqh = %rp
+	stw	%r1, _SC_REGS_PCSQT(%arg0)	; sc.sc_pcsqt = %sr0
 	ldo	4(%rp), %r1
-	stw	%r1, 32(%arg0)		; sc.sc_pcoqt = %rp + 4
+	stw	%r1, _SC_REGS_PCOQT(%arg0)	; sc.sc_pcoqt = %rp + 4
 	ldil	L%PSW_MBS, %r1
 	ldo	R%PSW_MBS(%r1), %r1
-	stw	%r1, 36(%arg0)		; set sc.sc_ps
+	stw	%r1, _SC_REGS_PS(%arg0)		; set sc.sc_ps
 
 	/* We store all callee-saved registers after the sigcontext. */
-	ldo	56(%arg0), %r1
+	ldo	SIZEOF_SIGCONTEXT(%arg0), %r1
 	stwm	%r3, 4(%r1)
 	stwm	%r4, 4(%r1)
 	stwm	%r5, 4(%r1)
@@ -111,7 +113,7 @@ ENTRY(__setjmp14,0)
 	stw	%r1, 0(%arg0)		; sc.sc_onstack
 
 	/* Get the signal mask. */
-	ldo	40(%arg0), %arg2	; oset = _mask
+	ldo	_SC_MASK(%arg0), %arg2	; oset = _mask
 	copy	%r0, %arg1		; set = NULL
 	bl	__sigprocmask14, %rp
 	 copy	%r0, %arg0		; action = 0 



CVS commit: src/lib/libc/arch/hppa

2024-04-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 20 14:09:40 UTC 2024

Modified Files:
src/lib/libc/arch/hppa: genassym.cf
src/lib/libc/arch/hppa/gen: __setjmp14.S

Log Message:
Remove some magic numbers by using genassym.cf


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/hppa/genassym.cf
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/hppa/gen/__setjmp14.S

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



CVS commit: src/lib/libintl

2024-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 13 02:01:38 UTC 2024

Modified Files:
src/lib/libintl: gettext.c

Log Message:
PR/58136: Paul Ripke: Fix use after free.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libintl/gettext.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/libintl/gettext.c
diff -u src/lib/libintl/gettext.c:1.31 src/lib/libintl/gettext.c:1.32
--- src/lib/libintl/gettext.c:1.31	Thu Oct  3 12:35:57 2019
+++ src/lib/libintl/gettext.c	Fri Apr 12 22:01:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gettext.c,v 1.31 2019/10/03 16:35:57 christos Exp $	*/
+/*	$NetBSD: gettext.c,v 1.32 2024/04/13 02:01:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 Citrus Project,
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: gettext.c,v 1.31 2019/10/03 16:35:57 christos Exp $");
+__RCSID("$NetBSD: gettext.c,v 1.32 2024/04/13 02:01:38 christos Exp $");
 
 #include 
 #include 
@@ -176,6 +176,9 @@ pgettext_impl(const char *domainname, co
 		msgid2, n, category);
 	free(msgctxt_id);
 
+	if (translation == msgctxt_id)
+		return msgid1;
+
 	p = strchr(translation, '\004');
 	if (p)
 		return p + 1;



CVS commit: src/lib/libintl

2024-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 13 02:01:38 UTC 2024

Modified Files:
src/lib/libintl: gettext.c

Log Message:
PR/58136: Paul Ripke: Fix use after free.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libintl/gettext.c

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



CVS commit: src/lib/libc/rpc

2024-04-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 11 18:41:03 UTC 2024

Modified Files:
src/lib/libc/rpc: xdr_float.c

Log Message:
avoid lint warning on the vax


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/libc/rpc/xdr_float.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/rpc/xdr_float.c
diff -u src/lib/libc/rpc/xdr_float.c:1.41 src/lib/libc/rpc/xdr_float.c:1.42
--- src/lib/libc/rpc/xdr_float.c:1.41	Mon Feb 15 06:07:48 2016
+++ src/lib/libc/rpc/xdr_float.c	Thu Apr 11 14:41:03 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: xdr_float.c,v 1.41 2016/02/15 11:07:48 martin Exp $	*/
+/*	$NetBSD: xdr_float.c,v 1.42 2024/04/11 18:41:03 christos Exp $	*/
 
 /*
  * Copyright (c) 2010, Oracle America, Inc.
@@ -37,7 +37,7 @@
 static char *sccsid = "@(#)xdr_float.c 1.12 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)xdr_float.c	2.1 88/07/29 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: xdr_float.c,v 1.41 2016/02/15 11:07:48 martin Exp $");
+__RCSID("$NetBSD: xdr_float.c,v 1.42 2024/04/11 18:41:03 christos Exp $");
 #endif
 #endif
 
@@ -254,6 +254,7 @@ xdr_double(XDR *xdrs, double *dp)
 goto shipit;
 			}
 		}
+		/*LINTED: possible overflow*/
 		id.exp = vd.exp - VAX_DBL_BIAS + IEEE_DBL_BIAS;
 		id.mantissa1 = (vd.mantissa1 << 13) |
 			((unsigned int)vd.mantissa2 >> 3);
@@ -296,6 +297,7 @@ xdr_double(XDR *xdrs, double *dp)
 goto doneit;
 			}
 		}
+		/*LINTED: can overflow */
 		vd.exp = id.exp - IEEE_DBL_BIAS + VAX_DBL_BIAS;
 		vd.mantissa1 = ((unsigned int)id.mantissa1 >> 13);
 		vd.mantissa2 = ((id.mantissa1 & MASK(13)) << 3) |



CVS commit: src/lib/libc/rpc

2024-04-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 11 18:41:03 UTC 2024

Modified Files:
src/lib/libc/rpc: xdr_float.c

Log Message:
avoid lint warning on the vax


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/libc/rpc/xdr_float.c

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



Re: CVS commit: src/lib/libutil

2024-04-09 Thread Valery Ushakov
On Mon, Apr 08, 2024 at 23:31:16 +0200, Roland Illig wrote:

> Am 08.04.2024 um 21:18 schrieb Valery Ushakov:
> >   "=\017FIFTEEN\0"
> >
> > with its result a few lines below that has:
> >
> >   BURST=0xf=FIFTEEN
> 
> Thank you for explaining this example. I had a gut feeling that there
> would be some hidden correlation between some octal/hexadecimal
> combinations, but I couldn't name it. Indeed, if the number base for
> output is hexadecimal, the field comparisons should be done in
> hexadecimal as well.
> 
> I adjusted the description and examples in the manual page accordingly.

Thanks!  My unscientific impression is that snprintb(3) was not very
popular and its uses sometimes are a bit of a cargo-cult, so existing
use cases have to be taken with a grain of salt and don't necessarily
represent good style.  This is why improving the docs with good
examples is important, imho.


-uwe


Re: CVS commit: src/lib/libutil

2024-04-08 Thread Roland Illig
Am 08.04.2024 um 21:18 schrieb Valery Ushakov:
>   "=\017FIFTEEN\0"
>
> with its result a few lines below that has:
>
>   BURST=0xf=FIFTEEN

Thank you for explaining this example. I had a gut feeling that there
would be some hidden correlation between some octal/hexadecimal
combinations, but I couldn't name it. Indeed, if the number base for
output is hexadecimal, the field comparisons should be done in
hexadecimal as well.

I adjusted the description and examples in the manual page accordingly.

Roland



Re: CVS commit: src/lib/libutil

2024-04-08 Thread Valery Ushakov
On Mon, Apr 08, 2024 at 20:21:07 +0200, Roland Illig wrote:

> I didn't eradicate _all_ hexadecimal examples, I just made each example
> use only one number base, not mix them both. There are both octal and
> hexadecimal examples in the manual page.

That's not what "prefer octal in examples" conveys.

I would also say that source code that says

  "=\x0f" "FIFTEEN\0"

aligns much better than

  "=\017FIFTEEN\0"

with its result a few lines below that has:

  BURST=0xf=FIFTEEN


-uwe


Re: CVS commit: src/lib/libutil

2024-04-08 Thread Roland Illig
Am 08.04.2024 um 03:24 schrieb Valery Ushakov:
> On Sun, Apr 07, 2024 at 14:28:27 +, Roland Illig wrote:
>
>> Log Message:
>> snprintb.3: clean up formatting and wording, prefer octal in examples
>>
>> Using hexadecimal character escapes requires separate string literals if
>> the description starts with one of the letters A-F; octal character
>> escapes have at most 3 digits, reducing ambiguity.
>
> 70s are over, very few people speak octal fluently.  If anything, the
> man page should highlight the potential snag.  Besides, separate
> literal for the name is good for readability anyway.

When I looked through the NetBSD tree exploring the current usage, I
found that a significant majority uses octal instead of hexadecimal. I
don't know the exact reasons for this, it might be due to existing
practice in the 1990s, to avoid splitting the bit position and the
description to separate string literals, to be able to easily split the
bit position into the byte and the bit portion mentally, or maybe
something entirely different.

While your claim that "very few people speak octal fluently" may be true
for programmers in general, I expect those using the snprintb function
to be more fluent than others. Of course, I saw cases where "\040" was
followed by "\039", just as I saw cases of "\x0fFIELD". Lint now warns
in both these cases.

Regarding the separate literals, I didn't see them in wide use up to
now. Existing code seems to focus more on compressing the source code
into as few lines as possible rather than making it easily readable. I
agree that separate string literals are more readable, and I converted
the example that uses hexadecimal escapes to this style.

I didn't eradicate _all_ hexadecimal examples, I just made each example
use only one number base, not mix them both. There are both octal and
hexadecimal examples in the manual page.

Roland



Re: CVS commit: src/lib/libutil

2024-04-07 Thread Valery Ushakov
On Sun, Apr 07, 2024 at 14:28:27 +, Roland Illig wrote:

> Log Message:
> snprintb.3: clean up formatting and wording, prefer octal in examples
> 
> Using hexadecimal character escapes requires separate string literals if
> the description starts with one of the letters A-F; octal character
> escapes have at most 3 digits, reducing ambiguity.

70s are over, very few people speak octal fluently.  If anything, the
man page should highlight the potential snag.  Besides, separate
literal for the name is good for readability anyway.

Please, revert.

-uwe


CVS commit: src/lib/libutil

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 14:28:27 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb.3: clean up formatting and wording, prefer octal in examples

Using hexadecimal character escapes requires separate string literals if
the description starts with one of the letters A-F; octal character
escapes have at most 3 digits, reducing ambiguity.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libutil/snprintb.3

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

Modified files:

Index: src/lib/libutil/snprintb.3
diff -u src/lib/libutil/snprintb.3:1.37 src/lib/libutil/snprintb.3:1.38
--- src/lib/libutil/snprintb.3:1.37	Sun Apr  7 12:05:23 2024
+++ src/lib/libutil/snprintb.3	Sun Apr  7 14:28:26 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: snprintb.3,v 1.37 2024/04/07 12:05:23 rillig Exp $
+.\" $NetBSD: snprintb.3,v 1.38 2024/04/07 14:28:26 rillig Exp $
 .\"
 .\" Copyright (c) 1998, 2024 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 22, 2024
+.Dd April 7, 2024
 .Dt SNPRINTB 3
 .Os
 .Sh NAME
@@ -180,10 +180,10 @@ followed by type-specific parameters, ea
 followed by a
 .Tn NUL Ns -terminated description.
 The bit positions are 0-based,
-they range from
-.Sq \e000
-for the least significant bit to
-.Sq \e077
+ranging from
+.Ql \e000
+(0) for the least significant bit to
+.Ql \e077
 (63) for the most significant bit.
 .
 .Bl -tag -width Cm
@@ -252,15 +252,15 @@ If none of the previous
 .Sq Cm \&=
 or
 .Sq Cm \&:
-conversions matched, prints the field value, using the
-.Xr printf 3
-format
-.Ar fmt .
+conversions matched, prints the format string
+.Ar fmt
+via
+.Xr printf 3 .
 The format string
 .Ar fmt
 may contain a single
 .Vt uintmax_t
-conversion specification that prints the value that did not match.
+conversion specification to print the field value that did not match.
 .El
 .Pp
 The new format is terminated by an additional
@@ -285,15 +285,15 @@ total number of bytes.
 .Sh EXAMPLES
 Two examples of the old formatting style:
 .Bd -literal -offset indent
-snprintb(buf, bufsize, "\e10\e2BITTWO\e1BITONE", 3)
+snprintb(buf, bufsize, "\e010\e002BITTWO\e001BITONE", 3)
 \(rA "03"
 
 snprintb(buf, bufsize,
-"\e20"
-"\ex10NOTBOOT" "\ex0f""FPP" "\ex0eSDVMA"
-"\ex0cVIDEO" "\ex0bLORES" "\ex0a""FPA" "\ex09""DIAG"
-"\ex07""CACHE" "\ex06IOCACHE" "\ex05LOOPBACK"
-"\ex04""DBGCACHE",
+"\e020"
+"\ex10""NOTBOOT"   "\ex0f""FPP"   "\ex0e""SDVMA"
+"\ex0c""VIDEO" "\ex0b""LORES" "\ex0a""FPA"
+"\ex09""DIAG"  "\ex07""CACHE" "\ex06""IOCACHE"
+"\ex05""LOOPBACK"  "\ex04""DBGCACHE",
 0xe860)
 \(rA "0xe860"
 .Ed
@@ -302,9 +302,9 @@ An example of the new formatting style:
 .Bd -literal -offset indent
 snprintb(buf, bufsize,
 "\e177\e020"
-"b\e0LSB\e0" "b\e1BITONE\e0" "f\e4\e4NIBBLE2\e0"
-"f\ex10\e4BURST\e0" "=\e4FOUR\e0" "=\exf""FIFTEEN\e0"
-"b\ex1fMSB\e0",
+"b\e000LSB\e0" "b\e001BITONE\e0" "f\e004\e004NIBBLE2\e0"
+"f\e020\e004BURST\e0" "=\e004FOUR\e0" "=\e017FIFTEEN\e0"
+"b\e037MSB\e0",
 0x800f0701)
 \(rA "0x800f0701"
 .Ed
@@ -313,9 +313,9 @@ The same example using snprintb_m:
 .Bd -literal -offset indent
 snprintb_m(buf, bufsize,
 "\e177\e020"
-"b\e0LSB\e0" "b\e1BITONE\e0" "f\e4\e4NIBBLE2\e0"
-"f\ex10\e4BURST\e0" "=\e4FOUR\e0" "=\exf""FIFTEEN\e0"
-"b\ex1fMSB\e0",
+"b\e000LSB\e0" "b\e001BITONE\e0" "f\e004\e004NIBBLE2\e0"
+"f\e020\e004BURST\e0" "=\e004FOUR\e0" "=\e017FIFTEEN\e0"
+"b\e037MSB\e0",
 0x800f0701, 34)
 \(rA "0x800f0701\e0"
"0x800f0701\e0"



CVS commit: src/lib/libutil

2024-04-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Apr  7 14:28:27 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb.3: clean up formatting and wording, prefer octal in examples

Using hexadecimal character escapes requires separate string literals if
the description starts with one of the letters A-F; octal character
escapes have at most 3 digits, reducing ambiguity.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libutil/snprintb.3

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



CVS commit: src/lib/libedit

2024-04-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  6 13:36:11 UTC 2024

Modified Files:
src/lib/libedit: editline.7

Log Message:
update em-toggle-overwrite binding (Xose Vazquez Perez)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libedit/editline.7

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

Modified files:

Index: src/lib/libedit/editline.7
diff -u src/lib/libedit/editline.7:1.5 src/lib/libedit/editline.7:1.6
--- src/lib/libedit/editline.7:1.5	Mon May  9 17:27:55 2016
+++ src/lib/libedit/editline.7	Sat Apr  6 09:36:11 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.7,v 1.5 2016/05/09 21:27:55 christos Exp $
+.\"	$NetBSD: editline.7,v 1.6 2024/04/06 13:36:11 christos Exp $
 .\"	$OpenBSD: editline.7,v 1.1 2016/04/20 01:11:45 schwarze Exp $
 .\"
 .\" Copyright (c) 2016 Ingo Schwarze 
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd May 7, 2016
+.Dd April 6, 2024
 .Dt EDITLINE 7
 .Os
 .Sh NAME
@@ -546,7 +546,7 @@ It is an error if the cursor is already 
 buffer.
 .It Ic em-set-mark Pq emacs: Ctrl-Q, NUL
 Set the mark at the current cursor position.
-.It Ic em-toggle-overwrite Pq not bound by default
+.It Ic em-toggle-overwrite Pq insert
 Switch from insert to overwrite mode or vice versa.
 .It Ic em-universal-argument Pq not bound by default
 If in argument input mode, multiply the argument by 4.



CVS commit: src/lib/libedit

2024-04-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  6 13:36:11 UTC 2024

Modified Files:
src/lib/libedit: editline.7

Log Message:
update em-toggle-overwrite binding (Xose Vazquez Perez)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libedit/editline.7

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



CVS commit: src/lib/libterminfo

2024-04-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  5 22:30:18 UTC 2024

Modified Files:
src/lib/libterminfo: genman

Log Message:
>From Jan-Benedict Glaw:

Use `printf` instead of `echo` for precise output

`man` pages generated under NetBSD and Linux differ as the escape codes
may or may not be interpreted when going through those two chained `echo`es.
Instead just use `printf`, which produces the desired output, always.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libterminfo/genman

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



CVS commit: src/lib/libterminfo

2024-04-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  5 22:30:18 UTC 2024

Modified Files:
src/lib/libterminfo: genman

Log Message:
>From Jan-Benedict Glaw:

Use `printf` instead of `echo` for precise output

`man` pages generated under NetBSD and Linux differ as the escape codes
may or may not be interpreted when going through those two chained `echo`es.
Instead just use `printf`, which produces the desired output, always.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libterminfo/genman

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

Modified files:

Index: src/lib/libterminfo/genman
diff -u src/lib/libterminfo/genman:1.5 src/lib/libterminfo/genman:1.6
--- src/lib/libterminfo/genman:1.5	Fri Jan 25 07:52:45 2013
+++ src/lib/libterminfo/genman	Fri Apr  5 18:30:18 2024
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: genman,v 1.5 2013/01/25 12:52:45 roy Exp $
+# $NetBSD: genman,v 1.6 2024/04/05 22:30:18 christos Exp $
 
 # Copyright (c) 2009, 2013 The NetBSD Foundation, Inc.
 #
@@ -44,11 +44,11 @@ gentab()
 	# Generate a list of long names and codes
 	$TOOL_SED -n \
 	-e "s/#define t_\([^(]*\).*>$tab\[TICODE_\([^]]*\).*/\1 \2/p" \
-	$ti | $TOOL_SORT | while read name code foo; do
+	$ti | $TOOL_SORT | while read name code _; do
 		cap=$($TOOL_SED -ne "s/.*{ \"\(..\)\", TICODE_$code }.*/\1/p" \
 		$tc | head -n 1)
 		desc=$($TOOL_SED -ne "s/ \* $name\: \(.*\)/\1/p" $ti)
-		echo ".It \"\\&$name\" Ta Sy \"\\&$code\" Ta Sy \"\\&$cap\" Ta \"\\&$desc\""
+		printf '.It "\\&%s" Ta Sy "\\&%s" Ta Sy "\\&%s" Ta "\\&%s"\n' "${name}" "${code}" "${cap}" "${desc}"
 	done
 }
 
@@ -56,15 +56,15 @@ boolcaps=$(gentab $TERMH $TERMC flags)
 numcaps=$(gentab $TERMH $TERMC nums)
 strcaps=$(gentab $TERMH $TERMC strs)
 
-echo ".\\\"DO NOT EDIT"
-echo ".\\\"Automatically generated from termcap.5.in"
-echo ".\\\""
+printf '.\\"DO NOT EDIT\n'
+printf '.\\"Automatically generated from termcap.5.in\n'
+printf '.\\"\n'
 
 while read -r line; do
 	case "$line" in
-	"@BOOLCAPS@")	echo "$boolcaps";;
-	"@NUMCAPS@")	echo "$numcaps";;
-	"@STRCAPS@")	echo "$strcaps";;
-	*)		echo "$line";;
+	"@BOOLCAPS@")	printf '%s\n' "${boolcaps}";;
+	"@NUMCAPS@")	printf '%s\n' "${numcaps}";;
+	"@STRCAPS@")	printf '%s\n' "${strcaps}";;
+	*)		printf '%s\n' "${line}";;
 	esac
 done <$TERMM



CVS commit: src/lib/librumpuser

2024-04-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  4 17:27:23 UTC 2024

Modified Files:
src/lib/librumpuser: rumpuser_daemonize.c

Log Message:
rumpuser(3): New RUMP_STDOUT, RUMP_STDERR environment variables.

If set, then when rump daemonizes, it opens the path in RUMP_STDOUT
and redirects fd 1 to that (which mostly gets the kernel console
output), and opens the path in RUMP_STDERR and redirects fd 2 to that
(no idea what this gets but it's probably good to record if it ever
gets anything).

This will allow tests that rely on rump_server daemons to stash the
output for diagnostics in case, e.g., the rump kernel crashes.

PR bin/58112


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/librumpuser/rumpuser_daemonize.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/librumpuser/rumpuser_daemonize.c
diff -u src/lib/librumpuser/rumpuser_daemonize.c:1.8 src/lib/librumpuser/rumpuser_daemonize.c:1.9
--- src/lib/librumpuser/rumpuser_daemonize.c:1.8	Thu Aug  3 20:45:49 2023
+++ src/lib/librumpuser/rumpuser_daemonize.c	Thu Apr  4 17:27:23 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser_daemonize.c,v 1.8 2023/08/03 20:45:49 andvar Exp $	*/
+/*	$NetBSD: rumpuser_daemonize.c,v 1.9 2024/04/04 17:27:23 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 #include "rumpuser_port.h"
 
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser_daemonize.c,v 1.8 2023/08/03 20:45:49 andvar Exp $");
+__RCSID("$NetBSD: rumpuser_daemonize.c,v 1.9 2024/04/04 17:27:23 riastradh Exp $");
 #endif /* !lint */
 
 #include 
@@ -53,6 +53,27 @@ static int daemonpipe[2];
 
 #include 
 
+static int
+openstdoutstderr(void)
+{
+	char path[PATH_MAX];
+	int fd;
+
+	if (getenv_r("RUMP_STDOUT", path, sizeof(path)) == 0) {
+		if ((fd = open(path, O_WRONLY|O_CREAT)) == -1)
+			return -1;
+		dup2(fd, STDOUT_FILENO);
+		(void)close(fd);
+	}
+	if (getenv_r("RUMP_STDERR", path, sizeof(path)) == 0) {
+		if ((fd = open(path, O_WRONLY|O_CREAT)) == -1)
+			return -1;
+		dup2(fd, STDERR_FILENO);
+		(void)close(fd);
+	}
+	return 0;
+}
+
 int
 rumpuser_daemonize_begin(void)
 {
@@ -82,6 +103,13 @@ rumpuser_daemonize_begin(void)
 		goto out;
 	}
 
+	if (openstdoutstderr() == -1) {
+		rv = errno;
+		(void)close(daemonpipe[0]);
+		(void)close(daemonpipe[1]);
+		goto out;
+	}
+
 	switch (fork()) {
 	case 0:
 		if (setsid() == -1) {
@@ -125,8 +153,10 @@ rumpuser_daemonize_done(int error)
 			goto out;
 		}
 		dup2(fd, STDIN_FILENO);
-		dup2(fd, STDOUT_FILENO);
-		dup2(fd, STDERR_FILENO);
+		if (getenv("RUMP_STDOUT") == NULL)
+			dup2(fd, STDOUT_FILENO);
+		if (getenv("RUMP_STDERR") == NULL)
+			dup2(fd, STDERR_FILENO);
 		if (fd > STDERR_FILENO)
 			close(fd);
 	}



CVS commit: src/lib/librumpuser

2024-04-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Apr  4 17:27:23 UTC 2024

Modified Files:
src/lib/librumpuser: rumpuser_daemonize.c

Log Message:
rumpuser(3): New RUMP_STDOUT, RUMP_STDERR environment variables.

If set, then when rump daemonizes, it opens the path in RUMP_STDOUT
and redirects fd 1 to that (which mostly gets the kernel console
output), and opens the path in RUMP_STDERR and redirects fd 2 to that
(no idea what this gets but it's probably good to record if it ever
gets anything).

This will allow tests that rely on rump_server daemons to stash the
output for diagnostics in case, e.g., the rump kernel crashes.

PR bin/58112


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/librumpuser/rumpuser_daemonize.c

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



CVS commit: src/lib/libm

2024-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 18:53:42 UTC 2024

Modified Files:
src/lib/libm/ld80: b_tgammal.c e_lgammal_r.c s_cexpl.c s_cospil.c
s_erfl.c s_exp2l.c s_expl.c s_logl.c s_sinpil.c s_tanpil.c
src/lib/libm/src: e_acoshl.c e_atanhl.c e_coshl.c e_sinhl.c s_asinhl.c
s_cbrtl.c s_clogl.c s_cosl.c s_sincosl.c s_sinl.c s_tanhl.c
s_tanl.c

Log Message:
remove #include  for i386 now that it is included in math_private.h


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/ld80/b_tgammal.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/ld80/e_lgammal_r.c \
src/lib/libm/ld80/s_cexpl.c src/lib/libm/ld80/s_cospil.c \
src/lib/libm/ld80/s_erfl.c src/lib/libm/ld80/s_exp2l.c \
src/lib/libm/ld80/s_expl.c src/lib/libm/ld80/s_logl.c \
src/lib/libm/ld80/s_sinpil.c src/lib/libm/ld80/s_tanpil.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/e_acoshl.c \
src/lib/libm/src/e_atanhl.c src/lib/libm/src/s_asinhl.c \
src/lib/libm/src/s_cbrtl.c src/lib/libm/src/s_sincosl.c \
src/lib/libm/src/s_tanhl.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/e_coshl.c src/lib/libm/src/s_sinl.c \
src/lib/libm/src/s_tanl.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/e_sinhl.c \
src/lib/libm/src/s_clogl.c src/lib/libm/src/s_cosl.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/libm/ld80/b_tgammal.c
diff -u src/lib/libm/ld80/b_tgammal.c:1.2 src/lib/libm/ld80/b_tgammal.c:1.3
--- src/lib/libm/ld80/b_tgammal.c:1.2	Mon Jan 22 07:15:19 2024
+++ src/lib/libm/ld80/b_tgammal.c	Wed Apr  3 14:53:41 2024
@@ -53,10 +53,6 @@
 #error "Unsupported long double format"
 #endif
 
-#ifdef __i386__
-#include 
-#endif
-
 #include "math.h"
 #include "math_private.h"
 

Index: src/lib/libm/ld80/e_lgammal_r.c
diff -u src/lib/libm/ld80/e_lgammal_r.c:1.1 src/lib/libm/ld80/e_lgammal_r.c:1.2
--- src/lib/libm/ld80/e_lgammal_r.c:1.1	Sun Jan 21 13:53:16 2024
+++ src/lib/libm/ld80/e_lgammal_r.c	Wed Apr  3 14:53:41 2024
@@ -17,10 +17,6 @@
  * Converted to long double by Steven G. Kargl.
  */
 
-#ifdef __i386__
-#include 
-#endif
-
 #include "math.h"
 #include "math_private.h"
 
Index: src/lib/libm/ld80/s_cexpl.c
diff -u src/lib/libm/ld80/s_cexpl.c:1.1 src/lib/libm/ld80/s_cexpl.c:1.2
--- src/lib/libm/ld80/s_cexpl.c:1.1	Sun Jan 21 13:53:17 2024
+++ src/lib/libm/ld80/s_cexpl.c	Wed Apr  3 14:53:41 2024
@@ -31,9 +31,6 @@
 #include 
 #include 
 #include 
-#ifdef __i386__
-#include 
-#endif
 
 #include "fpmath.h"
 #include "math.h"
Index: src/lib/libm/ld80/s_cospil.c
diff -u src/lib/libm/ld80/s_cospil.c:1.1 src/lib/libm/ld80/s_cospil.c:1.2
--- src/lib/libm/ld80/s_cospil.c:1.1	Sun Jan 21 13:53:17 2024
+++ src/lib/libm/ld80/s_cospil.c	Wed Apr  3 14:53:41 2024
@@ -28,9 +28,6 @@
  * See ../src/s_cospi.c for implementation details.
  */
 
-#ifdef __i386__
-#include 
-#endif
 #include 
 
 #include "math.h"
Index: src/lib/libm/ld80/s_erfl.c
diff -u src/lib/libm/ld80/s_erfl.c:1.1 src/lib/libm/ld80/s_erfl.c:1.2
--- src/lib/libm/ld80/s_erfl.c:1.1	Sun Jan 21 13:53:17 2024
+++ src/lib/libm/ld80/s_erfl.c	Wed Apr  3 14:53:41 2024
@@ -17,9 +17,6 @@
  * Converted to long double by Steven G. Kargl.
  */
 #include 
-#ifdef __i386__
-#include 
-#endif
 
 #include "math.h"
 #include "math_private.h"
Index: src/lib/libm/ld80/s_exp2l.c
diff -u src/lib/libm/ld80/s_exp2l.c:1.1 src/lib/libm/ld80/s_exp2l.c:1.2
--- src/lib/libm/ld80/s_exp2l.c:1.1	Sun Jan 21 13:53:17 2024
+++ src/lib/libm/ld80/s_exp2l.c	Wed Apr  3 14:53:41 2024
@@ -30,10 +30,6 @@
 #include 
 #include 
 
-#ifdef __i386__
-#include 
-#endif
-
 #ifdef __FreeBSD__
 #include "fpmath.h"
 #endif
Index: src/lib/libm/ld80/s_expl.c
diff -u src/lib/libm/ld80/s_expl.c:1.1 src/lib/libm/ld80/s_expl.c:1.2
--- src/lib/libm/ld80/s_expl.c:1.1	Sun Jan 21 13:53:17 2024
+++ src/lib/libm/ld80/s_expl.c	Wed Apr  3 14:53:41 2024
@@ -41,10 +41,6 @@
 
 #include 
 
-#ifdef __i386__
-#include 
-#endif
-
 #ifdef __FreeBSD__
 #include "fpmath.h"
 #endif
Index: src/lib/libm/ld80/s_logl.c
diff -u src/lib/libm/ld80/s_logl.c:1.1 src/lib/libm/ld80/s_logl.c:1.2
--- src/lib/libm/ld80/s_logl.c:1.1	Sun Jan 21 13:53:17 2024
+++ src/lib/libm/ld80/s_logl.c	Wed Apr  3 14:53:41 2024
@@ -78,10 +78,6 @@
 #include 
 #endif
 
-#ifdef __i386__
-#include 
-#endif
-
 #ifdef __FreeBSD__
 #include "fpmath.h"
 #endif
Index: src/lib/libm/ld80/s_sinpil.c
diff -u src/lib/libm/ld80/s_sinpil.c:1.1 src/lib/libm/ld80/s_sinpil.c:1.2
--- src/lib/libm/ld80/s_sinpil.c:1.1	Sun Jan 21 13:53:17 2024
+++ src/lib/libm/ld80/s_sinpil.c	Wed Apr  3 14:53:41 2024
@@ -28,9 +28,6 @@
  * See ../src/s_sinpi.c for implementation details.
  */
 
-#ifdef __i386__
-#include 
-#endif
 #include 
 
 #include "math.h"
Index: src/lib/libm/ld80/s_tanpil.c
diff -u src/lib/libm/ld80/s_tanpil.c:1.1 src/lib/libm/ld80/s_tanpil.c:1.2
--- src/lib/libm/ld80/s_tanpil.c:1.1	Sun Jan 21 13:53:17 2024
+++ 

CVS commit: src/lib/libm

2024-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 18:53:42 UTC 2024

Modified Files:
src/lib/libm/ld80: b_tgammal.c e_lgammal_r.c s_cexpl.c s_cospil.c
s_erfl.c s_exp2l.c s_expl.c s_logl.c s_sinpil.c s_tanpil.c
src/lib/libm/src: e_acoshl.c e_atanhl.c e_coshl.c e_sinhl.c s_asinhl.c
s_cbrtl.c s_clogl.c s_cosl.c s_sincosl.c s_sinl.c s_tanhl.c
s_tanl.c

Log Message:
remove #include  for i386 now that it is included in math_private.h


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/ld80/b_tgammal.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/ld80/e_lgammal_r.c \
src/lib/libm/ld80/s_cexpl.c src/lib/libm/ld80/s_cospil.c \
src/lib/libm/ld80/s_erfl.c src/lib/libm/ld80/s_exp2l.c \
src/lib/libm/ld80/s_expl.c src/lib/libm/ld80/s_logl.c \
src/lib/libm/ld80/s_sinpil.c src/lib/libm/ld80/s_tanpil.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/e_acoshl.c \
src/lib/libm/src/e_atanhl.c src/lib/libm/src/s_asinhl.c \
src/lib/libm/src/s_cbrtl.c src/lib/libm/src/s_sincosl.c \
src/lib/libm/src/s_tanhl.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/e_coshl.c src/lib/libm/src/s_sinl.c \
src/lib/libm/src/s_tanl.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/e_sinhl.c \
src/lib/libm/src/s_clogl.c src/lib/libm/src/s_cosl.c

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



CVS commit: src/lib/libm/src

2024-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 14:54:51 UTC 2024

Modified Files:
src/lib/libm/src: s_cbrtl.c

Log Message:
need  for i386.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_cbrtl.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/libm/src/s_cbrtl.c
diff -u src/lib/libm/src/s_cbrtl.c:1.2 src/lib/libm/src/s_cbrtl.c:1.3
--- src/lib/libm/src/s_cbrtl.c:1.2	Tue Apr  2 21:51:01 2024
+++ src/lib/libm/src/s_cbrtl.c	Wed Apr  3 10:54:50 2024
@@ -14,10 +14,11 @@
  * and David A. Schultz.
  */
 #include 
-__RCSID("$NetBSD: s_cbrtl.c,v 1.2 2024/04/03 01:51:01 christos Exp $");
+__RCSID("$NetBSD: s_cbrtl.c,v 1.3 2024/04/03 14:54:50 christos Exp $");
 
 
 #include "namespace.h"
+#include 
 #include 
 #include 
 



CVS commit: src/lib/libm/src

2024-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 14:54:51 UTC 2024

Modified Files:
src/lib/libm/src: s_cbrtl.c

Log Message:
need  for i386.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_cbrtl.c

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



CVS commit: src/lib/libm/src

2024-04-02 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Apr  3 04:40:23 UTC 2024

Modified Files:
src/lib/libm/src: math_private.h

Log Message:
For i386, if ft[sg]etprec() are to be used, ensure there's a
prototype for them in scope (so include )

Might fix the i386 build.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libm/src/math_private.h

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

Modified files:

Index: src/lib/libm/src/math_private.h
diff -u src/lib/libm/src/math_private.h:1.31 src/lib/libm/src/math_private.h:1.32
--- src/lib/libm/src/math_private.h:1.31	Tue Jan 23 15:45:07 2024
+++ src/lib/libm/src/math_private.h	Wed Apr  3 04:40:23 2024
@@ -11,7 +11,7 @@
 
 /*
  * from: @(#)fdlibm.h 5.1 93/09/24
- * $NetBSD: math_private.h,v 1.31 2024/01/23 15:45:07 christos Exp $
+ * $NetBSD: math_private.h,v 1.32 2024/04/03 04:40:23 kre Exp $
  */
 
 #ifndef _MATH_PRIVATE_H_
@@ -348,6 +348,9 @@ do {\
 
 /* Support switching the mode to FP_PE if necessary. */
 #if defined(__i386__) && !defined(NO_FPSETPREC)
+
+#include 
+
 #define	ENTERI() ENTERIT(long double)
 #define	ENTERIT(returntype)			\
 	returntype __retval;			\



CVS commit: src/lib/libm/src

2024-04-02 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Apr  3 04:40:23 UTC 2024

Modified Files:
src/lib/libm/src: math_private.h

Log Message:
For i386, if ft[sg]etprec() are to be used, ensure there's a
prototype for them in scope (so include )

Might fix the i386 build.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libm/src/math_private.h

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



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 01:51:02 UTC 2024

Modified Files:
src/lib/libm/src: s_cbrtl.c

Log Message:
reduce diff with FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_cbrtl.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/libm/src/s_cbrtl.c
diff -u src/lib/libm/src/s_cbrtl.c:1.1 src/lib/libm/src/s_cbrtl.c:1.2
--- src/lib/libm/src/s_cbrtl.c:1.1	Tue Nov 19 14:24:34 2013
+++ src/lib/libm/src/s_cbrtl.c	Tue Apr  2 21:51:01 2024
@@ -13,12 +13,9 @@
  * written by Steven G. Kargl with input from Bruce D. Evans
  * and David A. Schultz.
  */
-
 #include 
-__RCSID("$NetBSD: s_cbrtl.c,v 1.1 2013/11/19 19:24:34 joerg Exp $");
-#if 0
-__FBSDID("$FreeBSD: head/lib/msun/src/s_cbrtl.c 238924 2012-07-30 21:58:28Z kargl $");
-#endif
+__RCSID("$NetBSD: s_cbrtl.c,v 1.2 2024/04/03 01:51:01 christos Exp $");
+
 
 #include "namespace.h"
 #include 
@@ -30,44 +27,48 @@ __FBSDID("$FreeBSD: head/lib/msun/src/s_
 #ifdef __HAVE_LONG_DOUBLE
 __weak_alias(cbrtl, _cbrtl)
 
+#define	BIAS	(LDBL_MAX_EXP - 1)
+
 static const unsigned
 B1 = 709958130;	/* B1 = (127-127.0/3-0.03306235651)*2**23 */
 
 long double
 cbrtl(long double x)
 {
-	union ieee_ext_u ux, vx;
+	union ieee_ext_u u, v;
 	long double r, s, t, w;
 	double dr, dt, dx;
 	float ft, fx;
 	uint32_t hx;
+	uint16_t expsign;
 	int k;
 
-	ux.extu_ld = x;
-
+	u.extu_ld = x;
+	expsign = GET_EXPSIGN();
+	k = expsign & 0x7fff;
 
 	/*
 	 * If x = +-Inf, then cbrt(x) = +-Inf.
 	 * If x = NaN, then cbrt(x) = NaN.
 	 */
-	if (ux.extu_exp == EXT_EXP_INFNAN)
+	if (k == BIAS + LDBL_MAX_EXP)
 		return (x + x);
-	if ((ux.extu_frach | ux.extu_fracl | ux.extu_exp) == 0)
-		return (x);
 
-	vx.extu_ld = 1;
-	vx.extu_ext.ext_sign = ux.extu_ext.ext_sign;
-	ux.extu_ext.ext_sign = 0;
-	if (ux.extu_exp == 0) {
+	ENTERI();
+	if (k == 0) {
+		/* If x = +-0, then cbrt(x) = +-0. */
+		if ((u.extu_frach | u.extu_fracl) == 0)
+			RETURNI(x);
 		/* Adjust subnormal numbers. */
-		ux.extu_ld *= 0x1.0p514;
-		k = ux.extu_exp - EXT_EXP_BIAS - 514;
-	} else {
-		k = ux.extu_exp - EXT_EXP_BIAS;
-	}
+		u.extu_ld *= 0x1.0p514;
+		k = u.extu_exp;
+		k -= BIAS + 514;
+ 	} else
+		k -= BIAS;
+	SET_EXPSIGN(, BIAS);
+	v.extu_ld = 1; 
 
-	ux.extu_exp = EXT_EXP_BIAS;
-	x = ux.extu_ld;
+	x = u.extu_ld;
 	switch (k % 3) {
 	case 1:
 	case -2:
@@ -80,7 +81,7 @@ cbrtl(long double x)
 		k -= 2;
 		break;
 	}
-	vx.extu_exp = EXT_EXP_BIAS + k / 3;
+	SET_EXPSIGN(, (expsign & 0x8000) | (BIAS + k / 3));
 
 	/*
 	 * The following is the guts of s_cbrtf, with the handling of
@@ -136,10 +137,9 @@ cbrtl(long double x)
 	r=x/s;/* error <= 0.5 ulps; |r| < |t| */
 	w=t+t;/* t+t is exact */
 	r=(r-t)/(w+r);			/* r-t is exact; w+r ~= 3*t */
-	t=t+t*r;			/* error <= 0.5 + 0.5/3 + epsilon */
+	t=t+t*r;			/* error <= (0.5 + 0.5/3) * ulp */
 
-	t *= vx.extu_ld;
-	return t;
+	t *= v.extu_ld;
+	RETURNI(t);
 }
-
 #endif /* __HAVE_LONG_DOUBLE */



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  3 01:51:02 UTC 2024

Modified Files:
src/lib/libm/src: s_cbrtl.c

Log Message:
reduce diff with FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_cbrtl.c

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



CVS commit: src/lib/libc/arch/sparc/gen

2024-04-02 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr  2 20:42:13 UTC 2024

Modified Files:
src/lib/libc/arch/sparc/gen: fpsetround.c

Log Message:
sparc/fpsetround: fix the nearby signed integer overflow as well

Same as for sparc64 a few days ago.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/sparc/gen/fpsetround.c

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



CVS commit: src/lib/libc/arch/sparc/gen

2024-04-02 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr  2 20:42:13 UTC 2024

Modified Files:
src/lib/libc/arch/sparc/gen: fpsetround.c

Log Message:
sparc/fpsetround: fix the nearby signed integer overflow as well

Same as for sparc64 a few days ago.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/sparc/gen/fpsetround.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/arch/sparc/gen/fpsetround.c
diff -u src/lib/libc/arch/sparc/gen/fpsetround.c:1.7 src/lib/libc/arch/sparc/gen/fpsetround.c:1.8
--- src/lib/libc/arch/sparc/gen/fpsetround.c:1.7	Tue Apr  2 20:27:44 2024
+++ src/lib/libc/arch/sparc/gen/fpsetround.c	Tue Apr  2 20:42:12 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetround.c,v 1.7 2024/04/02 20:27:44 christos Exp $	*/
+/*	$NetBSD: fpsetround.c,v 1.8 2024/04/02 20:42:12 rillig Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 10, 1995
@@ -7,7 +7,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetround.c,v 1.7 2024/04/02 20:27:44 christos Exp $");
+__RCSID("$NetBSD: fpsetround.c,v 1.8 2024/04/02 20:42:12 rillig Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -27,8 +27,8 @@ fpsetround(fp_rnd rnd_dir)
 	__asm("st %%fsr,%0" : "=m" (*));
 
 	new = old;
-	new &= ~(0x03U << 30); 
-	new |= ((rnd_dir & 0x03) << 30);
+	new &= ~(0x03U << 30);
+	new |= ((rnd_dir & 0x03U) << 30);
 
 	__asm("ld %0,%%fsr" : : "m" (*));
 



CVS commit: src/lib/libc/arch/sparc/gen

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 20:27:44 UTC 2024

Modified Files:
src/lib/libc/arch/sparc/gen: fpsetround.c

Log Message:
fix lint


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/sparc/gen/fpsetround.c

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



CVS commit: src/lib/libc/arch/sparc/gen

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 20:27:44 UTC 2024

Modified Files:
src/lib/libc/arch/sparc/gen: fpsetround.c

Log Message:
fix lint


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/sparc/gen/fpsetround.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/arch/sparc/gen/fpsetround.c
diff -u src/lib/libc/arch/sparc/gen/fpsetround.c:1.6 src/lib/libc/arch/sparc/gen/fpsetround.c:1.7
--- src/lib/libc/arch/sparc/gen/fpsetround.c:1.6	Tue Mar 20 20:38:35 2012
+++ src/lib/libc/arch/sparc/gen/fpsetround.c	Tue Apr  2 16:27:44 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetround.c,v 1.6 2012/03/21 00:38:35 christos Exp $	*/
+/*	$NetBSD: fpsetround.c,v 1.7 2024/04/02 20:27:44 christos Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 10, 1995
@@ -7,7 +7,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetround.c,v 1.6 2012/03/21 00:38:35 christos Exp $");
+__RCSID("$NetBSD: fpsetround.c,v 1.7 2024/04/02 20:27:44 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -27,7 +27,7 @@ fpsetround(fp_rnd rnd_dir)
 	__asm("st %%fsr,%0" : "=m" (*));
 
 	new = old;
-	new &= ~(0x03 << 30); 
+	new &= ~(0x03U << 30); 
 	new |= ((rnd_dir & 0x03) << 30);
 
 	__asm("ld %0,%%fsr" : : "m" (*));



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 18:40:50 UTC 2024

Modified Files:
src/lib/libm/src: s_fabsl.c

Log Message:
undo accidental commit.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/src/s_fabsl.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/libm/src/s_fabsl.c
diff -u src/lib/libm/src/s_fabsl.c:1.7 src/lib/libm/src/s_fabsl.c:1.8
--- src/lib/libm/src/s_fabsl.c:1.7	Tue Apr  2 14:39:51 2024
+++ src/lib/libm/src/s_fabsl.c	Tue Apr  2 14:40:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_fabsl.c,v 1.7 2024/04/02 18:39:51 christos Exp $	*/
+/*	$NetBSD: s_fabsl.c,v 1.8 2024/04/02 18:40:50 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: s_fabsl.c,v 1.7 2024/04/02 18:39:51 christos Exp $");
+__RCSID("$NetBSD: s_fabsl.c,v 1.8 2024/04/02 18:40:50 christos Exp $");
 
 #include 
 #include 
@@ -47,6 +47,7 @@ fabsl(long double x)
 	return (ux.extu_ld);
 }
 #else
+#if 0
 /* defined in libc */
 long double
 fabsl(long double x)
@@ -54,3 +55,4 @@ fabsl(long double x)
 	return fabs(x);
 }
 #endif
+#endif



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 18:40:50 UTC 2024

Modified Files:
src/lib/libm/src: s_fabsl.c

Log Message:
undo accidental commit.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/src/s_fabsl.c

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



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 18:39:51 UTC 2024

Modified Files:
src/lib/libm/src: s_fabsl.c s_rintl.c

Log Message:
PR/58054: Martin Husemann: fix bug in expsign extraction and only use the
code for the floating point formats where it works (does not work for 112
bit mantisa in sparc64)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/s_fabsl.c
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/src/s_rintl.c

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



CVS commit: src/lib/libm/src

2024-04-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  2 18:39:51 UTC 2024

Modified Files:
src/lib/libm/src: s_fabsl.c s_rintl.c

Log Message:
PR/58054: Martin Husemann: fix bug in expsign extraction and only use the
code for the floating point formats where it works (does not work for 112
bit mantisa in sparc64)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/s_fabsl.c
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/src/s_rintl.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/libm/src/s_fabsl.c
diff -u src/lib/libm/src/s_fabsl.c:1.6 src/lib/libm/src/s_fabsl.c:1.7
--- src/lib/libm/src/s_fabsl.c:1.6	Sun Feb 25 14:26:33 2024
+++ src/lib/libm/src/s_fabsl.c	Tue Apr  2 14:39:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_fabsl.c,v 1.6 2024/02/25 19:26:33 christos Exp $	*/
+/*	$NetBSD: s_fabsl.c,v 1.7 2024/04/02 18:39:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: s_fabsl.c,v 1.6 2024/02/25 19:26:33 christos Exp $");
+__RCSID("$NetBSD: s_fabsl.c,v 1.7 2024/04/02 18:39:51 christos Exp $");
 
 #include 
 #include 
@@ -47,7 +47,6 @@ fabsl(long double x)
 	return (ux.extu_ld);
 }
 #else
-#if 0
 /* defined in libc */
 long double
 fabsl(long double x)
@@ -55,4 +54,3 @@ fabsl(long double x)
 	return fabs(x);
 }
 #endif
-#endif

Index: src/lib/libm/src/s_rintl.c
diff -u src/lib/libm/src/s_rintl.c:1.5 src/lib/libm/src/s_rintl.c:1.6
--- src/lib/libm/src/s_rintl.c:1.5	Wed Aug 21 09:04:44 2013
+++ src/lib/libm/src/s_rintl.c	Tue Apr  2 14:39:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_rintl.c,v 1.5 2013/08/21 13:04:44 martin Exp $	*/
+/*	$NetBSD: s_rintl.c,v 1.6 2024/04/02 18:39:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 David Schultz 
@@ -30,7 +30,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/lib/msun/src/s_rintl.c,v 1.5 2008/02/22 11:59:05 bde Exp $");
 #else
-__RCSID("$NetBSD: s_rintl.c,v 1.5 2013/08/21 13:04:44 martin Exp $");
+__RCSID("$NetBSD: s_rintl.c,v 1.6 2024/04/02 18:39:51 christos Exp $");
 #endif
 
 #include 
@@ -40,17 +40,19 @@ __RCSID("$NetBSD: s_rintl.c,v 1.5 2013/0
 #include "math_private.h"
 
 #ifdef __HAVE_LONG_DOUBLE
+
+# if EXT_FRACBITS == 64 || EXT_FRACBITS == 113 && LDBL_MAX_EXP == 0x4000
+
+#  define BIAS (LDBL_MAX_EXP - 1)
 static const float
 shift[2] = {
-#if EXT_FRACBITS == 64
+#  if EXT_FRACBITS == 64
 	0x1.0p63, -0x1.0p63
-#elif EXT_FRACBITS == 113
+#  elif EXT_FRACBITS == 113
 	0x1.0p112, -0x1.0p112
-#elif EXT_FRACBITS == 112
-	0x1.0p111, -0x1.0p111
-#else
-#error "Unsupported long double format"
-#endif
+#  else
+#   error "Unsupported long double format"
+#  endif
 };
 static const float zero[2] = { 0.0, -0.0 };
 
@@ -63,11 +65,11 @@ rintl(long double x)
 
 	u.extu_ld = x;
 	u.extu_ext.ext_frach &= ~0x8000;
-	expsign = u.extu_ext.ext_sign;
+	expsign = GET_EXPSIGN();
 	ex = expsign & 0x7fff;
 
-	if (ex >= EXT_EXP_BIAS + EXT_FRACBITS - 1) {
-		if (ex == EXT_EXP_BIAS + EXT_FRACBITS)
+	if (ex >= BIAS + EXT_FRACBITS - 1) {
+		if (ex == BIAS + EXT_FRACBITS)
 			return (x + x);	/* Inf, NaN, or unsupported format */
 		return (x);		/* finite and already an integer */
 	}
@@ -87,9 +89,18 @@ rintl(long double x)
 	 * If the result is +-0, then it must have the same sign as x, but
 	 * the above calculation doesn't always give this.  Fix up the sign.
 	 */
-	if (ex < EXT_EXP_BIAS && x == 0.0L)
+	if (ex < BIAS && x == 0.0L)
 		return (zero[sign]);
 
 	return (x);
 }
-#endif
+# else
+
+long double
+rintl(long double x)
+{
+	return rint(x);
+}
+
+# endif
+#endif /* __HAVE_LONG_DOUBLE */



CVS commit: src/lib/libperfuse

2024-03-30 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 30 22:05:07 UTC 2024

Modified Files:
src/lib/libperfuse: perfuse.c

Log Message:
s/Unfortunatley/Unfortunately/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/lib/libperfuse/perfuse.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/libperfuse/perfuse.c
diff -u src/lib/libperfuse/perfuse.c:1.44 src/lib/libperfuse/perfuse.c:1.45
--- src/lib/libperfuse/perfuse.c:1.44	Wed Feb 23 21:54:40 2022
+++ src/lib/libperfuse/perfuse.c	Sat Mar 30 22:05:07 2024
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse.c,v 1.44 2022/02/23 21:54:40 andvar Exp $ */
+/*  $NetBSD: perfuse.c,v 1.45 2024/03/30 22:05:07 andvar Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -563,7 +563,7 @@ perfuse_init(struct perfuse_callbacks *p
 	 * It would be nice to avoid useless inactive, and only
 	 * get them on file open for writing (PUFFS does 
 	 * CLOSE/WRITE/INACTIVE, therefore actual close must be
-	 * done at INACTIVE time). Unfortunatley, puffs_setback
+	 * done at INACTIVE time). Unfortunately, puffs_setback
 	 * crashes when called on OPEN, therefore leave it for 
 	 * another day.
 	 */



CVS commit: src/lib/libperfuse

2024-03-30 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 30 22:05:07 UTC 2024

Modified Files:
src/lib/libperfuse: perfuse.c

Log Message:
s/Unfortunatley/Unfortunately/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/lib/libperfuse/perfuse.c

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



CVS commit: src/lib/libc/stdio

2024-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 22:39:41 UTC 2024

Modified Files:
src/lib/libc/stdio: fvwrite.c

Log Message:
>From enh at google dot com in tech-userlevel. Don't limit writes to BUFSIZ,
change the limit to INT_MAX; improves performance dramatically. From:
https://github.com/apple-oss-distributions/Libc/commit/\
c5a3293354e22262702a3add5b2dfc9bb0b93b85\
#diff-3b844a19cfb0aab1a23f7fbc457d3bce7453513730c489a72f66ff89d6557ff3


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/stdio/fvwrite.c

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



CVS commit: src/lib/libc/stdio

2024-03-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Mar 29 22:39:41 UTC 2024

Modified Files:
src/lib/libc/stdio: fvwrite.c

Log Message:
>From enh at google dot com in tech-userlevel. Don't limit writes to BUFSIZ,
change the limit to INT_MAX; improves performance dramatically. From:
https://github.com/apple-oss-distributions/Libc/commit/\
c5a3293354e22262702a3add5b2dfc9bb0b93b85\
#diff-3b844a19cfb0aab1a23f7fbc457d3bce7453513730c489a72f66ff89d6557ff3


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/stdio/fvwrite.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/stdio/fvwrite.c
diff -u src/lib/libc/stdio/fvwrite.c:1.30 src/lib/libc/stdio/fvwrite.c:1.31
--- src/lib/libc/stdio/fvwrite.c:1.30	Thu Jul 22 13:08:15 2021
+++ src/lib/libc/stdio/fvwrite.c	Fri Mar 29 18:39:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fvwrite.c,v 1.30 2021/07/22 17:08:15 christos Exp $	*/
+/*	$NetBSD: fvwrite.c,v 1.31 2024/03/29 22:39:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fvwrite.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fvwrite.c,v 1.30 2021/07/22 17:08:15 christos Exp $");
+__RCSID("$NetBSD: fvwrite.c,v 1.31 2024/03/29 22:39:41 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -99,11 +99,12 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 	}
 	if (fp->_flags & __SNBF) {
 		/*
-		 * Unbuffered: write up to BUFSIZ bytes at a time.
+		 * Unbuffered: write up to INT_MAX bytes at a time, to not
+		 * truncate the value of len if it is greater than 2^31 bytes.
 		 */
 		do {
 			GETIOV(;);
-			w = (*fp->_write)(fp->_cookie, p, MIN(len, BUFSIZ));
+			w = (*fp->_write)(fp->_cookie, p, MIN(len, INT_MAX));
 			if (w <= 0)
 goto err;
 			p += w;
@@ -113,7 +114,8 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 		/*
 		 * Fully buffered: fill partially full buffer, if any,
 		 * and then flush.  If there is no partial buffer, write
-		 * one _bf._size byte chunk directly (without copying).
+		 * entire payload directly (without copying) up to a multiple
+		 * of the buffer size.
 		 *
 		 * String output is a special case: write as many bytes
 		 * as fit, but pretend we wrote everything.  This makes
@@ -159,7 +161,15 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 if (fflush(fp))
 	goto err;
 			} else if (len >= (size_t)(w = fp->_bf._size)) {
-/* write directly */
+/*
+ * write directly up to INT_MAX or greatest
+ * multiple of buffer size (whatever is
+ * smaller), keeping in the memory buffer the
+ * remaining part of payload that is smaller
+ * than buffer size.
+ */
+if (w != 0)
+	w = MIN(w * (len / w), INT_MAX);
 w = (*fp->_write)(fp->_cookie, p, (size_t)w);
 if (w <= 0)
 	goto err;



CVS commit: src/lib/libm

2024-03-26 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Mar 26 20:12:47 UTC 2024

Modified Files:
src/lib/libm: Makefile

Log Message:
libm/s_logl: suppress lint warnings

Seen on sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/lib/libm/Makefile

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



CVS commit: src/lib/libm

2024-03-26 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Mar 26 20:12:47 UTC 2024

Modified Files:
src/lib/libm: Makefile

Log Message:
libm/s_logl: suppress lint warnings

Seen on sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/lib/libm/Makefile

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.226 src/lib/libm/Makefile:1.227
--- src/lib/libm/Makefile:1.226	Fri Jan 26 22:01:40 2024
+++ src/lib/libm/Makefile	Tue Mar 26 20:12:47 2024
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.226 2024/01/26 22:01:40 nros Exp $
+#  $NetBSD: Makefile,v 1.227 2024/03/26 20:12:47 rillig Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -55,6 +55,9 @@ LIBC_MACHINE_CPU?=	${MACHINE_CPU}
 
 LINTFLAGS+=	-g		# compiler_rt uses typeof() and __extension__
 LINTFLAGS+=	-X 117		# GCC sign-extends '>>' on signed int
+LINTFLAGS.s_logl.c+=	-X 161	# constant in conditional context
+LINTFLAGS.s_logl.c+=	-X 193	# unreachable statement (due to 161)
+LINTFLAGS.s_logl.c+=	-X 177	# non-constant initializer
 
 .if (${LIBC_MACHINE_CPU} == "aarch64")
 .PATH: ${.CURDIR}/arch/aarch64



CVS commit: src/lib/libedit

2024-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 26 18:02:04 UTC 2024

Modified Files:
src/lib/libedit: readline.c

Log Message:
fix insert key (Xose Vazquez Perez)


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/lib/libedit/readline.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/libedit/readline.c
diff -u src/lib/libedit/readline.c:1.181 src/lib/libedit/readline.c:1.182
--- src/lib/libedit/readline.c:1.181	Tue Apr 25 13:51:32 2023
+++ src/lib/libedit/readline.c	Tue Mar 26 14:02:04 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: readline.c,v 1.181 2023/04/25 17:51:32 christos Exp $	*/
+/*	$NetBSD: readline.c,v 1.182 2024/03/26 18:02:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: readline.c,v 1.181 2023/04/25 17:51:32 christos Exp $");
+__RCSID("$NetBSD: readline.c,v 1.182 2024/03/26 18:02:04 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -402,7 +402,7 @@ rl_initialize(void)
 	 * Allow the use of the Delete/Insert keys.
 	 */
 	el_set(e, EL_BIND, "\\e[3~", "ed-delete-next-char", NULL);
-	el_set(e, EL_BIND, "\\e[2~", "ed-quoted-insert", NULL);
+	el_set(e, EL_BIND, "\\e[2~", "em-toggle-overwrite", NULL);
 
 	/*
 	 * Ctrl-left-arrow and Ctrl-right-arrow for word moving.



CVS commit: src/lib/libedit

2024-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 26 18:02:04 UTC 2024

Modified Files:
src/lib/libedit: readline.c

Log Message:
fix insert key (Xose Vazquez Perez)


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/lib/libedit/readline.c

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



CVS commit: src/lib/libc/rpc

2024-03-22 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Mar 22 19:45:22 UTC 2024

Modified Files:
src/lib/libc/rpc: xdr_rec.c

Log Message:
Fix few typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/lib/libc/rpc/xdr_rec.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/rpc/xdr_rec.c
diff -u src/lib/libc/rpc/xdr_rec.c:1.40 src/lib/libc/rpc/xdr_rec.c:1.41
--- src/lib/libc/rpc/xdr_rec.c:1.40	Tue Jan 23 17:24:38 2024
+++ src/lib/libc/rpc/xdr_rec.c	Fri Mar 22 19:45:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: xdr_rec.c,v 1.40 2024/01/23 17:24:38 christos Exp $	*/
+/*	$NetBSD: xdr_rec.c,v 1.41 2024/03/22 19:45:22 andvar Exp $	*/
 
 /*
  * Copyright (c) 2010, Oracle America, Inc.
@@ -37,7 +37,7 @@
 static char *sccsid = "@(#)xdr_rec.c 1.21 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)xdr_rec.c	2.2 88/08/01 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: xdr_rec.c,v 1.40 2024/01/23 17:24:38 christos Exp $");
+__RCSID("$NetBSD: xdr_rec.c,v 1.41 2024/03/22 19:45:22 andvar Exp $");
 #endif
 #endif
 
@@ -242,7 +242,7 @@ xdrrec_create(
 
 
 /*
- * The reoutines defined below are the xdr ops which will go into the
+ * The routines defined below are the xdr ops which will go into the
  * xdr handle filled in by xdrrec_create.
  */
 
@@ -503,9 +503,9 @@ xdrrec_eof(XDR *xdrs)
 
 /*
  * The client must tell the package when an end-of-record has occurred.
- * The second paraemters tells whether the record should be flushed to the
+ * The second parameters tells whether the record should be flushed to the
  * (output) tcp stream.  (This let's the package support batched or
- * pipelined procedure calls.)  TRUE => immmediate flush to tcp connection.
+ * pipelined procedure calls.)  TRUE => immediate flush to tcp connection.
  */
 bool_t
 xdrrec_endofrecord(XDR *xdrs, int sendnow)



CVS commit: src/lib/libc/rpc

2024-03-22 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Mar 22 19:45:22 UTC 2024

Modified Files:
src/lib/libc/rpc: xdr_rec.c

Log Message:
Fix few typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/lib/libc/rpc/xdr_rec.c

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



CVS commit: src/lib/librmt

2024-03-22 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Mar 22 19:36:56 UTC 2024

Modified Files:
src/lib/librmt: rmtlib.c

Log Message:
s/Cannnot/Cannot/ in error message.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/librmt/rmtlib.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/librmt/rmtlib.c
diff -u src/lib/librmt/rmtlib.c:1.28 src/lib/librmt/rmtlib.c:1.29
--- src/lib/librmt/rmtlib.c:1.28	Fri Dec 27 09:41:48 2019
+++ src/lib/librmt/rmtlib.c	Fri Mar 22 19:36:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmtlib.c,v 1.28 2019/12/27 09:41:48 msaitoh Exp $	*/
+/*	$NetBSD: rmtlib.c,v 1.29 2024/03/22 19:36:56 andvar Exp $	*/
 
 /*
  *	rmt --- remote tape emulator subroutines
@@ -28,7 +28,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: rmtlib.c,v 1.28 2019/12/27 09:41:48 msaitoh Exp $");
+__RCSID("$NetBSD: rmtlib.c,v 1.29 2024/03/22 19:36:56 andvar Exp $");
 
 #define RMTIOCTL	1
 /* #define USE_REXEC	1 */	/* rexec code courtesy of Dan Kegel, srs!dan */
@@ -364,7 +364,7 @@ _rmt_open(const char *path, int oflag, i
  *	bad problems if we get here
  */
 
-		err(1, "Cannnot exec %s", rshpath);
+		err(1, "Cannot exec %s", rshpath);
 		/*FALLTHROUGH*/
 	default:
 		break;



CVS commit: src/lib/librmt

2024-03-22 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Mar 22 19:36:56 UTC 2024

Modified Files:
src/lib/librmt: rmtlib.c

Log Message:
s/Cannnot/Cannot/ in error message.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/librmt/rmtlib.c

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



CVS commit: src/lib/libc/gen

2024-03-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Mar 21 22:27:55 UTC 2024

Modified Files:
src/lib/libc/gen: sysconf.3

Log Message:
sysconf(3): a few more markup fixes


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/lib/libc/gen/sysconf.3

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/gen/sysconf.3
diff -u src/lib/libc/gen/sysconf.3:1.56 src/lib/libc/gen/sysconf.3:1.57
--- src/lib/libc/gen/sysconf.3:1.56	Thu Mar 21 22:21:40 2024
+++ src/lib/libc/gen/sysconf.3	Thu Mar 21 22:27:55 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysconf.3,v 1.56 2024/03/21 22:21:40 uwe Exp $
+.\"	$NetBSD: sysconf.3,v 1.57 2024/03/21 22:27:55 uwe Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -90,7 +90,7 @@ The maximum size of a hostname, includin
 .Tn NUL .
 .It Dv _SC_IOV_MAX
 The maximum number of
-.Va iovec
+.Vt iovec
 structures that a process has available for use with
 .Xr preadv 2 ,
 .Xr pwritev 2 ,
@@ -189,11 +189,13 @@ Timers
 option to which the system attempts to conform,
 otherwise \-1.
 .It Dv _SC_CPUTIME
-The clockID CLOCK_PROCESS_CPUTIME_ID is supported,
-otherwise \-1.
+The clockID
+.Dv CLOCK_PROCESS_CPUTIME_ID
+is supported, otherwise \-1.
 .It Dv _SC_THREAD_CPUTIME
-The clockID CLOCK_THREAD_CPUTIME_ID is supported,
-otherwise \-1.
+The clockID
+.Dv CLOCK_THREAD_CPUTIME_ID
+is supported, otherwise \-1.
 .It Dv _SC_DELAYTIMER_MAX
 The maximum number of overrun for a specific timer,
 otherwise \-1.
@@ -352,6 +354,9 @@ The
 function first appeared in
 .Bx 4.4 .
 .Sh BUGS
-The value for _SC_STREAM_MAX is a minimum maximum, and required to be
-the same as ANSI C's FOPEN_MAX, so the returned value is a ridiculously
-small and misleading number.
+The value for
+.Dv _SC_STREAM_MAX
+is a minimum maximum, and required to be the same as
+.Tn ANSI C Ap s
+.Dv FOPEN_MAX ,
+so the returned value is a ridiculously small and misleading number.



CVS commit: src/lib/libc/gen

2024-03-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Mar 21 22:27:55 UTC 2024

Modified Files:
src/lib/libc/gen: sysconf.3

Log Message:
sysconf(3): a few more markup fixes


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/lib/libc/gen/sysconf.3

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



CVS commit: src/lib/libc/gen

2024-03-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Mar 21 22:21:40 UTC 2024

Modified Files:
src/lib/libc/gen: sysconf.3

Log Message:
sysconf(3): the _SC constants are .Dv


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/lib/libc/gen/sysconf.3

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/gen/sysconf.3
diff -u src/lib/libc/gen/sysconf.3:1.55 src/lib/libc/gen/sysconf.3:1.56
--- src/lib/libc/gen/sysconf.3:1.55	Thu Mar 21 22:17:27 2024
+++ src/lib/libc/gen/sysconf.3	Thu Mar 21 22:21:40 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysconf.3,v 1.55 2024/03/21 22:17:27 uwe Exp $
+.\"	$NetBSD: sysconf.3,v 1.56 2024/03/21 22:21:40 uwe Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -58,37 +58,37 @@ Symbolic constants for each name value a
 .In unistd.h .
 .Pp
 The available values are as follows:
-.Bl -tag -width "123456"
-.It Li _SC_ARG_MAX
+.Bl -tag -width Dv
+.It Dv _SC_ARG_MAX
 The maximum bytes of argument to
 .Xr execve 2 .
-.It Li _SC_ATEXIT_MAX
+.It Dv _SC_ATEXIT_MAX
 The maximum number of functions that may be registered with
 .Xr atexit 3 .
-.It Li _SC_BARRIERS
+.It Dv _SC_BARRIERS
 The version of
 .St -p1003.1
 and its
 Barriers
 option to which the system attempts to conform,
 otherwise \-1.
-.It Li _SC_CLOCK_SELECTION
+.It Dv _SC_CLOCK_SELECTION
 Return the
 .Tn POSIX
 version the implementation of the Clock Selection option
 on this system conforms to,
 or \-1 if unavailable.
-.It Li _SC_CHILD_MAX
+.It Dv _SC_CHILD_MAX
 The maximum number of simultaneous processes per user id.
-.It Li _SC_CLK_TCK
+.It Dv _SC_CLK_TCK
 The number of clock ticks per second.
-.It Li _SC_FSYNC
+.It Dv _SC_FSYNC
 Return 1 if the File Synchronization option is available on this system,
 otherwise \-1.
-.It Li _SC_HOST_NAME_MAX
+.It Dv _SC_HOST_NAME_MAX
 The maximum size of a hostname, including the terminating
 .Tn NUL .
-.It Li _SC_IOV_MAX
+.It Dv _SC_IOV_MAX
 The maximum number of
 .Va iovec
 structures that a process has available for use with
@@ -99,114 +99,114 @@ structures that a process has available 
 .Xr sendmsg 2
 or
 .Xr writev 2 .
-.It Li _SC_JOB_CONTROL
+.It Dv _SC_JOB_CONTROL
 Return 1 if job control is available on this system, otherwise \-1.
-.It Li _SC_LOGIN_NAME_MAX
+.It Dv _SC_LOGIN_NAME_MAX
 Returns the size of the storage required for a login name, in bytes,
 including the terminating
 .Tn NUL .
-.It Li _SC_MAPPED_FILES
+.It Dv _SC_MAPPED_FILES
 Return 1 if the Memory Mapped Files option is available on this system,
 otherwise \-1.
-.It Li _SC_MEMLOCK
+.It Dv _SC_MEMLOCK
 Return 1 if the Process Memory Locking option is available on this system,
 otherwise \-1.
-.It Li _SC_MEMLOCK_RANGE
+.It Dv _SC_MEMLOCK_RANGE
 Return 1 if the Range Memory Locking option is available on this system,
 otherwise \-1.
-.It Li _SC_MEMORY_PROTECTION
+.It Dv _SC_MEMORY_PROTECTION
 Return 1 if the Memory Protection option is available on this system,
 otherwise \-1.
-.It Li _SC_MONOTONIC_CLOCK
+.It Dv _SC_MONOTONIC_CLOCK
 Return the
 .Tn POSIX
 version the implementation of the Monotonic Clock option
 on this system conforms to,
 or \-1 if unavailable.
-.It Li _SC_NGROUPS_MAX
+.It Dv _SC_NGROUPS_MAX
 The maximum number of supplemental groups.
-.It Li _SC_OPEN_MAX
+.It Dv _SC_OPEN_MAX
 The maximum number of open files per process.
-.It Li _SC_PAGESIZE
+.It Dv _SC_PAGESIZE
 The size of a system page in bytes.
-.It Li _SC_PASS_MAX
+.It Dv _SC_PASS_MAX
 The maximum length of the password, not counting the terminating
 .Tn NUL .
-.It Li _SC_READER_WRITER_LOCKS
+.It Dv _SC_READER_WRITER_LOCKS
 The version of
 .St -p1003.1
 and its
 Read-Write Locks
 option to which the system attempts to conform,
 otherwise \-1.
-.It Li _SC_REGEXP
+.It Dv _SC_REGEXP
 Return 1 if
 .Tn POSIX
 regular expressions are available on this system, otherwise \-1.
-.It Li _SC_SEMAPHORES
+.It Dv _SC_SEMAPHORES
 The version of
 .St -p1003.1
 and its
 Semaphores
 option to which the system attempts to conform,
 otherwise \-1.
-.It Li _SC_SEM_NSEMS_MAX
+.It Dv _SC_SEM_NSEMS_MAX
 The maximum number of semaphores that one process can have open at a time,
 otherwise \-1.
-.It Li _SC_SHELL
+.It Dv _SC_SHELL
 Return 1 if
 .Tn POSIX
 shell is available on this system, otherwise \-1.
-.It Li _SC_SPIN_LOCKS
+.It Dv _SC_SPIN_LOCKS
 The version of
 .St -p1003.1
 and its
 Spin Locks
 option to which the system attempts to conform,
 otherwise \-1.
-.It Li _SC_STREAM_MAX
+.It Dv _SC_STREAM_MAX
 The minimum maximum number of streams that a process may have open
 at any one time.
-.It Li _SC_SYMLOOP_MAX
+.It Dv _SC_SYMLOOP_MAX
 The maximum number of symbolic links that may be expanded in a path name.
-.It Li _SC_SYNCHRONIZED_IO
+.It Dv _SC_SYNCHRONIZED_IO
 Return 1 if the Synchronized I/O option is available on this system,
 otherwise \-1.
-.It Li _SC_THREADS
+.It Dv _SC_THREADS
 The 

CVS commit: src/lib/libc/gen

2024-03-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Mar 21 22:21:40 UTC 2024

Modified Files:
src/lib/libc/gen: sysconf.3

Log Message:
sysconf(3): the _SC constants are .Dv


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/lib/libc/gen/sysconf.3

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



CVS commit: src/lib/libc/gen

2024-03-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Mar 21 22:17:27 UTC 2024

Modified Files:
src/lib/libc/gen: sysconf.3

Log Message:
sysconf(3): NUL is not a defined variable


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/lib/libc/gen/sysconf.3

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/gen/sysconf.3
diff -u src/lib/libc/gen/sysconf.3:1.54 src/lib/libc/gen/sysconf.3:1.55
--- src/lib/libc/gen/sysconf.3:1.54	Thu Mar 21 22:14:29 2024
+++ src/lib/libc/gen/sysconf.3	Thu Mar 21 22:17:27 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysconf.3,v 1.54 2024/03/21 22:14:29 uwe Exp $
+.\"	$NetBSD: sysconf.3,v 1.55 2024/03/21 22:17:27 uwe Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -87,7 +87,7 @@ Return 1 if the File Synchronization opt
 otherwise \-1.
 .It Li _SC_HOST_NAME_MAX
 The maximum size of a hostname, including the terminating
-.Dv NUL .
+.Tn NUL .
 .It Li _SC_IOV_MAX
 The maximum number of
 .Va iovec
@@ -104,7 +104,7 @@ Return 1 if job control is available on 
 .It Li _SC_LOGIN_NAME_MAX
 Returns the size of the storage required for a login name, in bytes,
 including the terminating
-.Dv NUL .
+.Tn NUL .
 .It Li _SC_MAPPED_FILES
 Return 1 if the Memory Mapped Files option is available on this system,
 otherwise \-1.
@@ -131,7 +131,7 @@ The maximum number of open files per pro
 The size of a system page in bytes.
 .It Li _SC_PASS_MAX
 The maximum length of the password, not counting the terminating
-.Dv NUL .
+.Tn NUL .
 .It Li _SC_READER_WRITER_LOCKS
 The version of
 .St -p1003.1



CVS commit: src/lib/libc/gen

2024-03-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Mar 21 22:17:27 UTC 2024

Modified Files:
src/lib/libc/gen: sysconf.3

Log Message:
sysconf(3): NUL is not a defined variable


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/lib/libc/gen/sysconf.3

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



CVS commit: src/lib/libc/gen

2024-03-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Mar 21 22:14:29 UTC 2024

Modified Files:
src/lib/libc/gen: sysconf.3

Log Message:
sysconf(3): POSIX text doesn't capitalize "option".


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/gen/sysconf.3

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



CVS commit: src/lib/libc/gen

2024-03-21 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Mar 21 22:14:29 UTC 2024

Modified Files:
src/lib/libc/gen: sysconf.3

Log Message:
sysconf(3): POSIX text doesn't capitalize "option".


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/gen/sysconf.3

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/gen/sysconf.3
diff -u src/lib/libc/gen/sysconf.3:1.53 src/lib/libc/gen/sysconf.3:1.54
--- src/lib/libc/gen/sysconf.3:1.53	Thu Mar 21 14:48:01 2024
+++ src/lib/libc/gen/sysconf.3	Thu Mar 21 22:14:29 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysconf.3,v 1.53 2024/03/21 14:48:01 wiz Exp $
+.\"	$NetBSD: sysconf.3,v 1.54 2024/03/21 22:14:29 uwe Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -75,7 +75,7 @@ otherwise \-1.
 .It Li _SC_CLOCK_SELECTION
 Return the
 .Tn POSIX
-version the implementation of the Clock Selection Option
+version the implementation of the Clock Selection option
 on this system conforms to,
 or \-1 if unavailable.
 .It Li _SC_CHILD_MAX
@@ -83,7 +83,7 @@ The maximum number of simultaneous proce
 .It Li _SC_CLK_TCK
 The number of clock ticks per second.
 .It Li _SC_FSYNC
-Return 1 if the File Synchronization Option is available on this system,
+Return 1 if the File Synchronization option is available on this system,
 otherwise \-1.
 .It Li _SC_HOST_NAME_MAX
 The maximum size of a hostname, including the terminating
@@ -106,21 +106,21 @@ Returns the size of the storage required
 including the terminating
 .Dv NUL .
 .It Li _SC_MAPPED_FILES
-Return 1 if the Memory Mapped Files Option is available on this system,
+Return 1 if the Memory Mapped Files option is available on this system,
 otherwise \-1.
 .It Li _SC_MEMLOCK
-Return 1 if the Process Memory Locking Option is available on this system,
+Return 1 if the Process Memory Locking option is available on this system,
 otherwise \-1.
 .It Li _SC_MEMLOCK_RANGE
-Return 1 if the Range Memory Locking Option is available on this system,
+Return 1 if the Range Memory Locking option is available on this system,
 otherwise \-1.
 .It Li _SC_MEMORY_PROTECTION
-Return 1 if the Memory Protection Option is available on this system,
+Return 1 if the Memory Protection option is available on this system,
 otherwise \-1.
 .It Li _SC_MONOTONIC_CLOCK
 Return the
 .Tn POSIX
-version the implementation of the Monotonic Clock Option
+version the implementation of the Monotonic Clock option
 on this system conforms to,
 or \-1 if unavailable.
 .It Li _SC_NGROUPS_MAX
@@ -170,7 +170,7 @@ at any one time.
 .It Li _SC_SYMLOOP_MAX
 The maximum number of symbolic links that may be expanded in a path name.
 .It Li _SC_SYNCHRONIZED_IO
-Return 1 if the Synchronized I/O Option is available on this system,
+Return 1 if the Synchronized I/O option is available on this system,
 otherwise \-1.
 .It Li _SC_THREADS
 The version of
@@ -252,26 +252,26 @@ permitted when using interval notation.
 The version of POSIX 1003.2 with which the system attempts to comply.
 .It Li _SC_2_C_BIND
 Return 1 if the system's C-language development facilities support the
-C-Language Bindings Option, otherwise \-1.
+C-Language Bindings option, otherwise \-1.
 .It Li _SC_2_C_DEV
-Return 1 if the system supports the C-Language Development Utilities Option,
+Return 1 if the system supports the C-Language Development Utilities option,
 otherwise \-1.
 .It Li _SC_2_CHAR_TERM
 Return 1 if the system supports at least one terminal type capable of
 all operations described in POSIX 1003.2, otherwise \-1.
 .It Li _SC_2_FORT_DEV
-Return 1 if the system supports the FORTRAN Development Utilities Option,
+Return 1 if the system supports the FORTRAN Development Utilities option,
 otherwise \-1.
 .It Li _SC_2_FORT_RUN
-Return 1 if the system supports the FORTRAN Runtime Utilities Option,
+Return 1 if the system supports the FORTRAN Runtime Utilities option,
 otherwise \-1.
 .It Li _SC_2_LOCALEDEF
 Return 1 if the system supports the creation of locales, otherwise \-1.
 .It Li _SC_2_SW_DEV
-Return 1 if the system supports the Software Development Utilities Option,
+Return 1 if the system supports the Software Development Utilities option,
 otherwise \-1.
 .It Li _SC_2_UPE
-Return 1 if the system supports the User Portability Utilities Option,
+Return 1 if the system supports the User Portability Utilities option,
 otherwise \-1.
 .It Li _SC_GETGR_R_SIZE_MAX
 The minimum size of the



CVS commit: src/lib/libc/gen

2024-03-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Mar 21 14:48:01 UTC 2024

Modified Files:
src/lib/libc/gen: sysconf.3

Log Message:
Fix NUL/NULL confusion.

One of these was reported by Mouse in PR 58058.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/lib/libc/gen/sysconf.3

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



CVS commit: src/lib/libc/gen

2024-03-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Mar 21 14:48:01 UTC 2024

Modified Files:
src/lib/libc/gen: sysconf.3

Log Message:
Fix NUL/NULL confusion.

One of these was reported by Mouse in PR 58058.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/lib/libc/gen/sysconf.3

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/gen/sysconf.3
diff -u src/lib/libc/gen/sysconf.3:1.52 src/lib/libc/gen/sysconf.3:1.53
--- src/lib/libc/gen/sysconf.3:1.52	Wed Oct 25 08:19:34 2023
+++ src/lib/libc/gen/sysconf.3	Thu Mar 21 14:48:01 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysconf.3,v 1.52 2023/10/25 08:19:34 simonb Exp $
+.\"	$NetBSD: sysconf.3,v 1.53 2024/03/21 14:48:01 wiz Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -86,8 +86,8 @@ The number of clock ticks per second.
 Return 1 if the File Synchronization Option is available on this system,
 otherwise \-1.
 .It Li _SC_HOST_NAME_MAX
-The maximum size of a hostname, including
-.Dv NULL .
+The maximum size of a hostname, including the terminating
+.Dv NUL .
 .It Li _SC_IOV_MAX
 The maximum number of
 .Va iovec
@@ -103,7 +103,8 @@ or
 Return 1 if job control is available on this system, otherwise \-1.
 .It Li _SC_LOGIN_NAME_MAX
 Returns the size of the storage required for a login name, in bytes,
-including the terminating NUL.
+including the terminating
+.Dv NUL .
 .It Li _SC_MAPPED_FILES
 Return 1 if the Memory Mapped Files Option is available on this system,
 otherwise \-1.
@@ -129,8 +130,8 @@ The maximum number of open files per pro
 .It Li _SC_PAGESIZE
 The size of a system page in bytes.
 .It Li _SC_PASS_MAX
-The maximum length of the password, not counting
-.Dv NULL .
+The maximum length of the password, not counting the terminating
+.Dv NUL .
 .It Li _SC_READER_WRITER_LOCKS
 The version of
 .St -p1003.1



CVS commit: src/lib/libc/arch/sparc64/gen

2024-03-20 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Mar 20 06:15:40 UTC 2024

Modified Files:
src/lib/libc/arch/sparc64/gen: fpsetround.c

Log Message:
sparc64/fpsetround: avoid shifting into the sign bit

Lint had warned about the constant expression '0x03 << 30' but not about
the structurally equal nonconstant expression '(rnd_dir & 0x03) << 30'.

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/sparc64/gen/fpsetround.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/arch/sparc64/gen/fpsetround.c
diff -u src/lib/libc/arch/sparc64/gen/fpsetround.c:1.8 src/lib/libc/arch/sparc64/gen/fpsetround.c:1.9
--- src/lib/libc/arch/sparc64/gen/fpsetround.c:1.8	Mon Mar 11 23:05:35 2024
+++ src/lib/libc/arch/sparc64/gen/fpsetround.c	Wed Mar 20 06:15:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetround.c,v 1.8 2024/03/11 23:05:35 christos Exp $	*/
+/*	$NetBSD: fpsetround.c,v 1.9 2024/03/20 06:15:39 rillig Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 10, 1995
@@ -7,7 +7,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetround.c,v 1.8 2024/03/11 23:05:35 christos Exp $");
+__RCSID("$NetBSD: fpsetround.c,v 1.9 2024/03/20 06:15:39 rillig Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -36,8 +36,8 @@ fpsetround(fp_rnd rnd_dir)
 #endif
 
 	new = old;
-	new &= ~(0x03U << 30); 
-	new |= ((rnd_dir & 0x03) << 30);
+	new &= ~(0x03U << 30);
+	new |= ((rnd_dir & 0x03U) << 30);
 
 	__asm("ld %0,%%fsr" : : "m" (*));
 



CVS commit: src/lib/libc/arch/sparc64/gen

2024-03-20 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Mar 20 06:15:40 UTC 2024

Modified Files:
src/lib/libc/arch/sparc64/gen: fpsetround.c

Log Message:
sparc64/fpsetround: avoid shifting into the sign bit

Lint had warned about the constant expression '0x03 << 30' but not about
the structurally equal nonconstant expression '(rnd_dir & 0x03) << 30'.

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/sparc64/gen/fpsetround.c

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

2024-03-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar 18 16:15:24 UTC 2024

Modified Files:
src/lib/libc/time: strptime.c

Log Message:
strptime(3): Declare digit d as time_t.

This doesn't make a semantic difference -- d can only take on the ten
values {0,1,2,3,4,5,6,7,8,9}, and the arithmetic with it later all
comes out the same whether the type is unsigned or time_t, even if
time_t were int32_t instead of int64_t.

But it pacifies overzealous compilers used by downstream users of
this code.  And while it's silly to use a much wider type (64-bit
signed) than is needed here to store a single digit, it doesn't
really hurt either (32-bit unsigned is much larger than needed too).

PR lib/58041


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/lib/libc/time/strptime.c

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

2024-03-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Mar 18 16:15:24 UTC 2024

Modified Files:
src/lib/libc/time: strptime.c

Log Message:
strptime(3): Declare digit d as time_t.

This doesn't make a semantic difference -- d can only take on the ten
values {0,1,2,3,4,5,6,7,8,9}, and the arithmetic with it later all
comes out the same whether the type is unsigned or time_t, even if
time_t were int32_t instead of int64_t.

But it pacifies overzealous compilers used by downstream users of
this code.  And while it's silly to use a much wider type (64-bit
signed) than is needed here to store a single digit, it doesn't
really hurt either (32-bit unsigned is much larger than needed too).

PR lib/58041


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/lib/libc/time/strptime.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/strptime.c
diff -u src/lib/libc/time/strptime.c:1.65 src/lib/libc/time/strptime.c:1.66
--- src/lib/libc/time/strptime.c:1.65	Sat Mar 16 00:16:21 2024
+++ src/lib/libc/time/strptime.c	Mon Mar 18 16:15:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: strptime.c,v 1.65 2024/03/16 00:16:21 riastradh Exp $	*/
+/*	$NetBSD: strptime.c,v 1.66 2024/03/18 16:15:24 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strptime.c,v 1.65 2024/03/16 00:16:21 riastradh Exp $");
+__RCSID("$NetBSD: strptime.c,v 1.66 2024/03/18 16:15:24 riastradh Exp $");
 #endif
 
 #include "namespace.h"
@@ -348,8 +348,7 @@ literal:
 
 		case 's': {	/* seconds since the epoch */
 			const time_t TIME_MAX = __type_max(time_t);
-			time_t sse;
-			unsigned d;
+			time_t sse, d;
 
 			if (*bp < '0' || *bp > '9') {
 bp = NULL;



CVS commit: src/lib/libc/time

2024-03-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 16 00:16:21 UTC 2024

Modified Files:
src/lib/libc/time: strptime.c

Log Message:
strptime(3): Reduce unnecessary indentation.

Post-fix tidying.

No functional change intended.

PR lib/58041


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/lib/libc/time/strptime.c

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

2024-03-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 16 00:16:21 UTC 2024

Modified Files:
src/lib/libc/time: strptime.c

Log Message:
strptime(3): Reduce unnecessary indentation.

Post-fix tidying.

No functional change intended.

PR lib/58041


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/lib/libc/time/strptime.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/strptime.c
diff -u src/lib/libc/time/strptime.c:1.64 src/lib/libc/time/strptime.c:1.65
--- src/lib/libc/time/strptime.c:1.64	Sat Mar 16 00:06:45 2024
+++ src/lib/libc/time/strptime.c	Sat Mar 16 00:16:21 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: strptime.c,v 1.64 2024/03/16 00:06:45 riastradh Exp $	*/
+/*	$NetBSD: strptime.c,v 1.65 2024/03/16 00:16:21 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strptime.c,v 1.64 2024/03/16 00:06:45 riastradh Exp $");
+__RCSID("$NetBSD: strptime.c,v 1.65 2024/03/16 00:16:21 riastradh Exp $");
 #endif
 
 #include "namespace.h"
@@ -346,41 +346,40 @@ literal:
 			LEGAL_ALT(ALT_O);
 			continue;
 
-		case 's':	/* seconds since the epoch */
-			{
-const time_t TIME_MAX = __type_max(time_t);
-time_t sse;
-unsigned d;
+		case 's': {	/* seconds since the epoch */
+			const time_t TIME_MAX = __type_max(time_t);
+			time_t sse;
+			unsigned d;
 
-if (*bp < '0' || *bp > '9') {
-	bp = NULL;
-	continue;
-}
+			if (*bp < '0' || *bp > '9') {
+bp = NULL;
+continue;
+			}
 
-sse = *bp++ - '0';
-while (*bp >= '0' && *bp <= '9') {
-	d = *bp++ - '0';
-	if (sse > TIME_MAX/10) {
-		bp = NULL;
-		break;
-	}
-	sse *= 10;
-	if (sse > TIME_MAX - d) {
-		bp = NULL;
-		break;
-	}
-	sse += d;
+			sse = *bp++ - '0';
+			while (*bp >= '0' && *bp <= '9') {
+d = *bp++ - '0';
+if (sse > TIME_MAX/10) {
+	bp = NULL;
+	break;
 }
-if (bp == NULL)
-	continue;
-
-if (localtime_r(, tm) == NULL)
+sse *= 10;
+if (sse > TIME_MAX - d) {
 	bp = NULL;
-else
-	state |= S_YDAY | S_WDAY |
-	S_MON | S_MDAY | S_YEAR;
+	break;
+}
+sse += d;
 			}
+			if (bp == NULL)
+continue;
+
+			if (localtime_r(, tm) == NULL)
+bp = NULL;
+			else
+state |= S_YDAY | S_WDAY |
+S_MON | S_MDAY | S_YEAR;
 			continue;
+		}
 
 		case 'U':	/* The week of year, beginning on sunday. */
 		case 'W':	/* The week of year, beginning on monday. */



CVS commit: src/lib/libc/time

2024-03-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 16 00:06:46 UTC 2024

Modified Files:
src/lib/libc/time: strptime.c

Log Message:
strptime(3): Avoid arithmetic overflow.

PR lib/58041


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/lib/libc/time/strptime.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/strptime.c
diff -u src/lib/libc/time/strptime.c:1.63 src/lib/libc/time/strptime.c:1.64
--- src/lib/libc/time/strptime.c:1.63	Mon Sep 21 15:31:54 2020
+++ src/lib/libc/time/strptime.c	Sat Mar 16 00:06:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: strptime.c,v 1.63 2020/09/21 15:31:54 ginsbach Exp $	*/
+/*	$NetBSD: strptime.c,v 1.64 2024/03/16 00:06:45 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strptime.c,v 1.63 2020/09/21 15:31:54 ginsbach Exp $");
+__RCSID("$NetBSD: strptime.c,v 1.64 2024/03/16 00:06:45 riastradh Exp $");
 #endif
 
 #include "namespace.h"
@@ -346,30 +346,33 @@ literal:
 			LEGAL_ALT(ALT_O);
 			continue;
 
-#ifndef TIME_MAX
-#define TIME_MAX	INT64_MAX
-#endif
 		case 's':	/* seconds since the epoch */
 			{
-time_t sse = 0;
-uint64_t rulim = TIME_MAX;
+const time_t TIME_MAX = __type_max(time_t);
+time_t sse;
+unsigned d;
 
 if (*bp < '0' || *bp > '9') {
 	bp = NULL;
 	continue;
 }
 
-do {
+sse = *bp++ - '0';
+while (*bp >= '0' && *bp <= '9') {
+	d = *bp++ - '0';
+	if (sse > TIME_MAX/10) {
+		bp = NULL;
+		break;
+	}
 	sse *= 10;
-	sse += *bp++ - '0';
-	rulim /= 10;
-} while ((sse * 10 <= TIME_MAX) &&
-	 rulim && *bp >= '0' && *bp <= '9');
-
-if (sse < 0 || (uint64_t)sse > TIME_MAX) {
-	bp = NULL;
-	continue;
+	if (sse > TIME_MAX - d) {
+		bp = NULL;
+		break;
+	}
+	sse += d;
 }
+if (bp == NULL)
+	continue;
 
 if (localtime_r(, tm) == NULL)
 	bp = NULL;



CVS commit: src/lib/libc/time

2024-03-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 16 00:06:46 UTC 2024

Modified Files:
src/lib/libc/time: strptime.c

Log Message:
strptime(3): Avoid arithmetic overflow.

PR lib/58041


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/lib/libc/time/strptime.c

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



CVS commit: src/lib/libusbhid

2024-03-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Mar 14 15:39:23 UTC 2024

Modified Files:
src/lib/libusbhid: usb_hid_usages

Log Message:
Sync with OpenBSD


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libusbhid/usb_hid_usages

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

Modified files:

Index: src/lib/libusbhid/usb_hid_usages
diff -u src/lib/libusbhid/usb_hid_usages:1.11 src/lib/libusbhid/usb_hid_usages:1.12
--- src/lib/libusbhid/usb_hid_usages:1.11	Thu Mar 14 15:27:22 2024
+++ src/lib/libusbhid/usb_hid_usages	Thu Mar 14 15:39:23 2024
@@ -1,4 +1,5 @@
-# $NetBSD: usb_hid_usages,v 1.11 2024/03/14 15:27:22 jakllsch Exp $
+# $NetBSD: usb_hid_usages,v 1.12 2024/03/14 15:39:23 jakllsch Exp $
+# $OpenBSD: usb_hid_usages,v 1.6 2020/09/09 02:26:54 pamela Exp $
 #
 # USB HID usage table
 # Syntax:
@@ -19,6 +20,15 @@
 	0x07	Keypad
 	0x08	Multi-axis Controller
 	0x09	Tablet PC System Controls
+	0x0A	Water Cooling Device
+	0x0B	Computer Chassis Device
+	0x0C	Wireless Radio Controls
+	0x0D	Portable Device Control
+	0x0E	System Multi-Axis Controller
+	0x0F	Spatial Controller
+	0x10	Assistive Control
+	0x11	Device Dock
+	0x12	Dockable Device
 	0x30	X
 	0x31	Y
 	0x32	Z
@@ -43,6 +53,10 @@
 	0x46	Vno
 	0x47	Feature Notification
 	0x48	Resolution Multiplier
+	0x49	Qx
+	0x4A	Qy
+	0x4B	Qz
+	0x4C	Qw
 	0x80	System Control
 	0x81	System Power Down
 	0x82	System Sleep
@@ -63,6 +77,14 @@
 	0x91	D-pad Down
 	0x92	D-pad Right
 	0x93	D-pad Left
+	0x94	Index Trigger
+	0x95	Palm Trigger
+	0x96	Thumbstick
+	0x97	System Function Shift
+	0x98	System Function Shift Lock
+	0x99	System Function Shift Lock Indicator
+	0x9A	System Dismiss Notification
+	0x9B	System Do Not Disturb
 	0xA0	System Dock
 	0xA1	System Undock
 	0xA2	System Setup
@@ -80,6 +102,25 @@
 	0xB5	System Display Toggle Int/Ext
 	0xB6	System Display Swap Primary/Secondary
 	0xB7	System Display LCD Autoscale
+	0xC0	Sensor Zone
+	0xC1	RPM
+	0xC2	Coolant Level
+	0xC3	Coolant Critical Level
+	0xC4	Coolant Pump
+	0xC5	Chassis Enclosure
+	0xC6	Wireless Radio Button
+	0xC7	Wireless Radio LED
+	0xC8	Wireless Radio Slider Switch
+	0xC9	System Display Rotation Lock Button
+	0xCA	System Display Rotation Lock Slider Switch
+	0xCB	Control Enable
+	0xD0	Dockable Device Unique ID
+	0xD1	Dockable Device Vendor ID
+	0xD2	Dockable Device Primary Usage Page
+	0xD3	Dockable Device Primary Usage ID
+	0xD4	Dockable Device Docking State
+	0xD5	Dockable Device Display Occlusion
+	0xD6	Dockable Device Object Type
 
 2	Simulation Controls
 	0x00	Undefined
@@ -94,27 +135,26 @@
 	0x09	Airplane Simulation Device
 	0x0A	Helicopter Simulation Device
 	0x0B	Magic Carpet Simulation Device
-	0x0C	Bicycle
+	0x0C	Bicycle Simulation Device
 	0x20	Flight Control Stick
 	0x21	Flight Stick
 	0x22	Cyclic Control
 	0x23	Cyclic Trim
 	0x24	Flight Yoke
 	0x25	Track Control
-	0x26	Driving Control
 	0xB0	Aileron
 	0xB1	Aileron Trim
 	0xB2	Anti-Torque Control
-	0xB3	Auto-pilot Enable
+	0xB3	Autopilot Enable
 	0xB4	Chaff Release
 	0xB5	Collective Control
 	0xB6	Dive Brake
-	0xB7	Electronic Counter Measures
+	0xB7	Electronic Countermeasures
 	0xB8	Elevator
 	0xB9	Elevator Trim
 	0xBA	Rudder
 	0xBB	Throttle
-	0xBC	Flight Communication
+	0xBC	Flight Communications
 	0xBD	Flare Release
 	0xBE	Landing Gear
 	0xBF	Toe Brake
@@ -218,9 +258,11 @@
 	0x36	Gun Safety
 	0x37	Gamepad Fire/Jump
 	0x39	Gamepad Trigger
+	0x3A	Form-fitting Gamepad
 
 6	Device Controls
 	0x00	Undefined
+	0x06	Background/Nonuser Controls
 	0x20	Battery Strength
 	0x21	Wireless Channel
 	0x22	Wireless ID
@@ -228,6 +270,22 @@
 	0x24	Security Code Character Entered
 	0x25	Security Code Character Erased
 	0x26	Security Code Cleared
+	0x27	Sequence ID
+	0x28	Sequence ID Reset
+	0x29	RF Signal Strength
+	0x2A	Software Version
+	0x2B	Protocol Version
+	0x2C	Hardware Version
+	0x2D	Major
+	0x2E	Minor
+	0x2F	Revision
+	0x30	Handedness
+	0x31	Either Hand
+	0x32	Left Hand
+	0x33	Right Hand
+	0x34	Both Hands
+	0x40	Grip Pose Offset
+	0x41	Pointer Pose Offset
 
 7	Keyboard
 	0x00	No Event
@@ -529,6 +587,24 @@
 	0x4B	Generic Indicator
 	0x4C	System Suspend
 	0x4D	External Power Connected
+	0x4E	Indicator Blue
+	0x4F	Indicator Orange
+	0x50	Good Status
+	0x51	Warning Status
+	0x52	RGB LED
+	0x53	Red LED Channel
+	0x54	Blue LED Channel
+	0x55	Green LED Channel
+	0x56	LED Intensity
+	0x60	Player Indicator
+	0x61	Player 1
+	0x62	Player 2
+	0x63	Player 3
+	0x64	Player 4
+	0x65	Player 5
+	0x66	Player 6
+	0x67	Player 7
+	0x68	Player 8
 
 9	Button
 	0x00	No Button Pressed
@@ -605,6 +681,40 @@
 	0xBD	Phone Key B
 	0xBE	Phone Key C
 	0xBF	Phone Key D
+	0xC0	Phone Call History Key
+	0xC1	Phone Caller ID Key
+	0xC2	Phone Settings Key
+	0xF0	Host Control
+	0xF1	Host Available
+	0xF2	Host Call Active
+	0xF3	Activate Handset Audio
+	0xF4	Ring Type
+	0xF5	Re-dialable Phone Number
+	0xF8	Stop Ring Tone
+	0xF9	PSTN Ring Tone
+	0xFA	Host Ring Tone
+	0xFB	Alert Sound Error
+	

CVS commit: src/lib/libusbhid

2024-03-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Mar 14 15:39:23 UTC 2024

Modified Files:
src/lib/libusbhid: usb_hid_usages

Log Message:
Sync with OpenBSD


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libusbhid/usb_hid_usages

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



CVS commit: src/lib/libusbhid

2024-03-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Mar 14 15:27:23 UTC 2024

Modified Files:
src/lib/libusbhid: usb_hid_usages

Log Message:
Remove Reserved usages and ranges thereof

Helps align with future merge


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libusbhid/usb_hid_usages

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

Modified files:

Index: src/lib/libusbhid/usb_hid_usages
diff -u src/lib/libusbhid/usb_hid_usages:1.10 src/lib/libusbhid/usb_hid_usages:1.11
--- src/lib/libusbhid/usb_hid_usages:1.10	Thu Mar 14 15:23:52 2024
+++ src/lib/libusbhid/usb_hid_usages	Thu Mar 14 15:27:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: usb_hid_usages,v 1.10 2024/03/14 15:23:52 jakllsch Exp $
+# $NetBSD: usb_hid_usages,v 1.11 2024/03/14 15:27:22 jakllsch Exp $
 #
 # USB HID usage table
 # Syntax:
@@ -13,7 +13,6 @@
 	0x00	Undefined
 	0x01	Pointer
 	0x02	Mouse
-	0x03	Reserved
 	0x04	Joystick
 	0x05	Game Pad
 	0x06	Keyboard
@@ -530,7 +529,6 @@
 	0x4B	Generic Indicator
 	0x4C	System Suspend
 	0x4D	External Power Connected
-	0x4C-	Reserved
 
 9	Button
 	0x00	No Button Pressed



CVS commit: src/lib/libusbhid

2024-03-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Mar 14 15:27:23 UTC 2024

Modified Files:
src/lib/libusbhid: usb_hid_usages

Log Message:
Remove Reserved usages and ranges thereof

Helps align with future merge


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libusbhid/usb_hid_usages

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



CVS commit: src/lib/libusbhid

2024-03-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Mar 14 15:23:52 UTC 2024

Modified Files:
src/lib/libusbhid: usb_hid_usages

Log Message:
fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libusbhid/usb_hid_usages

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

Modified files:

Index: src/lib/libusbhid/usb_hid_usages
diff -u src/lib/libusbhid/usb_hid_usages:1.9 src/lib/libusbhid/usb_hid_usages:1.10
--- src/lib/libusbhid/usb_hid_usages:1.9	Sat Feb 10 09:21:52 2024
+++ src/lib/libusbhid/usb_hid_usages	Thu Mar 14 15:23:52 2024
@@ -1,4 +1,4 @@
-# $NetBSD: usb_hid_usages,v 1.9 2024/02/10 09:21:52 andvar Exp $
+# $NetBSD: usb_hid_usages,v 1.10 2024/03/14 15:23:52 jakllsch Exp $
 #
 # USB HID usage table
 # Syntax:
@@ -40,7 +40,7 @@
 	0x42	Vz
 	0x43	Vbrx
 	0x44	Vbry
-	0x45	Vbrx
+	0x45	Vbrz
 	0x46	Vno
 	0x47	Feature Notification
 	0x48	Resolution Multiplier
@@ -627,7 +627,7 @@
 	0x35	Illumination
 	0x36	Function Buttons
 	0x40	Menu
-	0x41	Menu  Pick
+	0x41	Menu Pick
 	0x42	Menu Up
 	0x43	Menu Down
 	0x44	Menu Left
@@ -688,7 +688,7 @@
 	0xB7	Stop
 	0xB8	Eject
 	0xB9	Random Play
-	0xBA	Select DisC
+	0xBA	Select Disc
 	0xBB	Enter Disc
 	0xBC	Repeat
 	0xBD	Tracking



CVS commit: src/lib/libusbhid

2024-03-14 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Mar 14 15:23:52 UTC 2024

Modified Files:
src/lib/libusbhid: usb_hid_usages

Log Message:
fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libusbhid/usb_hid_usages

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



  1   2   3   4   5   6   7   8   9   10   >