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

2024-05-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May 28 06:57:17 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/sys: __sigtramp2.S

Log Message:
Change MIPS to RISC-V.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/sys/__sigtramp2.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/riscv/sys/__sigtramp2.S
diff -u src/lib/libc/arch/riscv/sys/__sigtramp2.S:1.3 src/lib/libc/arch/riscv/sys/__sigtramp2.S:1.4
--- src/lib/libc/arch/riscv/sys/__sigtramp2.S:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/sys/__sigtramp2.S	Tue May 28 06:57:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.4 2024/05/28 06:57:17 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -33,12 +33,12 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: __sigtramp2.S,v 1.3 2023/05/07 12:41:47 skrll Exp $")
+	RCSID("$NetBSD: __sigtramp2.S,v 1.4 2024/05/28 06:57:17 skrll Exp $")
 #endif /* SYSLIBC_SCCS and not lint */
 
 
 /*
- * The MIPS signal trampoline is invoked only to return from
+ * The RISC-V signal trampoline is invoked only to return from
  * the signal; the kernel calls the signal handler directly.
  *
  * On entry, stack looks like:



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

2024-05-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May 28 06:57:17 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/sys: __sigtramp2.S

Log Message:
Change MIPS to RISC-V.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/sys/__sigtramp2.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/compat

2024-05-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 20 01:33:40 UTC 2024

Modified Files:
src/lib/libc/compat/include: unistd.h
src/lib/libc/compat/sys: compat_dup3.c

Log Message:
finish renaming __dup3110 to __dup3100


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/include/unistd.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/compat/sys/compat_dup3.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/compat/include/unistd.h
diff -u src/lib/libc/compat/include/unistd.h:1.4 src/lib/libc/compat/include/unistd.h:1.5
--- src/lib/libc/compat/include/unistd.h:1.4	Sun May 19 18:25:47 2024
+++ src/lib/libc/compat/include/unistd.h	Sun May 19 21:33:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.4 2024/05/19 22:25:47 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.5 2024/05/20 01:33:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __BEGIN_DECLS
 pid_t	vfork(void) __returns_twice;
 pid_t	__vfork14(void) __returns_twice;
 int	dup3(int, int, int);
-int	__dup3110(int, int, int);
+int	__dup3100(int, int, int);
 
 __END_DECLS
 

Index: src/lib/libc/compat/sys/compat_dup3.c
diff -u src/lib/libc/compat/sys/compat_dup3.c:1.1 src/lib/libc/compat/sys/compat_dup3.c:1.2
--- src/lib/libc/compat/sys/compat_dup3.c:1.1	Sun May 19 18:25:48 2024
+++ src/lib/libc/compat/sys/compat_dup3.c	Sun May 19 21:33:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_dup3.c,v 1.1 2024/05/19 22:25:48 christos Exp $ */
+/*	$NetBSD: compat_dup3.c,v 1.2 2024/05/20 01:33:40 christos Exp $ */
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: compat_dup3.c,v 1.1 2024/05/19 22:25:48 christos Exp $");
+__RCSID("$NetBSD: compat_dup3.c,v 1.2 2024/05/20 01:33:40 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -45,7 +45,7 @@ int
 dup3(int oldfd, int newfd, int flags)
 {
 	if (oldfd != newfd) {
-		return __dup3110(oldfd, newfd, flags);
+		return __dup3100(oldfd, newfd, flags);
 	}
 	if (flags & (O_NONBLOCK|O_NOSIGPIPE)) {
 		int e = fcntl(newfd, F_GETFL, 0);



CVS commit: src/lib/libc/compat

2024-05-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 20 01:33:40 UTC 2024

Modified Files:
src/lib/libc/compat/include: unistd.h
src/lib/libc/compat/sys: compat_dup3.c

Log Message:
finish renaming __dup3110 to __dup3100


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/include/unistd.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/compat/sys/compat_dup3.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/sys

2024-05-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 19 16:04:46 UTC 2024

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

Log Message:
Amend for oldfd == newfd returning EINVAL in dup3


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/sys/dup.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/dup.2
diff -u src/lib/libc/sys/dup.2:1.33 src/lib/libc/sys/dup.2:1.34
--- src/lib/libc/sys/dup.2:1.33	Mon Jul  3 17:32:50 2017
+++ src/lib/libc/sys/dup.2	Sun May 19 12:04:46 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dup.2,v 1.33 2017/07/03 21:32:50 wiz Exp $
+.\"	$NetBSD: dup.2,v 1.34 2024/05/19 16:04:46 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)dup.2	8.1 (Berkeley) 6/4/93
 .\"
-.Dd December 24, 2013
+.Dd May 19, 2024
 .Dt DUP 2
 .Os
 .Sh NAME
@@ -117,7 +117,14 @@ and can to some extent be adjusted with
 .Pp
 The
 .Fn dup3
-call includes an additional
+call fails and returns 
+.Er EINVAL
+if the numeric value in the
+.Ar oldfd 
+argument is equal to the one in the
+.Ar newfd
+argument.
+It also includes an additional
 .Fa flags
 argument supporting a subset of the
 .Xr open 2
@@ -207,11 +214,15 @@ and
 .Fa newfd
 is not in the range of valid file descriptors.
 .It Bq Er EINVAL
-.Fa flags
-contained an invalid value.
-Only
+In the
 .Fn dup3
-can generate this error.
+call either the
+.Fa flags
+argument contained an invalid value or the
+.Ar oldfd
+argument is equal to the
+.Ar newfd
+argument.
 .It Bq Er EMFILE
 Too many descriptors are active.
 Only



CVS commit: src/lib/libc/sys

2024-05-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 19 16:04:46 UTC 2024

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

Log Message:
Amend for oldfd == newfd returning EINVAL in dup3


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/sys/dup.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/arch/riscv/gen

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May 16 01:02:35 UTC 2024

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

Log Message:
riscv: More shiftiness reduction around FCSR in libc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpgetsticky.c \
src/lib/libc/arch/riscv/gen/fpsetsticky.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-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May 16 01:02:35 UTC 2024

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

Log Message:
riscv: More shiftiness reduction around FCSR in libc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpgetsticky.c \
src/lib/libc/arch/riscv/gen/fpsetsticky.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/fpgetsticky.c
diff -u src/lib/libc/arch/riscv/gen/fpgetsticky.c:1.3 src/lib/libc/arch/riscv/gen/fpgetsticky.c:1.4
--- src/lib/libc/arch/riscv/gen/fpgetsticky.c:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/fpgetsticky.c	Thu May 16 01:02:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetsticky.c,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: fpgetsticky.c,v 1.4 2024/05/16 01:02:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetsticky.c,v 1.3 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fpgetsticky.c,v 1.4 2024/05/16 01:02:35 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -47,5 +47,5 @@ __weak_alias(fpgetsticky,_fpgetsticky)
 fp_except
 fpgetsticky(void)
 {
-	return __SHIFTOUT(fcsr_read(), FCSR_FFLAGS);
+	return fcsr_fflags_read();
 }
Index: src/lib/libc/arch/riscv/gen/fpsetsticky.c
diff -u src/lib/libc/arch/riscv/gen/fpsetsticky.c:1.3 src/lib/libc/arch/riscv/gen/fpsetsticky.c:1.4
--- src/lib/libc/arch/riscv/gen/fpsetsticky.c:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/fpsetsticky.c	Thu May 16 01:02:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetsticky.c,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: fpsetsticky.c,v 1.4 2024/05/16 01:02:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetsticky.c,v 1.3 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fpsetsticky.c,v 1.4 2024/05/16 01:02:35 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -48,5 +48,5 @@ __weak_alias(fpsetsticky,_fpsetsticky)
 fp_except
 fpsetsticky(fp_except mask)
 {
-	return __SHIFTOUT(fcsr_fflags_write(__SHIFTIN(mask, FCSR_FFLAGS)), FCSR_FFLAGS);
+	return fcsr_fflags_write(mask);
 }



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

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May 16 00:56:11 UTC 2024

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

Log Message:
riscv: Nix shifting around FRRM and FSRM in libc too.

These read and write the floating-point rounding mode directly, not
the whole floating-point control and status register.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpgetround.c \
src/lib/libc/arch/riscv/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/riscv/gen/fpgetround.c
diff -u src/lib/libc/arch/riscv/gen/fpgetround.c:1.3 src/lib/libc/arch/riscv/gen/fpgetround.c:1.4
--- src/lib/libc/arch/riscv/gen/fpgetround.c:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/fpgetround.c	Thu May 16 00:56:11 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: fpgetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fpgetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -47,5 +47,5 @@ __weak_alias(fpgetround,_fpgetround)
 fp_rnd
 fpgetround(void)
 {
-	return __SHIFTOUT(fcsr_read(), FCSR_FRM);
+	return fcsr_frm_read();
 }
Index: src/lib/libc/arch/riscv/gen/fpsetround.c
diff -u src/lib/libc/arch/riscv/gen/fpsetround.c:1.3 src/lib/libc/arch/riscv/gen/fpsetround.c:1.4
--- src/lib/libc/arch/riscv/gen/fpsetround.c:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/fpsetround.c	Thu May 16 00:56:11 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: fpsetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fpsetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -47,5 +47,5 @@ __weak_alias(fpsetround,_fpsetround)
 fp_rnd
 fpsetround(fp_rnd rnd_dir)
 {
-	return __SHIFTOUT(fcsr_frm_write(__SHIFTIN(rnd_dir, FCSR_FRM)), FCSR_FRM);
+	return fcsr_frm_write(rnd_dir);
 }



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

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May 16 00:56:11 UTC 2024

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

Log Message:
riscv: Nix shifting around FRRM and FSRM in libc too.

These read and write the floating-point rounding mode directly, not
the whole floating-point control and status register.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpgetround.c \
src/lib/libc/arch/riscv/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/gen

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 15 13:12:04 UTC 2024

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

Log Message:
usleep(3): Note the historical rake that was stepped upon.

PR 58184


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 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.21 src/lib/libc/gen/usleep.3:1.22
--- src/lib/libc/gen/usleep.3:1.21	Mon Apr 22 21:25:29 2024
+++ src/lib/libc/gen/usleep.3	Wed May 15 13:12:04 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usleep.3,v 1.21 2024/04/22 21:25:29 jdolecek Exp $
+.\"	$NetBSD: usleep.3,v 1.22 2024/05/15 13:12:04 riastradh Exp $
 .\"
 .\" Copyright (c) 1986, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -99,3 +99,17 @@ The
 .Fn usleep
 function appeared in
 .Bx 4.3 .
+.Sh CAVEATS
+In
+.St -p1003.1-2004 ,
+.Nm
+was limited to values of
+.Fa microseconds
+less than one million.
+Some implementations, including
+.Nx
+before 10.1, fail immediately with
+.Er EINVAL
+\(em and don't sleep at all \(em if
+.Fa microseconds
+is one million or greater.



CVS commit: src/lib/libc/gen

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 15 13:12:04 UTC 2024

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

Log Message:
usleep(3): Note the historical rake that was stepped upon.

PR 58184


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 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/gdtoa

2024-05-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon May 13 21:17:24 UTC 2024

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

Log Message:
libc/hdtoa: suppress lint warning about possible accuracy loss

on sparc64: hdtoa.c(340): warning: conversion from 'unsigned long'
to 'char' may lose accuracy [132]


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gdtoa/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/gdtoa/Makefile.inc
diff -u src/lib/libc/gdtoa/Makefile.inc:1.13 src/lib/libc/gdtoa/Makefile.inc:1.14
--- src/lib/libc/gdtoa/Makefile.inc:1.13	Sat Oct  7 12:15:53 2023
+++ src/lib/libc/gdtoa/Makefile.inc	Mon May 13 21:17:24 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.13 2023/10/07 12:15:53 rin Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2024/05/13 21:17:24 rillig Exp $
 
 # gdtoa sources
 .PATH: ${.CURDIR}/gdtoa
@@ -44,3 +44,5 @@ SRCS+=	dmisc.c \
 .if ${MACHINE_ARCH} != "vax"
 SRCS+=	strtord.c
 .endif
+
+LINTFLAGS.hdtoa.c+=	-X 132	# conversion may lose accuracy



CVS commit: src/lib/libc/gdtoa

2024-05-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon May 13 21:17:24 UTC 2024

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

Log Message:
libc/hdtoa: suppress lint warning about possible accuracy loss

on sparc64: hdtoa.c(340): warning: conversion from 'unsigned long'
to 'char' may lose accuracy [132]


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gdtoa/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/inet

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:58:18 UTC 2024

Modified Files:
src/lib/libc/inet: inet_net_pton.c

Log Message:
s/Firey/Fiery/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/inet/inet_net_pton.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/inet/inet_net_pton.c
diff -u src/lib/libc/inet/inet_net_pton.c:1.6 src/lib/libc/inet/inet_net_pton.c:1.7
--- src/lib/libc/inet/inet_net_pton.c:1.6	Mon Feb  5 21:46:05 2024
+++ src/lib/libc/inet/inet_net_pton.c	Sun May 12 23:58:18 2024
@@ -20,7 +20,7 @@
 #if 0
 static const char rcsid[] = "Id: inet_net_pton.c,v 1.4.2.1 2002/08/02 02:17:21 marka Exp ";
 #else
-__RCSID("$NetBSD: inet_net_pton.c,v 1.6 2024/02/05 21:46:05 andvar Exp $");
+__RCSID("$NetBSD: inet_net_pton.c,v 1.7 2024/05/12 23:58:18 msaitoh Exp $");
 #endif
 #endif
 
@@ -150,7 +150,7 @@ inet_net_pton_ipv4(const char *src, u_ch
 			goto enoent;
 	}
 
-	/* Firey death and destruction unless we prefetched EOS. */
+	/* Fiery death and destruction unless we prefetched EOS. */
 	if (ch != '\0')
 		goto enoent;
 



CVS commit: src/lib/libc/inet

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:58:18 UTC 2024

Modified Files:
src/lib/libc/inet: inet_net_pton.c

Log Message:
s/Firey/Fiery/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/inet/inet_net_pton.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-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 10:58:58 UTC 2024

Modified Files:
src/lib/libc/gen: pwcache.c

Log Message:
libc/pwcache.c: remove stray semicolon from do-while-0 macro


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libc/gen/pwcache.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-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 10:58:58 UTC 2024

Modified Files:
src/lib/libc/gen: pwcache.c

Log Message:
libc/pwcache.c: remove stray semicolon from do-while-0 macro


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libc/gen/pwcache.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/pwcache.c
diff -u src/lib/libc/gen/pwcache.c:1.34 src/lib/libc/gen/pwcache.c:1.35
--- src/lib/libc/gen/pwcache.c:1.34	Tue Apr 19 20:32:15 2022
+++ src/lib/libc/gen/pwcache.c	Sun May 12 10:58:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pwcache.c,v 1.34 2022/04/19 20:32:15 rillig Exp $	*/
+/*	$NetBSD: pwcache.c,v 1.35 2024/05/12 10:58:58 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -74,7 +74,7 @@
 #if 0
 static char sccsid[] = "@(#)cache.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: pwcache.c,v 1.34 2022/04/19 20:32:15 rillig Exp $");
+__RCSID("$NetBSD: pwcache.c,v 1.35 2024/05/12 10:58:58 rillig Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -524,7 +524,7 @@ gid_from_group(const char *name, gid_t *
 			arr = NULL;			\
 		}	\
 		fail = 0;\
-	} while (0);
+	} while (0)
 
 int
 pwcache_userdb(



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

2024-05-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May 11 07:40:18 UTC 2024

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

Log Message:
Do the '#if FCSR_FMASK == 0' thing that fpgetmask.c does for consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpsetmask.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-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May 11 07:40:18 UTC 2024

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

Log Message:
Do the '#if FCSR_FMASK == 0' thing that fpgetmask.c does for consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpsetmask.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/fpsetmask.c
diff -u src/lib/libc/arch/riscv/gen/fpsetmask.c:1.3 src/lib/libc/arch/riscv/gen/fpsetmask.c:1.4
--- src/lib/libc/arch/riscv/gen/fpsetmask.c:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/fpsetmask.c	Sat May 11 07:40:18 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.c,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: fpsetmask.c,v 1.4 2024/05/11 07:40:18 skrll Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetmask.c,v 1.3 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fpsetmask.c,v 1.4 2024/05/11 07:40:18 skrll Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -47,9 +47,9 @@ __weak_alias(fpsetmask,_fpsetmask)
 fp_except
 fpsetmask(fp_except mask)
 {
-#if 0
-	return __SHIFTOUT(fcsr_fmask_write(__SHIFTIN(mask, FCSR_MASK)), FCSR_FMASK);
-#else
+#if FCSR_FMASK == 0
 	return 0;
+#else
+	return __SHIFTOUT(fcsr_fmask_write(__SHIFTIN(mask, FCSR_MASK)), FCSR_FMASK);
 #endif
 }



CVS commit: src/lib/libc/net

2024-05-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu May  9 21:28:00 UTC 2024

Modified Files:
src/lib/libc/net: getaddrinfo.3

Log Message:
Document that freeaddrinfo(NULL) dumps core.

A source code comment already said this, but it's easier to
find in a man page.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/libc/net/getaddrinfo.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/arch/arm/gen

2024-05-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May  6 06:57:32 UTC 2024

Modified Files:
src/lib/libc/arch/arm/gen: setjmp.S

Log Message:
arm longjmp: Restore stack first, then signal mask.

Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:

- Move the botched sp and lr tests earlier.

PR lib/57946


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/arch/arm/gen/setjmp.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/arm/gen/setjmp.S
diff -u src/lib/libc/arch/arm/gen/setjmp.S:1.18 src/lib/libc/arch/arm/gen/setjmp.S:1.19
--- src/lib/libc/arch/arm/gen/setjmp.S:1.18	Tue Dec 13 12:43:32 2022
+++ src/lib/libc/arch/arm/gen/setjmp.S	Mon May  6 06:57:32 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: setjmp.S,v 1.18 2022/12/13 12:43:32 skrll Exp $	*/
+/*	$NetBSD: setjmp.S,v 1.19 2024/05/06 06:57:32 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997 Mark Brinicombe
@@ -142,6 +142,25 @@ ENTRY(__longjmp14)
 	cmp	r3, ip
 	bne	.Lbotch
 
+	/* Validate sp and lr */
+	ldr	r2, [r0, #(_JB_REG_R13 * 4)]
+#if defined(__thumb__) && defined(_ARM_ARCH_T2)
+	cbz	r2, .Lbotch
+#else
+	cmp	r2, #0
+	beq	.Lbotch
+#endif
+
+	ldr	r3, [r0, #(_JB_REG_R14 * 4)]
+#if defined(__thumb__) && defined(_ARM_ARCH_T2)
+	cbz	r3, .Lbotch
+#else
+	cmp	r3, #0
+	beq	.Lbotch
+#endif
+	mov	sp, r2
+	mov	lr, r3
+
 	/* Restore the signal mask. */
 	push	{r0-r2, lr}
 	movs	r2, #0
@@ -186,25 +205,6 @@ ENTRY(__longjmp14)
 	adds	r0, r0, #4	/* skip ip(r12) */
 #endif
 
-	ldmia	r0!, {r2-r3}
-
-	/* Validate sp and lr */
-#if defined(__thumb__) && defined(_ARM_ARCH_T2)
-	cbz	r2, .Lbotch
-#else
-	cmp	r2, #0
-	beq	.Lbotch
-#endif
-	mov	sp, r2
-
-#if defined(__thumb__) && defined(_ARM_ARCH_T2)
-	cbz	r3, .Lbotch
-#else
-	cmp	r3, #0
-	beq	.Lbotch
-#endif
-	mov	lr, r3
-
 	/* Set return value */
 	movs	r0, r1
 #if !defined(__thumb__)



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

2024-05-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May  6 06:57:32 UTC 2024

Modified Files:
src/lib/libc/arch/arm/gen: setjmp.S

Log Message:
arm longjmp: Restore stack first, then signal mask.

Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:

- Move the botched sp and lr tests earlier.

PR lib/57946


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/lib/libc/arch/arm/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/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/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/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.



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/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/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/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/libc/arch/sparc64/gen

2024-03-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar 11 23:05:35 UTC 2024

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

Log Message:
fix lint


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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/arch/sparc64/gen

2024-03-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar 11 23:05:35 UTC 2024

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

Log Message:
fix lint


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.7 src/lib/libc/arch/sparc64/gen/fpsetround.c:1.8
--- src/lib/libc/arch/sparc64/gen/fpsetround.c:1.7	Sun Oct 27 21:06:36 2013
+++ src/lib/libc/arch/sparc64/gen/fpsetround.c	Mon Mar 11 19:05:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetround.c,v 1.7 2013/10/28 01:06:36 mrg Exp $	*/
+/*	$NetBSD: fpsetround.c,v 1.8 2024/03/11 23:05:35 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.7 2013/10/28 01:06:36 mrg Exp $");
+__RCSID("$NetBSD: fpsetround.c,v 1.8 2024/03/11 23:05:35 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -19,14 +19,15 @@ __RCSID("$NetBSD: fpsetround.c,v 1.7 201
 __weak_alias(fpsetround,_fpsetround)
 #endif
 
+#ifdef SOFTFLOATSPARC64_FOR_GCC
+extern fp_rnd _softfloat_float_rounding_mode;
+#endif
+
 fp_rnd
 fpsetround(fp_rnd rnd_dir)
 {
 	fp_rnd old;
 	fp_rnd new;
-#ifdef SOFTFLOATSPARC64_FOR_GCC
-	extern fp_rnd _softfloat_float_rounding_mode;
-#endif
 
 	__asm("st %%fsr,%0" : "=m" (*));
 
@@ -35,7 +36,7 @@ fpsetround(fp_rnd rnd_dir)
 #endif
 
 	new = old;
-	new &= ~(0x03 << 30); 
+	new &= ~(0x03U << 30); 
 	new |= ((rnd_dir & 0x03) << 30);
 
 	__asm("ld %0,%%fsr" : : "m" (*));



CVS commit: src/lib/libc/time

2024-03-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar 11 23:03:35 UTC 2024

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

Log Message:
add casts for compat code where time_t is 32 bits.


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/lib/libc/time/localtime.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-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar 11 23:03:35 UTC 2024

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

Log Message:
add casts for compat code where time_t is 32 bits.


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/lib/libc/time/localtime.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/localtime.c
diff -u src/lib/libc/time/localtime.c:1.142 src/lib/libc/time/localtime.c:1.143
--- src/lib/libc/time/localtime.c:1.142	Thu Mar  7 15:42:04 2024
+++ src/lib/libc/time/localtime.c	Mon Mar 11 19:03:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: localtime.c,v 1.142 2024/03/07 20:42:04 christos Exp $	*/
+/*	$NetBSD: localtime.c,v 1.143 2024/03/11 23:03:35 christos Exp $	*/
 
 /* Convert timestamp from time_t to struct tm.  */
 
@@ -12,7 +12,7 @@
 #if 0
 static char	elsieid[] = "@(#)localtime.c	8.17";
 #else
-__RCSID("$NetBSD: localtime.c,v 1.142 2024/03/07 20:42:04 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.143 2024/03/11 23:03:35 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -1871,7 +1871,7 @@ timesub(const time_t *timep, int_fast32_
 	   for localtime values before 1970 when time_t is unsigned.  */
 	dayrem = (int)(tdays % DAYSPERREPEAT);
 	dayrem += dayoff % DAYSPERREPEAT;
-	y = (EPOCH_YEAR - YEARSPERREPEAT
+	y = (time_t)(EPOCH_YEAR - YEARSPERREPEAT
 	 + ((1 + dayoff / DAYSPERREPEAT + dayrem / DAYSPERREPEAT
 		 - ((dayrem % DAYSPERREPEAT) < 0)
 		 + tdays / DAYSPERREPEAT)
@@ -1884,7 +1884,7 @@ timesub(const time_t *timep, int_fast32_
 	while (year_lengths[isleap(y)] <= idays) {
 		int_fast32_t tdelta = idays / DAYSPERLYEAR;
 		int_fast32_t ydelta = tdelta + !tdelta;
-		time_t newy = y + ydelta;
+		time_t newy = (time_t)(y + ydelta);
 		register int	leapdays;
 		leapdays = (int)(leaps_thru_end_of(newy - 1) -
 			leaps_thru_end_of(y - 1));



CVS commit: src/lib/libc/compiler_rt

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 18:00:13 UTC 2024

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

Log Message:
compiler_rt: allow signed bit shifts for __negv

Standard C defines '1 << 31' as undefined behavior, but
https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html allows
it for GCC.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 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.46 src/lib/libc/compiler_rt/Makefile.inc:1.47
--- src/lib/libc/compiler_rt/Makefile.inc:1.46	Tue Jan 23 15:32:18 2024
+++ src/lib/libc/compiler_rt/Makefile.inc	Sun Mar 10 18:00:13 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.46 2024/01/23 15:32:18 christos Exp $
+# $NetBSD: Makefile.inc,v 1.47 2024/03/10 18:00:13 rillig Exp $
 
 COMPILER_RT_DIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt
 COMPILER_RT_SRCDIR=	${COMPILER_RT_DIR}/dist
@@ -396,9 +396,9 @@ LINTFLAGS.mulvti3.c += -X 117,351
 LINTFLAGS.negdf2.c += -X 309,351
 LINTFLAGS.negsf2.c += -X 132,351
 LINTFLAGS.negti2.c += -X 351
-LINTFLAGS.negvdi2.c += -X 351
-LINTFLAGS.negvsi2.c += -X 351
-LINTFLAGS.negvti2.c += -X 351
+LINTFLAGS.negvdi2.c += -X 141,351
+LINTFLAGS.negvsi2.c += -X 141,351
+LINTFLAGS.negvti2.c += -X 141,351
 LINTFLAGS.parityti2.c += -X 351
 LINTFLAGS.popcountdi2.c += -X 351
 LINTFLAGS.popcountsi2.c += -X 351



CVS commit: src/lib/libc/compiler_rt

2024-03-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Mar 10 18:00:13 UTC 2024

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

Log Message:
compiler_rt: allow signed bit shifts for __negv

Standard C defines '1 << 31' as undefined behavior, but
https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html allows
it for GCC.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 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/time

2024-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar  7 20:42:04 UTC 2024

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

Log Message:
pass lint on sparc64 where int_fast32_t is long.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/lib/libc/time/localtime.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/localtime.c
diff -u src/lib/libc/time/localtime.c:1.141 src/lib/libc/time/localtime.c:1.142
--- src/lib/libc/time/localtime.c:1.141	Sat Feb 17 09:54:47 2024
+++ src/lib/libc/time/localtime.c	Thu Mar  7 15:42:04 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: localtime.c,v 1.141 2024/02/17 14:54:47 christos Exp $	*/
+/*	$NetBSD: localtime.c,v 1.142 2024/03/07 20:42:04 christos Exp $	*/
 
 /* Convert timestamp from time_t to struct tm.  */
 
@@ -12,7 +12,7 @@
 #if 0
 static char	elsieid[] = "@(#)localtime.c	8.17";
 #else
-__RCSID("$NetBSD: localtime.c,v 1.141 2024/02/17 14:54:47 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.142 2024/03/07 20:42:04 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -569,10 +569,10 @@ tzloadbody(char const *name, struct stat
 		   && (ttisutcnt == typecnt || ttisutcnt == 0)))
 		  return EINVAL;
 
-		sp->leapcnt = leapcnt;
-		sp->timecnt = timecnt;
-		sp->typecnt = typecnt;
-		sp->charcnt = charcnt;
+		sp->leapcnt = (int)leapcnt;
+		sp->timecnt = (int)timecnt;
+		sp->typecnt = (int)typecnt;
+		sp->charcnt = (int)charcnt;
 
 		/* Read transitions, discarding those out of time_t range.
 		   But pretend the last transition before TIME_T_MIN
@@ -605,7 +605,7 @@ tzloadbody(char const *name, struct stat
 			if (sp->types[i])
 sp->types[timecnt++] = typ;
 		}
-		sp->timecnt = timecnt;
+		sp->timecnt = (int)timecnt;
 		for (i = 0; i < sp->typecnt; ++i) {
 			register struct ttinfo *	ttisp;
 			unsigned char isdst, desigidx;
@@ -660,7 +660,7 @@ tzloadbody(char const *name, struct stat
 		leapcnt++;
 		  }
 		}
-		sp->leapcnt = leapcnt;
+		sp->leapcnt = (int)leapcnt;
 
 		for (i = 0; i < sp->typecnt; ++i) {
 			register struct ttinfo *	ttisp;
@@ -725,7 +725,7 @@ tzloadbody(char const *name, struct stat
 			  size_t tsabbrlen = strlen(tsabbr);
 			  if (j + tsabbrlen < TZ_MAX_CHARS) {
 strcpy(sp->chars + j, tsabbr);
-charcnt = (int_fast32_t)(j + tsabbrlen + 1);
+charcnt = (int)(j + tsabbrlen + 1);
 ts->ttis[i].tt_desigidx = j;
 gotabbr++;
 			  }
@@ -1878,11 +1878,11 @@ timesub(const time_t *timep, int_fast32_
 		* YEARSPERREPEAT));
 	/* idays = (tdays + dayoff) mod DAYSPERREPEAT, sans overflow.  */
 	idays = (int)(tdays % DAYSPERREPEAT);
-	idays += dayoff % DAYSPERREPEAT + 2 * DAYSPERREPEAT;
+	idays += (dayoff % DAYSPERREPEAT + 2 * DAYSPERREPEAT);
 	idays %= DAYSPERREPEAT;
 	/* Increase Y and decrease IDAYS until IDAYS is in range for Y.  */
 	while (year_lengths[isleap(y)] <= idays) {
-		int tdelta = idays / DAYSPERLYEAR;
+		int_fast32_t tdelta = idays / DAYSPERLYEAR;
 		int_fast32_t ydelta = tdelta + !tdelta;
 		time_t newy = y + ydelta;
 		register int	leapdays;
@@ -1910,7 +1910,7 @@ timesub(const time_t *timep, int_fast32_
 	  return NULL;
 	}
 #endif
-	tmp->tm_yday = idays;
+	tmp->tm_yday = (int)idays;
 	/*
 	** The "extra" mods below avoid overflow problems.
 	*/
@@ -1925,8 +1925,8 @@ timesub(const time_t *timep, int_fast32_
 		tmp->tm_wday += DAYSPERWEEK;
 	tmp->tm_hour = (int) (rem / SECSPERHOUR);
 	rem %= SECSPERHOUR;
-	tmp->tm_min = rem / SECSPERMIN;
-	tmp->tm_sec = rem % SECSPERMIN;
+	tmp->tm_min = (int)(rem / SECSPERMIN);
+	tmp->tm_sec = (int)(rem % SECSPERMIN);
 
 	/* Use "... ??:??:60" at the end of the localtime minute containing
 	   the second just before the positive leap second.  */
@@ -1935,7 +1935,7 @@ timesub(const time_t *timep, int_fast32_
 	ip = mon_lengths[isleap(y)];
 	for (tmp->tm_mon = 0; idays >= ip[tmp->tm_mon]; ++(tmp->tm_mon))
 		idays -= ip[tmp->tm_mon];
-	tmp->tm_mday = idays + 1;
+	tmp->tm_mday = (int)(idays + 1);
 	tmp->tm_isdst = 0;
 #ifdef TM_GMTOFF
 	tmp->TM_GMTOFF = offset;



CVS commit: src/lib/libc/time

2024-03-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar  7 20:42:04 UTC 2024

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

Log Message:
pass lint on sparc64 where int_fast32_t is long.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/lib/libc/time/localtime.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/softfloat/bits64

2024-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 27 15:14:15 UTC 2024

Modified Files:
src/lib/libc/softfloat/bits64: softfloat.c

Log Message:
appease lint


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/softfloat/bits64/softfloat.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/softfloat/bits64/softfloat.c
diff -u src/lib/libc/softfloat/bits64/softfloat.c:1.14 src/lib/libc/softfloat/bits64/softfloat.c:1.15
--- src/lib/libc/softfloat/bits64/softfloat.c:1.14	Tue Mar 29 14:42:29 2016
+++ src/lib/libc/softfloat/bits64/softfloat.c	Tue Feb 27 10:14:15 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.c,v 1.14 2016/03/29 18:42:29 martin Exp $ */
+/* $NetBSD: softfloat.c,v 1.15 2024/02/27 15:14:15 christos Exp $ */
 
 /*
  * This version hacked for use with gcc -msoft-float by bjh21.
@@ -46,7 +46,7 @@ this code that are retained.
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: softfloat.c,v 1.14 2016/03/29 18:42:29 martin Exp $");
+__RCSID("$NetBSD: softfloat.c,v 1.15 2024/02/27 15:14:15 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #ifdef SOFTFLOAT_FOR_GCC
@@ -5261,7 +5261,7 @@ float128 float128_sqrt( float128 a )
 if ( ( aSig0 | aSig1 ) == 0 ) return packFloat128( 0, 0, 0, 0 );
 normalizeFloat128Subnormal( aSig0, aSig1, , ,  );
 }
-zExp = (int32) ( (aExp - 0x3FFF) >> 1) + 0x3FFE;
+zExp = (int32) ( (bits32)(aExp - 0x3FFF) >> 1) + 0x3FFE;
 aSig0 |= LIT64( 0x0001 );
 zSig0 = estimateSqrt32((int16)aExp, (bits32)(aSig0>>17));
 shortShift128Left( aSig0, aSig1, 13 - ( aExp & 1 ), ,  );



CVS commit: src/lib/libc/softfloat/bits64

2024-02-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 27 15:14:15 UTC 2024

Modified Files:
src/lib/libc/softfloat/bits64: softfloat.c

Log Message:
appease lint


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/softfloat/bits64/softfloat.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-02-19 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Feb 20 00:09:31 UTC 2024

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

Log Message:
fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/sparc/gen/longjmp.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/longjmp.c
diff -u src/lib/libc/arch/sparc/gen/longjmp.c:1.4 src/lib/libc/arch/sparc/gen/longjmp.c:1.5
--- src/lib/libc/arch/sparc/gen/longjmp.c:1.4	Sun Sep  3 21:41:45 2023
+++ src/lib/libc/arch/sparc/gen/longjmp.c	Tue Feb 20 00:09:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: longjmp.c,v 1.4 2023/09/03 21:41:45 mrg Exp $	*/
+/*	$NetBSD: longjmp.c,v 1.5 2024/02/20 00:09:31 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
 /*
  * check that offsets in the above structures match their usage in the
  * setjmp() side of this setup.  a jmp_buf is the 12-word contents of
- * the sigcontexst structure, plus 2 more words for g4 and g7.
+ * the sigcontext structure, plus 2 more words for g4 and g7.
  */
 __CTASSERT(_SIZEOF_SC + _JB_G4 == offsetof(struct __jmp_buf,regs.g4));
 __CTASSERT(_SIZEOF_SC + _JB_G7 == offsetof(struct __jmp_buf,regs.g7));



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

2024-02-19 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Feb 20 00:09:31 UTC 2024

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

Log Message:
fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/sparc/gen/longjmp.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-02-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Feb 18 12:47:08 UTC 2024

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

Log Message:
Revert this part:

strftime %s now uses tm_gmtoff if available.  (Problem and draft
patch reported by Dag-Erling Smørgrav.)

of the tzcode2924a update.   It is bogus.   The "problem" is/was a simple
misunderstanding of what strftime(%s) is intended to output.  The "fix"
breaks it.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/lib/libc/time/strftime.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/strftime.c
diff -u src/lib/libc/time/strftime.c:1.54 src/lib/libc/time/strftime.c:1.55
--- src/lib/libc/time/strftime.c:1.54	Sat Feb 17 14:54:47 2024
+++ src/lib/libc/time/strftime.c	Sun Feb 18 12:47:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: strftime.c,v 1.54 2024/02/17 14:54:47 christos Exp $	*/
+/*	$NetBSD: strftime.c,v 1.55 2024/02/18 12:47:08 kre Exp $	*/
 
 /* Convert a broken-down timestamp to a string.  */
 
@@ -35,7 +35,7 @@
 static char	elsieid[] = "@(#)strftime.c	7.64";
 static char	elsieid[] = "@(#)strftime.c	8.3";
 #else
-__RCSID("$NetBSD: strftime.c,v 1.54 2024/02/17 14:54:47 christos Exp $");
+__RCSID("$NetBSD: strftime.c,v 1.55 2024/02/18 12:47:08 kre Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -381,15 +381,11 @@ label:
 	tm.tm_mday = t->tm_mday;
 	tm.tm_mon = t->tm_mon;
 	tm.tm_year = t->tm_year;
-#ifdef TM_GMTOFF
-	mkt = timeoff(, t->TM_GMTOFF);
-#else
 	tm.tm_isdst = t->tm_isdst;
 #if defined TM_GMTOFF && ! UNINIT_TRAP
 	tm.TM_GMTOFF = t->TM_GMTOFF;
 #endif
 	mkt = mktime_z(sp, );
-#endif
 	/* If mktime fails, %s expands to the
 	   value of (time_t) -1 as a failure
 	   marker; this is better in practice



CVS commit: src/lib/libc/time

2024-02-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Feb 18 12:47:08 UTC 2024

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

Log Message:
Revert this part:

strftime %s now uses tm_gmtoff if available.  (Problem and draft
patch reported by Dag-Erling Smørgrav.)

of the tzcode2924a update.   It is bogus.   The "problem" is/was a simple
misunderstanding of what strftime(%s) is intended to output.  The "fix"
breaks it.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/lib/libc/time/strftime.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/net

2024-02-16 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Feb 16 22:50:33 UTC 2024

Modified Files:
src/lib/libc/net: getnameinfo.3

Log Message:
getnameinfo(3): fix/prettify markup


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/lib/libc/net/getnameinfo.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/net

2024-02-16 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Feb 16 22:50:33 UTC 2024

Modified Files:
src/lib/libc/net: getnameinfo.3

Log Message:
getnameinfo(3): fix/prettify markup


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/lib/libc/net/getnameinfo.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/net/getnameinfo.3
diff -u src/lib/libc/net/getnameinfo.3:1.43 src/lib/libc/net/getnameinfo.3:1.44
--- src/lib/libc/net/getnameinfo.3:1.43	Thu Feb 15 15:08:23 2024
+++ src/lib/libc/net/getnameinfo.3	Fri Feb 16 22:50:33 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getnameinfo.3,v 1.43 2024/02/15 15:08:23 jkoshy Exp $
+.\"	$NetBSD: getnameinfo.3,v 1.44 2024/02/16 22:50:33 uwe Exp $
 .\"	$KAME: getnameinfo.3,v 1.37 2005/01/05 03:23:05 itojun Exp $
 .\"	$OpenBSD: getnameinfo.3,v 1.36 2004/12/21 09:48:20 jmc Exp $
 .\"
@@ -23,17 +23,25 @@
 .Sh NAME
 .Nm getnameinfo
 .Nd socket address structure to hostname and service name
+.
 .Sh SYNOPSIS
 .In netdb.h
+.
 .Ft int
-.Fn getnameinfo "const struct sockaddr * restrict sa" "socklen_t salen" \
-"char * restrict host" "socklen_t hostlen" "char * restrict serv" \
-"socklen_t servlen" "int flags"
+.Fo getnameinfo
+.Fa "const struct sockaddr * restrict sa"
+.Fa "socklen_t salen"
+.Fa "char * restrict host"
+.Fa "socklen_t hostlen"
+.Fa "char * restrict serv"
+.Fa "socklen_t servlen" "int flags"
+.Fc
+.
 .Sh DESCRIPTION
 The
 .Fn getnameinfo
 function is used to convert a
-.Li sockaddr
+.Vt sockaddr
 structure to a pair of host name and service strings.
 It is a replacement for and provides more flexibility than the
 .Xr gethostbyaddr 3
@@ -44,20 +52,20 @@ functions and is the converse of the
 function.
 .Pp
 The
-.Li sockaddr
+.Vt sockaddr
 structure
 .Fa sa
 should point to a
-.Li sockaddr_in
+.Vt sockaddr_in
 (for IPv4),
-.Li sockaddr_in6
+.Vt sockaddr_in6
 (for IPv6),
-.Li sockaddr_atalk
+.Vt sockaddr_atalk
 (for AppleTalk),
-.Li sockaddr_link
+.Vt sockaddr_link
 (for link layer),
 or
-.Li sockaddr_local
+.Vt sockaddr_local
 (for local/unix)
 structures that are
 .Fa salen
@@ -85,14 +93,16 @@ as defined by
 .In netdb.h .
 If a length parameter is zero, no string will be stored.
 Otherwise, enough space must be provided to store the
-host name or service string plus a byte for the NUL terminator.
+host name or service string plus a byte for the
+.Tn NUL
+terminator.
 .Pp
 The
 .Fa flags
 argument is formed by
-.Sy OR Ns 'ing
+.Em or Ap ing
 the following values:
-.Bl -tag -width "NI_NUMERICHOSTXX"
+.Bl -tag -width Dv
 .It Dv NI_NOFQDN
 A fully qualified domain name is not required for local hosts.
 The local part of the fully qualified domain name is returned instead.
@@ -106,21 +116,23 @@ If the host name cannot be found in DNS 
 a non-zero error code is returned.
 If the host name is not found and the flag is not set, the
 address is returned in numeric form.
-.It NI_NUMERICSCOPE
+.It Dv NI_NUMERICSCOPE
 For IPv6 addresses the numeric form of the IPv6 scope identifier is
 returned.
 This flag is ignored for non-IPv6 addresses.
-.It NI_NUMERICSERV
+.It Dv NI_NUMERICSERV
 The service name is returned as a digit string representing the port number.
-.It NI_DGRAM
+.It Dv NI_DGRAM
 Specifies that the service being looked up is a datagram
 service, and causes
 .Xr getservbyport 3
 to be called with a second argument of
-.Dq udp
+.Li \*qudp\*q
 instead of its default of
-.Dq tcp .
-This is required for the few ports (512\-514) that have different services
+.Li \*qtcp\*q .
+This is required for the few ports
+.Pq 512\(en514
+that have different services
 for
 .Tn UDP
 and
@@ -128,17 +140,19 @@ and
 .El
 .Pp
 This implementation allows numeric IPv6 address notation with scope identifier,
-as documented in chapter 11 of draft-ietf-ipv6-scoping-arch-02.txt.
+as documented in chapter\~11 of draft-ietf-ipv6-scoping-arch-02.txt.
 IPv6 link-local address will appear as a string like
-.Dq Li fe80::1%ne0 .
+.Ql fe80::1%ne0 .
 Refer to
 .Xr getaddrinfo 3
 for more information.
+.
 .Sh RETURN VALUES
 .Fn getnameinfo
 returns zero on success or one of the error codes listed in
 .Xr gai_strerror 3
 if an error occurs.
+.
 .Sh EXAMPLES
 The following code tries to get a numeric host name, and service name,
 for a given socket address.
@@ -167,6 +181,7 @@ if (getnameinfo(sa, sa->sa_len, hbuf, si
 }
 printf("host=%s\en", hbuf);
 .Ed
+.
 .Sh SEE ALSO
 .Xr gai_strerror 3 ,
 .Xr getaddrinfo 3 ,
@@ -205,6 +220,7 @@ printf("host=%s\en", hbuf);
 .%B "Proceedings of the FREENIX track: 2000 USENIX annual technical conference"
 .%D June 2000
 .Re
+.
 .Sh STANDARDS
 The
 .Fn getnameinfo
@@ -213,19 +229,25 @@ function is defined by the
 draft specification and documented in
 .Sy "RFC 2553" ,
 .Dq Basic Socket Interface Extensions for IPv6 .
+.
 .Sh CAVEATS
 .Fn getnameinfo
-can return both numeric and FQDN forms of the address specified in
+can return both numeric and
+.Tn 

CVS commit: src/lib/libc/net

2024-02-15 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Thu Feb 15 15:08:23 UTC 2024

Modified Files:
src/lib/libc/net: getnameinfo.3

Log Message:
Document the NI_NUMERICSCOPE flag.

PR lib/57832


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/lib/libc/net/getnameinfo.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/net/getnameinfo.3
diff -u src/lib/libc/net/getnameinfo.3:1.42 src/lib/libc/net/getnameinfo.3:1.43
--- src/lib/libc/net/getnameinfo.3:1.42	Mon Jul  3 21:32:49 2017
+++ src/lib/libc/net/getnameinfo.3	Thu Feb 15 15:08:23 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getnameinfo.3,v 1.42 2017/07/03 21:32:49 wiz Exp $
+.\"	$NetBSD: getnameinfo.3,v 1.43 2024/02/15 15:08:23 jkoshy Exp $
 .\"	$KAME: getnameinfo.3,v 1.37 2005/01/05 03:23:05 itojun Exp $
 .\"	$OpenBSD: getnameinfo.3,v 1.36 2004/12/21 09:48:20 jmc Exp $
 .\"
@@ -17,7 +17,7 @@
 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 .\" PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd August 18, 2013
+.Dd February 15, 2024
 .Dt GETNAMEINFO 3
 .Os
 .Sh NAME
@@ -106,6 +106,10 @@ If the host name cannot be found in DNS 
 a non-zero error code is returned.
 If the host name is not found and the flag is not set, the
 address is returned in numeric form.
+.It NI_NUMERICSCOPE
+For IPv6 addresses the numeric form of the IPv6 scope identifier is
+returned.
+This flag is ignored for non-IPv6 addresses.
 .It NI_NUMERICSERV
 The service name is returned as a digit string representing the port number.
 .It NI_DGRAM



CVS commit: src/lib/libc/net

2024-02-15 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Thu Feb 15 15:08:23 UTC 2024

Modified Files:
src/lib/libc/net: getnameinfo.3

Log Message:
Document the NI_NUMERICSCOPE flag.

PR lib/57832


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/lib/libc/net/getnameinfo.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-02-09 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Feb  9 17:24:45 UTC 2024

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

Log Message:
signal(3): mention old signal(2) syscall in HISTORY


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/gen/signal.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-02-09 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Feb  9 17:24:45 UTC 2024

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

Log Message:
signal(3): mention old signal(2) syscall in HISTORY


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/gen/signal.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/signal.3
diff -u src/lib/libc/gen/signal.3:1.29 src/lib/libc/gen/signal.3:1.30
--- src/lib/libc/gen/signal.3:1.29	Sat Aug  7 03:17:23 2021
+++ src/lib/libc/gen/signal.3	Fri Feb  9 17:24:44 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: signal.3,v 1.29 2021/08/07 03:17:23 dholland Exp $
+.\"	$NetBSD: signal.3,v 1.30 2024/02/09 17:24:44 uwe Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -190,3 +190,11 @@ This
 .Fn signal
 facility appeared in
 .Bx 4.0 .
+.Pp
+The
+.Fn signal
+facility used to be a system call that implemented a different
+semantics
+.Dq ( old signals ) .
+It first appeared in
+.At v4 .



CVS commit: src/lib/libc/locale

2024-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb  3 10:55:38 UTC 2024

Modified Files:
src/lib/libc/locale: mblen.3

Log Message:
mblen.3: clean up wording and grammar


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/mblen.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/locale/mblen.3
diff -u src/lib/libc/locale/mblen.3:1.6 src/lib/libc/locale/mblen.3:1.7
--- src/lib/libc/locale/mblen.3:1.6	Sat Oct 14 07:51:01 2006
+++ src/lib/libc/locale/mblen.3	Sat Feb  3 10:55:38 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: mblen.3,v 1.6 2006/10/14 07:51:01 wiz Exp $
+.\" $NetBSD: mblen.3,v 1.7 2024/02/03 10:55:38 rillig Exp $
 .\"
 .\" Copyright (c)2002 Citrus Project,
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 3, 2002
+.Dd February 3, 2024
 .Dt MBLEN 3
 .Os
 .\" --
@@ -47,18 +47,20 @@ function usually determines the number o
 a multibyte character pointed to by
 .Fa s
 and returns it.
-This function shall only examine max n bytes of the array beginning from
+This function examines at most
+.Fa n
+bytes of the array beginning from
 .Fa s .
 .Pp
 In state-dependent encodings,
 .Fa s
-may point the special sequence bytes to change the shift-state.
+may point to the special sequence bytes to change the shift-state.
 Although such sequence bytes corresponds to no individual
 wide-character code,
 the
 .Fn mblen
-changes the own state by them and treats them
-as if they are a part of the subsequent multibyte character.
+function changes its own state by them and treats them
+as if they were part of the subsequent multibyte character.
 .Pp
 Unlike
 .Xr mbrlen 3 ,
@@ -106,8 +108,7 @@ determines whether the current encoding 
 This function returns 0 if the encoding is state-independent,
 otherwise non-zero.
 .It "n == 0"
-In this case,
-the first
+The first
 .Fa n
 bytes of the array pointed to by
 .Fa s
@@ -128,11 +129,11 @@ points to a nul byte
 .Pq Sq \e0 .
 .It "positive"
 The value returned is
-a number of bytes for the valid multibyte character pointed to by
+the number of bytes for the valid multibyte character pointed to by
 .Fa s .
-There are no cases that this value is greater than
-.Fa n
-or the value of the
+The value returned is at most
+.Fa n ,
+and at most the value of the
 .Dv MB_CUR_MAX
 macro.
 .It "-1"
@@ -140,7 +141,7 @@ macro.
 points to an invalid or incomplete multibyte character.
 The
 .Fn mblen
-also sets
+function also sets
 .Va errno
 to indicate the error.
 .El
@@ -151,7 +152,7 @@ is equal to
 .Dv NULL ,
 the
 .Fn mblen
-returns:
+function returns:
 .Bl -tag -width 0123456789
 .It "0"
 The current encoding is state-independent.



CVS commit: src/lib/libc/locale

2024-02-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Feb  3 10:55:38 UTC 2024

Modified Files:
src/lib/libc/locale: mblen.3

Log Message:
mblen.3: clean up wording and grammar


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/mblen.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-02-02 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Fri Feb  2 21:16:42 UTC 2024

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

Log Message:
Make the err(3) manual clearer to read.

- Mention that the 'fmt' argument to these functions holds
  a printf(3)-like format specification.
- Clarify that the err()/warn()/errc()/warnc() family of functions
  will append an additional error message to the output.
- Add whitespace to separate paragraphs describing distinct
  concepts.
- Move the sentence mentioning the final output newline to
  a less ambiguous location within the text.
- Add a cross-reference to printf(3).


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/gen/err.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-02-02 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Fri Feb  2 21:16:42 UTC 2024

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

Log Message:
Make the err(3) manual clearer to read.

- Mention that the 'fmt' argument to these functions holds
  a printf(3)-like format specification.
- Clarify that the err()/warn()/errc()/warnc() family of functions
  will append an additional error message to the output.
- Add whitespace to separate paragraphs describing distinct
  concepts.
- Move the sentence mentioning the final output newline to
  a less ambiguous location within the text.
- Add a cross-reference to printf(3).


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/gen/err.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/err.3
diff -u src/lib/libc/gen/err.3:1.23 src/lib/libc/gen/err.3:1.24
--- src/lib/libc/gen/err.3:1.23	Thu Jan  5 15:13:57 2023
+++ src/lib/libc/gen/err.3	Fri Feb  2 21:16:41 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: err.3,v 1.23 2023/01/05 15:13:57 kre Exp $
+.\" $NetBSD: err.3,v 1.24 2024/02/02 21:16:41 jkoshy Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)err.3	8.1 (Berkeley) 6/9/93
 .\"
-.Dd January 5, 2023
+.Dd February 2, 2024
 .Dt ERR 3
 .Os
 .Sh NAME
@@ -81,27 +81,30 @@ and
 .Fn warn
 family of functions display a formatted error message on the standard
 error output.
-In all cases, the last component of the program name, a colon character,
-and a space are output.
+.Pp
+In all cases these functions output the last component of the program name,
+a colon character, and a space.
 If the
 .Fa fmt
 argument is not
 .Dv NULL ,
-the formatted error message is output.
+it is used as a
+.Xr printf 3 Ns
+-like format specification for the error message.
+.Pp
 In the case of the
 .Fn err ,
 .Fn verr ,
 .Fn warn ,
 and
 .Fn vwarn
-functions, the error message string affiliated with the current value of
-the global variable
+functions, an additional error message string affiliated with the current
+value of the global variable
 .Va errno
 is output next, preceded by a colon character and a space if
 .Fa fmt
 is not
 .Dv NULL .
-In all cases, the output is followed by a newline character.
 The
 .Fn errc ,
 .Fn verrc ,
@@ -119,7 +122,9 @@ The
 .Fn warnx ,
 and
 .Fn vwarnx
-functions will not output this error message string.
+functions will not output an additional error message string.
+.Pp
+In all cases, the output is terminated by a newline character.
 .Pp
 The
 .Fn err ,
@@ -168,6 +173,7 @@ if ((fd = open(block_device, O_RDONLY, 0
 .Sh SEE ALSO
 .Xr exit 3 ,
 .Xr getprogname 3 ,
+.Xr printf 3 ,
 .Xr strerror 3
 .Sh HISTORY
 The



CVS commit: src/lib/libc/stdlib

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 17:58:36 UTC 2024

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

Log Message:
fix i386 lint


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/lib/libc/stdlib/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/stdlib/Makefile.inc
diff -u src/lib/libc/stdlib/Makefile.inc:1.97 src/lib/libc/stdlib/Makefile.inc:1.98
--- src/lib/libc/stdlib/Makefile.inc:1.97	Sat Jan 20 11:45:07 2024
+++ src/lib/libc/stdlib/Makefile.inc	Sat Jan 27 12:58:36 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.97 2024/01/20 16:45:07 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.98 2024/01/27 17:58:36 christos Exp $
 #	from: @(#)Makefile.inc	8.3 (Berkeley) 2/4/95
 
 # stdlib sources
@@ -120,10 +120,12 @@ LINTFLAGS.extent.c += -X 86,161,117,191,
 LINTFLAGS.extent_dss.c += -X 86,117,161,191,193,207,217,226
 LINTFLAGS.extent_mmap.c += -X 86,117,161,191,193,207,217,226
 LINTFLAGS.jemalloc.c += -X 86,117,161,191,193,207,217,226,236,307
+LINTFLAGS.jemalloc.c += -X 141 # i386
 LINTFLAGS.hooks.c += -X 226
 LINTFLAGS.large.c += -X 86,161,117,191,193,207,217,226
 LINTFLAGS.log.c += -X 86,117,161,191,193,207,217,226
 LINTFLAGS.malloc_io.c += -X 86,117,161,191,193,207,217,226,284
+LINTFLAGS.malloc_io.c += -X 132 # i386
 LINTFLAGS.mutex.c += -X 86,117,161,191,193,207,217,226
 LINTFLAGS.mutex_pool.c += -X 86,117,161,191,193,207,217,226
 LINTFLAGS.nstime.c += -X 86,117,161,191,193,207,217,226



CVS commit: src/lib/libc/stdlib

2024-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 27 17:58:36 UTC 2024

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

Log Message:
fix i386 lint


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/lib/libc/stdlib/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/hash/md2

2024-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 26 21:34:02 UTC 2024

Modified Files:
src/lib/libc/hash/md2: md2.c

Log Message:
move MD2Transform first.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/hash/md2/md2.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/hash/md2/md2.c
diff -u src/lib/libc/hash/md2/md2.c:1.8 src/lib/libc/hash/md2/md2.c:1.9
--- src/lib/libc/hash/md2/md2.c:1.8	Sat Jan 20 09:52:47 2024
+++ src/lib/libc/hash/md2/md2.c	Fri Jan 26 16:34:01 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: md2.c,v 1.8 2024/01/20 14:52:47 christos Exp $	*/
+/*	$NetBSD: md2.c,v 1.9 2024/01/26 21:34:01 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: md2.c,v 1.8 2024/01/20 14:52:47 christos Exp $");
+__RCSID("$NetBSD: md2.c,v 1.9 2024/01/26 21:34:01 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -103,6 +103,30 @@ __weak_alias(MD2Final,_MD2Final)
 __weak_alias(MD2Transform,_MD2Transform)
 #endif
 
+/*
+ * XXX This should not be visible, but due to an accident, it is
+ * XXX so it must remain so.
+ */
+/*static*/ void
+MD2Transform(MD2_CTX *context)
+{
+	uint32_t l, j, k, t;
+
+	/* set block "3" and update "checksum" */
+	for (l = context->C[15], j = 0; j < 16; j++) {
+		context->X[32 + j] = context->X[j] ^ context->X[16 + j];
+		l = context->C[j] ^= S[context->X[16 + j] ^ l];
+	}
+
+	/* mangle input block */
+	for (t = j = 0; j < 18; t = (t + j) % 256, j++)
+		for (k = 0; k < 48; k++)
+			t = context->X[k] = (context->X[k] ^ S[t]);
+
+	/* reset input pointer */
+	context->i = 16;
+}
+
 void
 MD2Init(MD2_CTX *context)
 {
@@ -155,28 +179,5 @@ MD2Final(unsigned char digest[16], MD2_C
 	MD2Init(context);
 }
 
-/*
- * XXX This should not be visible, but due to an accident, it is
- * XXX so it must remain so.
- */
-/*static*/ void
-MD2Transform(MD2_CTX *context)
-{
-	uint32_t l, j, k, t;
-
-	/* set block "3" and update "checksum" */
-	for (l = context->C[15], j = 0; j < 16; j++) {
-		context->X[32 + j] = context->X[j] ^ context->X[16 + j];
-		l = context->C[j] ^= S[context->X[16 + j] ^ l];
-	}
-
-	/* mangle input block */
-	for (t = j = 0; j < 18; t = (t + j) % 256, j++)
-		for (k = 0; k < 48; k++)
-			t = context->X[k] = (context->X[k] ^ S[t]);
-
-	/* reset input pointer */
-	context->i = 16;
-}
 
 #endif /* !HAVE_MD2_H */



CVS commit: src/lib/libc/hash/md2

2024-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 26 21:34:02 UTC 2024

Modified Files:
src/lib/libc/hash/md2: md2.c

Log Message:
move MD2Transform first.


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

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   >