CVS commit: src/sys/sys

2024-09-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 19 14:41:05 UTC 2024

Modified Files:
src/sys/sys: signal.h

Log Message:
PR lib/58674 (not really so much any more)

Correct previous.

bsd_signal should only be visible with _NETBSD_SOURCE - it isn't any kind of
standard function (despite also existing in other systems).

Turns out that it used to be an XSI function, back in the dark ages
('twas removed in POSIX issue 7, back in 2008, after being marked
obsolete in issue 6 (2001)).

So, make it visible to any applications that request a suitable
X/Open version (and of course, for _NETBSD_SOURCE).

Still no effect on the issue for the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/sys/signal.h

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

Modified files:

Index: src/sys/sys/signal.h
diff -u src/sys/sys/signal.h:1.77 src/sys/sys/signal.h:1.78
--- src/sys/sys/signal.h:1.77	Thu Sep 19 13:16:30 2024
+++ src/sys/sys/signal.h	Thu Sep 19 14:41:05 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.77 2024/09/19 13:16:30 kre Exp $	*/
+/*	$NetBSD: signal.h,v 1.78 2024/09/19 14:41:05 kre Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -321,8 +321,21 @@ void	(*signal(int, void (*)(int)))(int);
 #if (_POSIX_C_SOURCE - 0) >= 200112L || defined(_NETBSD_SOURCE)
 int	sigqueue(pid_t, int, const union sigval);
 #endif
-#if defined(_NETBSD_SOURCE)
+
+#if defined(_NETBSD_SOURCE) ||	\
+(!defined (_XOPEN_SOURCE) && defined(_XOPEN_VERSION) &&	\
+	(_XOPEN_VERSION - 0) >= 4) ||\
+(defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0) <= 600)
+/*
+ * bsd_signal() was added to the standards in POSIX issue 4 (SusV4)
+ * (release 2 of SusV4) and then removed in POSIX issue 7 (2008),
+ * after being marked obsolete in POSIX issue 6 (2001).  It was
+ * always an X/Open extension function (though was moved to the
+ * base POSIX spec in issue 5, but still as an extension).
+ */
 void	(*bsd_signal(int, void (*)(int)))(int);
+#endif
+#if defined(_NETBSD_SOURCE)
 int	sigqueueinfo(pid_t, const siginfo_t *);
 #endif
 __END_DECLS



CVS commit: src/sys/sys

2024-09-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 19 14:41:05 UTC 2024

Modified Files:
src/sys/sys: signal.h

Log Message:
PR lib/58674 (not really so much any more)

Correct previous.

bsd_signal should only be visible with _NETBSD_SOURCE - it isn't any kind of
standard function (despite also existing in other systems).

Turns out that it used to be an XSI function, back in the dark ages
('twas removed in POSIX issue 7, back in 2008, after being marked
obsolete in issue 6 (2001)).

So, make it visible to any applications that request a suitable
X/Open version (and of course, for _NETBSD_SOURCE).

Still no effect on the issue for the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/sys/signal.h

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



CVS commit: src/sys/sys

2024-09-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 19 13:16:30 UTC 2024

Modified Files:
src/sys/sys: signal.h

Log Message:
PR lib/58674

bsd_signal should only be visible with _NETBSD_SOURCE - it isn't any kind of
standard function (despite also existing in other systems).

This change inspired by the PR, but doesn't fix it in any way, the tools
config script for gmake doesn't care if the function is visible in any
header, merely if present in libc.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/sys/signal.h

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



CVS commit: src/sys/sys

2024-09-19 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 19 13:16:30 UTC 2024

Modified Files:
src/sys/sys: signal.h

Log Message:
PR lib/58674

bsd_signal should only be visible with _NETBSD_SOURCE - it isn't any kind of
standard function (despite also existing in other systems).

This change inspired by the PR, but doesn't fix it in any way, the tools
config script for gmake doesn't care if the function is visible in any
header, merely if present in libc.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/sys/signal.h

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

Modified files:

Index: src/sys/sys/signal.h
diff -u src/sys/sys/signal.h:1.76 src/sys/sys/signal.h:1.77
--- src/sys/sys/signal.h:1.76	Mon Sep  9 12:01:16 2024
+++ src/sys/sys/signal.h	Thu Sep 19 13:16:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.76 2024/09/09 12:01:16 riastradh Exp $	*/
+/*	$NetBSD: signal.h,v 1.77 2024/09/19 13:16:30 kre Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -318,11 +318,11 @@ struct	sigevent {
  */
 __BEGIN_DECLS
 void	(*signal(int, void (*)(int)))(int);
-void	(*bsd_signal(int, void (*)(int)))(int);
 #if (_POSIX_C_SOURCE - 0) >= 200112L || defined(_NETBSD_SOURCE)
 int	sigqueue(pid_t, int, const union sigval);
 #endif
 #if defined(_NETBSD_SOURCE)
+void	(*bsd_signal(int, void (*)(int)))(int);
 int	sigqueueinfo(pid_t, const siginfo_t *);
 #endif
 __END_DECLS



Re: CVS commit: src/sys/sys

2024-09-11 Thread Ryo ONODERA
Hi,

Christos Zoulas  writes:

> And committed.

Thank you very much for your quick fix.
It works fine for me now.

> christos
>
>

-- 
Ryo ONODERA // r...@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Re: CVS commit: src/sys/sys

2024-09-11 Thread Christos Zoulas
And committed.

christos




Re: CVS commit: src/sys/sys

2024-09-11 Thread Christos Zoulas

On 2024-09-11 11:18 am, Taylor R Campbell wrote:

Date: Thu, 12 Sep 2024 00:05:24 +0900
From: Ryo ONODERA 

"Taylor R Campbell"  writes:

> sys/endian.h: Hide le32enc/be32enc/... under _NETBSD_SOURCE.
>
> These are non-standard extensions, so they should not be exposed by,
> e.g., _XOPEN_SOURCE=700.
>
> PR standards/57807: #include  spuriously defines
> le32enc/be32enc/... under _XOPEN_SOURCE=700

After this change, -current build on -current is broken,
because tools/libctf defines _NETBSD_SOURCE and le32dec and so on
cause conflicts.

I think HAVE_NBTOOLS_CONFIG_H part in 
external/cddl/osnet/sys/sys/types.h

may be problematic. However it is not clear how to fix properly.

Could you take a look at this problem?


christos was looking at this yesterday -- christos, did you make
progress after our discussion?


P.S.
I feel that HAVE_NBTOOLS_CONFIG_H should be HAVE_NBTOOL_CONFIG_H.


Yes, except I think that whole stanza under HAVE_NBTOOL[S]_CONFIG_H is
wrong and should be replaced by an _unconditional_

#include_next 
#include_next 

without any _NETBSD_SOURCE games (which the tools build should never
play; we go out of our way to use _XOPEN_SOURCE=600 in compat_defs.h
so that _NETBSD_SOURCE does not get used everywhere else in the tools
build, in order to keep the tools build clean and portable).


Yes, close to finish the build and commit changes.

--
christos


Re: CVS commit: src/sys/sys

2024-09-11 Thread Taylor R Campbell
> Date: Thu, 12 Sep 2024 00:05:24 +0900
> From: Ryo ONODERA 
> 
> "Taylor R Campbell"  writes:
> 
> > sys/endian.h: Hide le32enc/be32enc/... under _NETBSD_SOURCE.
> >
> > These are non-standard extensions, so they should not be exposed by,
> > e.g., _XOPEN_SOURCE=700.
> >
> > PR standards/57807: #include  spuriously defines
> > le32enc/be32enc/... under _XOPEN_SOURCE=700
> 
> After this change, -current build on -current is broken,
> because tools/libctf defines _NETBSD_SOURCE and le32dec and so on
> cause conflicts.
> 
> I think HAVE_NBTOOLS_CONFIG_H part in external/cddl/osnet/sys/sys/types.h
> may be problematic. However it is not clear how to fix properly.
> 
> Could you take a look at this problem?

christos was looking at this yesterday -- christos, did you make
progress after our discussion?

> P.S.
> I feel that HAVE_NBTOOLS_CONFIG_H should be HAVE_NBTOOL_CONFIG_H.

Yes, except I think that whole stanza under HAVE_NBTOOL[S]_CONFIG_H is
wrong and should be replaced by an _unconditional_

#include_next 
#include_next 

without any _NETBSD_SOURCE games (which the tools build should never
play; we go out of our way to use _XOPEN_SOURCE=600 in compat_defs.h
so that _NETBSD_SOURCE does not get used everywhere else in the tools
build, in order to keep the tools build clean and portable).


Re: CVS commit: src/sys/sys

2024-09-11 Thread Ryo ONODERA
Hi,

"Taylor R Campbell"  writes:

> Module Name:  src
> Committed By: riastradh
> Date: Mon Sep  9 18:17:14 UTC 2024
>
> Modified Files:
>   src/sys/sys: endian.h
>
> Log Message:
> sys/endian.h: Hide le32enc/be32enc/... under _NETBSD_SOURCE.
>
> These are non-standard extensions, so they should not be exposed by,
> e.g., _XOPEN_SOURCE=700.
>
> PR standards/57807: #include  spuriously defines
> le32enc/be32enc/... under _XOPEN_SOURCE=700

After this change, -current build on -current is broken,
because tools/libctf defines _NETBSD_SOURCE and le32dec and so on
cause conflicts.

I think HAVE_NBTOOLS_CONFIG_H part in external/cddl/osnet/sys/sys/types.h
may be problematic. However it is not clear how to fix properly.

Could you take a look at this problem?

P.S.
I feel that HAVE_NBTOOLS_CONFIG_H should be HAVE_NBTOOL_CONFIG_H.

Thank you.

> To generate a diff of this commit:
> cvs rdiff -u -r1.33 -r1.34 src/sys/sys/endian.h
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>
> Modified files:
>
> Index: src/sys/sys/endian.h
> diff -u src/sys/sys/endian.h:1.33 src/sys/sys/endian.h:1.34
> --- src/sys/sys/endian.h:1.33 Mon Sep  9 15:22:50 2024
> +++ src/sys/sys/endian.h  Mon Sep  9 18:17:14 2024
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: endian.h,v 1.33 2024/09/09 15:22:50 riastradh Exp $*/
> +/*   $NetBSD: endian.h,v 1.34 2024/09/09 18:17:14 riastradh Exp $*/
>  
>  /*
>   * Copyright (c) 1987, 1991, 1993
> @@ -192,6 +192,8 @@ __END_DECLS
>   * to/from an octet stream.
>   */
>  
> +#ifdef _NETBSD_SOURCE
> +
>  #if __GNUC_PREREQ__(2, 95)
>  
>  #define __GEN_ENDIAN_ENC(bits, endian) \
> @@ -337,6 +339,8 @@ le64dec(const void *buf)
>  
>  #endif   /* GCC >= 2.95 */
>  
> +#endif   /* _NETBSD_SOURCE */
> +
>  #endif /* !_LOCORE */
>  #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
>  #endif /* !_SYS_ENDIAN_H_ */
>

-- 
Ryo ONODERA // r...@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


CVS commit: src/sys/sys

2024-09-09 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep  9 18:38:38 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
sys/endian.h: sync comment with code


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/endian.h

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

Modified files:

Index: src/sys/sys/endian.h
diff -u src/sys/sys/endian.h:1.34 src/sys/sys/endian.h:1.35
--- src/sys/sys/endian.h:1.34	Mon Sep  9 18:17:14 2024
+++ src/sys/sys/endian.h	Mon Sep  9 18:38:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: endian.h,v 1.34 2024/09/09 18:17:14 riastradh Exp $	*/
+/*	$NetBSD: endian.h,v 1.35 2024/09/09 18:38:38 rillig Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -74,7 +74,7 @@ uint16_t ntohs(uint16_t) __constfunc;
 __END_DECLS
 
 #endif /* !_LOCORE */
-#endif /* _XOPEN_SOURCE || _POSIX_C_SOURCE >= 200809L || _NETBSD_SOURCE */
+#endif /* _XOPEN_SOURCE || _POSIX_C_SOURCE >= 200112L || _NETBSD_SOURCE */
 
 
 #include 



CVS commit: src/sys/sys

2024-09-09 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep  9 18:38:38 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
sys/endian.h: sync comment with code


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/endian.h

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



CVS commit: src/sys/sys

2024-09-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Sep  9 18:17:14 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
sys/endian.h: Hide le32enc/be32enc/... under _NETBSD_SOURCE.

These are non-standard extensions, so they should not be exposed by,
e.g., _XOPEN_SOURCE=700.

PR standards/57807: #include  spuriously defines
le32enc/be32enc/... under _XOPEN_SOURCE=700


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/endian.h

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

Modified files:

Index: src/sys/sys/endian.h
diff -u src/sys/sys/endian.h:1.33 src/sys/sys/endian.h:1.34
--- src/sys/sys/endian.h:1.33	Mon Sep  9 15:22:50 2024
+++ src/sys/sys/endian.h	Mon Sep  9 18:17:14 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: endian.h,v 1.33 2024/09/09 15:22:50 riastradh Exp $	*/
+/*	$NetBSD: endian.h,v 1.34 2024/09/09 18:17:14 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -192,6 +192,8 @@ __END_DECLS
  * to/from an octet stream.
  */
 
+#ifdef _NETBSD_SOURCE
+
 #if __GNUC_PREREQ__(2, 95)
 
 #define __GEN_ENDIAN_ENC(bits, endian) \
@@ -337,6 +339,8 @@ le64dec(const void *buf)
 
 #endif	/* GCC >= 2.95 */
 
+#endif	/* _NETBSD_SOURCE */
+
 #endif /* !_LOCORE */
 #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
 #endif /* !_SYS_ENDIAN_H_ */



CVS commit: src/sys/sys

2024-09-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Sep  9 18:17:14 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
sys/endian.h: Hide le32enc/be32enc/... under _NETBSD_SOURCE.

These are non-standard extensions, so they should not be exposed by,
e.g., _XOPEN_SOURCE=700.

PR standards/57807: #include  spuriously defines
le32enc/be32enc/... under _XOPEN_SOURCE=700


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/endian.h

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



CVS commit: src/sys/sys

2024-09-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Sep  9 15:22:50 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
arpa/inet.h: Define htonl &c. under _POSIX_C_SOURCE >= 200112L too.

These do not require _XOPEN_SOURCE as of POSIX 2001:

https://pubs.opengroup.org/onlinepubs/009696799/functions/htonl.html

XXX Since this change is actually sys/endian.h, in principle it might
bleed into header files than just arpa/inet.h.  But sys/endian.h is
not used by anything that looks especially risky to me.

PR standards/57806: #include  fails to define
htonl/htons/ntohl/ntohs under _POSIX_C_SOURCE=200809L


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/sys/endian.h

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

Modified files:

Index: src/sys/sys/endian.h
diff -u src/sys/sys/endian.h:1.32 src/sys/sys/endian.h:1.33
--- src/sys/sys/endian.h:1.32	Wed Jan  3 18:43:52 2024
+++ src/sys/sys/endian.h	Mon Sep  9 15:22:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: endian.h,v 1.32 2024/01/03 18:43:52 christos Exp $	*/
+/*	$NetBSD: endian.h,v 1.33 2024/09/09 15:22:50 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -45,7 +45,9 @@
 #define	_PDP_ENDIAN	3412	/* LSB first in word, MSW first in long */
 
 
-#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
+#if defined(_XOPEN_SOURCE) || \
+(_POSIX_C_SOURCE - 0) >= 200112L || \
+defined(_NETBSD_SOURCE)
 #ifndef _LOCORE
 
 /* C-family endian-ness definitions */
@@ -72,7 +74,7 @@ uint16_t ntohs(uint16_t) __constfunc;
 __END_DECLS
 
 #endif /* !_LOCORE */
-#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
+#endif /* _XOPEN_SOURCE || _POSIX_C_SOURCE >= 200809L || _NETBSD_SOURCE */
 
 
 #include 



CVS commit: src/sys/sys

2024-09-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Sep  9 15:22:50 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
arpa/inet.h: Define htonl &c. under _POSIX_C_SOURCE >= 200112L too.

These do not require _XOPEN_SOURCE as of POSIX 2001:

https://pubs.opengroup.org/onlinepubs/009696799/functions/htonl.html

XXX Since this change is actually sys/endian.h, in principle it might
bleed into header files than just arpa/inet.h.  But sys/endian.h is
not used by anything that looks especially risky to me.

PR standards/57806: #include  fails to define
htonl/htons/ntohl/ntohs under _POSIX_C_SOURCE=200809L


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/sys/endian.h

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



CVS commit: src/sys/sys

2024-09-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Sep  9 15:05:39 UTC 2024

Modified Files:
src/sys/sys: featuretest.h

Log Message:
sys/featuretest.h: Define _POSIX_C_SOURCE according to _XOPEN_SOURCE.

If _XOPEN_SOURCE is defined but _POSIX_C_SOURCE is not, there is a
corresponding value of _POSIX_C_SOURCE that _XOPEN_SOURCE is supposed
to be equivalent to.  We could sprinkle conditionals for
_XOPEN_SOURCE everywhere we already have conditionals for
_POSIX_C_SOURCE, like in , but it's simpler and more
reliable to simply define _POSIX_C_SOURCE based on _XOPEN_SOURCE in
one place.

PR standards/55577: locale_t not defined if _XOPEN_SOURCE is defined


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

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

Modified files:

Index: src/sys/sys/featuretest.h
diff -u src/sys/sys/featuretest.h:1.12 src/sys/sys/featuretest.h:1.13
--- src/sys/sys/featuretest.h:1.12	Thu Aug 15 20:42:59 2024
+++ src/sys/sys/featuretest.h	Mon Sep  9 15:05:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: featuretest.h,v 1.12 2024/08/15 20:42:59 riastradh Exp $	*/
+/*	$NetBSD: featuretest.h,v 1.13 2024/09/09 15:05:39 riastradh Exp $	*/
 
 /*
  * Written by Klaus Klein , February 2, 1998.
@@ -92,3 +92,61 @@
 !defined(_REENTRANT)
 #define _REENTRANT
 #endif
+
+/*
+ * The _XOPEN_SOURCE namespaces are supersets of corresponding
+ * _POSIX_C_SOURCE namespaces, so to keep the namespace tests in header
+ * files simpler, if _XOPEN_SOURCE is defined but _POSIX_C_SOURCE is
+ * not, define _POSIX_C_SOURCE to the corresponding value.
+ */
+#if defined(_XOPEN_SOURCE) && !defined(_POSIX_C_SOURCE)
+
+/*
+ * `[I]f _XOPEN_SOURCE is set equal to 800 and _POSIX_C_SOURCE is set
+ *  equal to 202405L, the behavior is the same as if only _XOPEN_SOURCE
+ *  is defined and set equal to 800.
+ *
+ * IEEE Std 1003.1-2024, 2.2.1.2 `The _XOPEN_SOURCE Feature Test Macro'
+ * https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/V2_chap02.html#tag_16_02_01_02
+ */
+#if (_XOPEN_SOURCE - 0) == 800
+#define	_POSIX_C_SOURCE	202405L
+
+/*
+ * `[I]f _XOPEN_SOURCE is set equal to 700 and _POSIX_C_SOURCE is set
+ *  equal to 200809L, the behavior is the same as if only _XOPEN_SOURCE
+ *  is defined and set equal to 700.'
+ *
+ * IEEE Std 1003.1-2008, 2.2.1 `POSIX.1 Symbols', subsection `The
+ * _XOPEN_SOURCE Feature Test Macro'
+ * https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/V2_chap02.html
+ */
+#elif (_XOPEN_SOURCE - 0) == 700
+#define	_POSIX_C_SOURCE	200809L
+
+/*
+ * `[I]f _XOPEN_SOURCE is set equal to 600 and _POSIX_C_SOURCE is set
+ *  equal to 200112L, the behavior is the same as if only _XOPEN_SOURCE
+ *  is defined and set equal to 600.'
+ *
+ * IEEE Std 1003.1-2001, 2.2.1 `POSIX.1 Symbols', subsection `The
+ * _XOPEN_SOURCE Feature Test Macro'
+ * https://pubs.opengroup.org/onlinepubs/007904875/functions/xsh_chap02_02.html
+ */
+#elif (_XOPEN_SOURCE - 0) == 600
+#define	_POSIX_C_SOURCE	200112L
+
+/*
+ * `[I]f _XOPEN_SOURCE is set equal to 500 and _POSIX_SOURCE is
+ *  defined, or _POSIX_C_SOURCE is set greater than zero and less than
+ *  or equal to 199506L, the behaviour is the same as if only
+ *  _XOPEN_SOURCE is defined and set equal to 500.'
+ *
+ * Single UNIX Specification, Version 2, `The Compilation Environment'
+ * https://pubs.opengroup.org/onlinepubs/007908799/xsh/compilation.html
+ */
+#elif (_XOPEN_SOURCE - 0) == 500
+#define	_POSIX_C_SOURCE	199506L
+#endif
+
+#endif



CVS commit: src/sys/sys

2024-09-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Sep  9 15:05:39 UTC 2024

Modified Files:
src/sys/sys: featuretest.h

Log Message:
sys/featuretest.h: Define _POSIX_C_SOURCE according to _XOPEN_SOURCE.

If _XOPEN_SOURCE is defined but _POSIX_C_SOURCE is not, there is a
corresponding value of _POSIX_C_SOURCE that _XOPEN_SOURCE is supposed
to be equivalent to.  We could sprinkle conditionals for
_XOPEN_SOURCE everywhere we already have conditionals for
_POSIX_C_SOURCE, like in , but it's simpler and more
reliable to simply define _POSIX_C_SOURCE based on _XOPEN_SOURCE in
one place.

PR standards/55577: locale_t not defined if _XOPEN_SOURCE is defined


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

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



CVS commit: src/sys/sys

2024-09-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Sep  9 12:01:16 UTC 2024

Modified Files:
src/sys/sys: signal.h

Log Message:
signal.h: Fix namespacing for various SA_* constants.

References:

POSIX 2001 (items labeled XSI are restricted by _XOPEN_SOURCE):
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html

POSIX 2008 (items no longer labeled XSI are available if
_POSIX_C_SOURCE >= 200809L):
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html

PR standards/55429: SA_RESTART not available if
-D_POSIX_C_SOURCE=200809L


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/sys/signal.h

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

Modified files:

Index: src/sys/sys/signal.h
diff -u src/sys/sys/signal.h:1.75 src/sys/sys/signal.h:1.76
--- src/sys/sys/signal.h:1.75	Tue Nov  2 20:12:26 2021
+++ src/sys/sys/signal.h	Mon Sep  9 12:01:16 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.75 2021/11/02 20:12:26 christos Exp $	*/
+/*	$NetBSD: signal.h,v 1.76 2024/09/09 12:01:16 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -215,17 +215,18 @@ struct	sigaction {
 #endif
 
 #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
-(_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
+(_XOPEN_SOURCE - 0) >= 500 || (_POSIX_C_SOURCE - 0) >= 200809L || \
+defined(_NETBSD_SOURCE)
 #define SA_ONSTACK	0x0001	/* take signal on signal stack */
 #define SA_RESTART	0x0002	/* restart system call on signal return */
 #define SA_RESETHAND	0x0004	/* reset to SIG_DFL when taking signal */
 #define SA_NODEFER	0x0010	/* don't mask the signal we're delivering */
-#endif /* _XOPEN_SOURCE_EXTENDED || XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */
+#endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 200809L || _NETBSD_SOURCE */
 /* Only valid for SIGCHLD. */
 #define SA_NOCLDSTOP	0x0008	/* do not generate SIGCHLD on child stop */
-#define SA_NOCLDWAIT	0x0020	/* do not generate zombies on unwaited child */
 #if (_POSIX_C_SOURCE - 0) >= 199309L || (_XOPEN_SOURCE - 0) >= 500 || \
 defined(_NETBSD_SOURCE)
+#define SA_NOCLDWAIT	0x0020	/* do not generate zombies on unwaited child */
 #define SA_SIGINFO	0x0040	/* take sa_sigaction handler */
 #endif /* (_POSIX_C_SOURCE - 0) >= 199309L || ... */
 #if defined(_NETBSD_SOURCE)



CVS commit: src/sys/sys

2024-09-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Sep  9 12:01:16 UTC 2024

Modified Files:
src/sys/sys: signal.h

Log Message:
signal.h: Fix namespacing for various SA_* constants.

References:

POSIX 2001 (items labeled XSI are restricted by _XOPEN_SOURCE):
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html

POSIX 2008 (items no longer labeled XSI are available if
_POSIX_C_SOURCE >= 200809L):
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html

PR standards/55429: SA_RESTART not available if
-D_POSIX_C_SOURCE=200809L


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/sys/signal.h

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



CVS commit: src/sys/sys

2024-08-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 27 00:57:35 UTC 2024

Modified Files:
src/sys/sys: param.h

Log Message:
sys/param.h: Welcome to 10.99.12!

Courtesy of entropy_consolidate's new return value, telling the
caller whether it was interrupted by a signal or not.


To generate a diff of this commit:
cvs rdiff -u -r1.734 -r1.735 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.734 src/sys/sys/param.h:1.735
--- src/sys/sys/param.h:1.734	Sat Jun 29 13:04:20 2024
+++ src/sys/sys/param.h	Tue Aug 27 00:57:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.734 2024/06/29 13:04:20 riastradh Exp $	*/
+/*	$NetBSD: param.h,v 1.735 2024/08/27 00:57:35 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	1099001100	/* NetBSD 10.99.11 */
+#define	__NetBSD_Version__	1099001200	/* NetBSD 10.99.12 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/sys

2024-08-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 27 00:57:35 UTC 2024

Modified Files:
src/sys/sys: param.h

Log Message:
sys/param.h: Welcome to 10.99.12!

Courtesy of entropy_consolidate's new return value, telling the
caller whether it was interrupted by a signal or not.


To generate a diff of this commit:
cvs rdiff -u -r1.734 -r1.735 src/sys/sys/param.h

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



CVS commit: src/sys/sys

2024-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 19 17:16:02 UTC 2024

Modified Files:
src/sys/sys: disklabel_gpt.h

Log Message:
Add OpenBSD UUID (Anon Ymous)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/sys/disklabel_gpt.h

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



CVS commit: src/sys/sys

2024-08-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 19 17:16:02 UTC 2024

Modified Files:
src/sys/sys: disklabel_gpt.h

Log Message:
Add OpenBSD UUID (Anon Ymous)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/sys/disklabel_gpt.h

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

Modified files:

Index: src/sys/sys/disklabel_gpt.h
diff -u src/sys/sys/disklabel_gpt.h:1.16 src/sys/sys/disklabel_gpt.h:1.17
--- src/sys/sys/disklabel_gpt.h:1.16	Tue Sep 26 11:47:11 2023
+++ src/sys/sys/disklabel_gpt.h	Mon Aug 19 13:16:02 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel_gpt.h,v 1.16 2023/09/26 15:47:11 kre Exp $	*/
+/*	$NetBSD: disklabel_gpt.h,v 1.17 2024/08/19 17:16:02 christos Exp $	*/
 
 /*
  * Copyright (c) 2002 Marcel Moolenaar
@@ -136,6 +136,10 @@ struct gpt_ent {
 	{0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
 #define GPT_ENT_TYPE_FREEBSD_ZFS	\
 	{0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
+
+#define GPT_ENT_TYPE_OPENBSD_DATA	\
+	{0x824CC7A0,0x36A8,0x11E3,0x89,0x0A,{0x95,0x25,0x19,0xAD,0x3F,0x61}}
+
 /*
  * The following are unused but documented here to avoid reuse.
  *



CVS commit: src/sys/sys

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 20:42:59 UTC 2024

Modified Files:
src/sys/sys: featuretest.h

Log Message:
sys/featuretest.h: Cite references for _POSIX_C_SOURCE/_XOPEN_SOURCE.

No functional change intended, comment-only.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/featuretest.h

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



CVS commit: src/sys/sys

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 20:42:59 UTC 2024

Modified Files:
src/sys/sys: featuretest.h

Log Message:
sys/featuretest.h: Cite references for _POSIX_C_SOURCE/_XOPEN_SOURCE.

No functional change intended, comment-only.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/featuretest.h

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

Modified files:

Index: src/sys/sys/featuretest.h
diff -u src/sys/sys/featuretest.h:1.11 src/sys/sys/featuretest.h:1.12
--- src/sys/sys/featuretest.h:1.11	Thu Aug 15 20:25:47 2024
+++ src/sys/sys/featuretest.h	Thu Aug 15 20:42:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: featuretest.h,v 1.11 2024/08/15 20:25:47 riastradh Exp $	*/
+/*	$NetBSD: featuretest.h,v 1.12 2024/08/15 20:42:59 riastradh Exp $	*/
 
 /*
  * Written by Klaus Klein , February 2, 1998.
@@ -31,6 +31,13 @@
  * _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
  * _POSIX_C_SOURCE == 202405L   IEEE Std 1003.1-2024
  *
+ * Reference:
+ *
+ *	The Open Group Base Specifications Issue 8, IEEE Std
+ *	1003.1-2024, IEEE and The Open Group, 2024, Sec. 2.2.1.1 `The
+ *	_POSIX_C_SOURCE Feature Test Macro'.
+ *	https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/V2_chap02.html#tag_16_02_01_01
+ *
  * X/Open macros:
  * _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
  * _XOPEN_SOURCE_EXTENDED == 1	XSH4.2 UNIX extensions
@@ -40,6 +47,13 @@
  * _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
  * _XOPEN_SOURCE == 800		IEEE Std 1003.1-2024, XSI option
  *
+ * Reference:
+ *
+ *	The Open Group Base Specifications Issue 8, IEEE Std
+ *	1003.1-2024, IEEE and The Open Group, 2024, Sec. 2.2.1.2 `The
+ *	_XOPEN_SOURCE Feature Test Macro'.
+ *	https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/V2_chap02.html#tag_16_02_01_02
+ *
  * NetBSD macros:
  * _NETBSD_SOURCE == 1		Make all NetBSD features available.
  *



CVS commit: src/sys/sys

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 20:25:47 UTC 2024

Modified Files:
src/sys/sys: featuretest.h

Log Message:
sys/featuretest.h: Update comments for POSIX 2024 and C23.

No functional change intended.

Maybe we should turn this into a man page.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/featuretest.h

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

Modified files:

Index: src/sys/sys/featuretest.h
diff -u src/sys/sys/featuretest.h:1.10 src/sys/sys/featuretest.h:1.11
--- src/sys/sys/featuretest.h:1.10	Fri Apr 26 18:29:06 2013
+++ src/sys/sys/featuretest.h	Thu Aug 15 20:25:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: featuretest.h,v 1.10 2013/04/26 18:29:06 christos Exp $	*/
+/*	$NetBSD: featuretest.h,v 1.11 2024/08/15 20:25:47 riastradh Exp $	*/
 
 /*
  * Written by Klaus Klein , February 2, 1998.
@@ -29,6 +29,7 @@
  * _POSIX_C_SOURCE == 199506L	ISO/IEC 9945-1:1996
  * _POSIX_C_SOURCE == 200112L	IEEE Std 1003.1-2001
  * _POSIX_C_SOURCE == 200809L   IEEE Std 1003.1-2008
+ * _POSIX_C_SOURCE == 202405L   IEEE Std 1003.1-2024
  *
  * X/Open macros:
  * _XOPEN_SOURCE		System Interfaces and Headers, Issue 4, Ver 2
@@ -37,6 +38,7 @@
  * _XOPEN_SOURCE == 520		Networking Services (XNS), Issue 5.2
  * _XOPEN_SOURCE == 600		IEEE Std 1003.1-2001, XSI option
  * _XOPEN_SOURCE == 700		IEEE Std 1003.1-2008, XSI option
+ * _XOPEN_SOURCE == 800		IEEE Std 1003.1-2024, XSI option
  *
  * NetBSD macros:
  * _NETBSD_SOURCE == 1		Make all NetBSD features available.
@@ -54,11 +56,13 @@
  * defined along with one of the "major" macros.  The "minor" macros
  * are:
  *
- * _REENTRANT
- * _ISOC99_SOURCE
- * _ISOC11_SOURCE
- * _LARGEFILE_SOURCE		Large File Support
- *		
+ * _REENTRANT		Some thread-safety extensions like lgamma_r(3)
+ *			  (mostly subsumed by _POSIX_C_SOURCE >= 199506L)
+ * _ISOC99_SOURCE	C99 extensions like snprintf without -std=c99
+ * _ISOC11_SOURCE	C11 extensions like aligned_alloc without -std=c11
+ * _ISOC23_SOURCE	C23 extensions like mbrtoc8 without -std=c23
+ * _OPENBSD_SOURCE	Nonstandard OpenBSD extensions like strtonum(3)
+ * _GNU_SOURCE		Nonstandard GNU extensions like feenableexcept(3)
  */
 
 #if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)



CVS commit: src/sys/sys

2024-08-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 15 20:25:47 UTC 2024

Modified Files:
src/sys/sys: featuretest.h

Log Message:
sys/featuretest.h: Update comments for POSIX 2024 and C23.

No functional change intended.

Maybe we should turn this into a man page.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/featuretest.h

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



CVS commit: src/sys/sys

2024-07-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jul 11 06:05:59 UTC 2024

Modified Files:
src/sys/sys: syslog.h

Log Message:
sys/syslog.h: Nix trailing whitespace.

No functional change intended.

PR 58391


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/sys/syslog.h

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

Modified files:

Index: src/sys/sys/syslog.h
diff -u src/sys/sys/syslog.h:1.42 src/sys/sys/syslog.h:1.43
--- src/sys/sys/syslog.h:1.42	Mon Jul  8 22:14:31 2024
+++ src/sys/sys/syslog.h	Thu Jul 11 06:05:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: syslog.h,v 1.42 2024/07/08 22:14:31 christos Exp $	*/
+/*	$NetBSD: syslog.h,v 1.43 2024/07/11 06:05:58 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
@@ -222,11 +222,11 @@ void	vsyslogp_r(int, struct syslog_data 
 const char *, __va_list) __RENAME(__vsyslogp_r60) __sysloglike(5, 0);
 void	syslog_ss(int, struct syslog_data *, const char *, ...)
 __RENAME(__syslog_ss60) __sysloglike(3, 4);
-voidvsyslog_ss(int, struct syslog_data *, const char *, va_list) 
-__RENAME(__vsyslog_ss60) __sysloglike(3, 0); 
-void	syslogp_ss(int, struct syslog_data *, const char *, const char *, 
+voidvsyslog_ss(int, struct syslog_data *, const char *, va_list)
+__RENAME(__vsyslog_ss60) __sysloglike(3, 0);
+void	syslogp_ss(int, struct syslog_data *, const char *, const char *,
 const char *, ...) __RENAME(__syslogp_ss60) __sysloglike(5, 0);
-void	vsyslogp_ss(int, struct syslog_data *, const char *, const char *, 
+void	vsyslogp_ss(int, struct syslog_data *, const char *, const char *,
 const char *, va_list) __RENAME(__vsyslogp_ss60) __sysloglike(5, 0);
 #endif
 void	syslogp(int, const char *, const char *, const char *, ...)



CVS commit: src/sys/sys

2024-07-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jul 11 06:05:59 UTC 2024

Modified Files:
src/sys/sys: syslog.h

Log Message:
sys/syslog.h: Nix trailing whitespace.

No functional change intended.

PR 58391


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/sys/syslog.h

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



CVS commit: src/sys/sys

2024-06-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 29 13:04:20 UTC 2024

Modified Files:
src/sys/sys: param.h

Log Message:
Welcome to NetBSD 10.99.11, courtesy of sdt:::set-error probe.

PR kern/58378

(and also if_stat..._ref API change, PR kern/58377)


To generate a diff of this commit:
cvs rdiff -u -r1.733 -r1.734 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.733 src/sys/sys/param.h:1.734
--- src/sys/sys/param.h:1.733	Wed Oct  4 20:29:59 2023
+++ src/sys/sys/param.h	Sat Jun 29 13:04:20 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.733 2023/10/04 20:29:59 ad Exp $	*/
+/*	$NetBSD: param.h,v 1.734 2024/06/29 13:04:20 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	1099001000	/* NetBSD 10.99.10 */
+#define	__NetBSD_Version__	1099001100	/* NetBSD 10.99.11 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/sys

2024-06-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 29 13:04:20 UTC 2024

Modified Files:
src/sys/sys: param.h

Log Message:
Welcome to NetBSD 10.99.11, courtesy of sdt:::set-error probe.

PR kern/58378

(and also if_stat..._ref API change, PR kern/58377)


To generate a diff of this commit:
cvs rdiff -u -r1.733 -r1.734 src/sys/sys/param.h

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



CVS commit: src/sys/sys

2024-06-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 29 03:01:29 UTC 2024

Modified Files:
src/sys/sys: sdt.h

Log Message:
sys/sdt.h: Make SDT_PROBE* work as expressions.

This way, they can be used inside other expressions with the comma
operator, such as in the SET_ERROR macro.

In preparation for PR kern/58378.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/sys/sdt.h

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



CVS commit: src/sys/sys

2024-06-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jun 29 03:01:29 UTC 2024

Modified Files:
src/sys/sys: sdt.h

Log Message:
sys/sdt.h: Make SDT_PROBE* work as expressions.

This way, they can be used inside other expressions with the comma
operator, such as in the SET_ERROR macro.

In preparation for PR kern/58378.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/sys/sdt.h

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

Modified files:

Index: src/sys/sys/sdt.h
diff -u src/sys/sys/sdt.h:1.22 src/sys/sys/sdt.h:1.23
--- src/sys/sys/sdt.h:1.22	Sun Apr 30 08:46:33 2023
+++ src/sys/sys/sdt.h	Sat Jun 29 03:01:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdt.h,v 1.22 2023/04/30 08:46:33 riastradh Exp $	*/
+/*	$NetBSD: sdt.h,v 1.23 2024/06/29 03:01:29 riastradh Exp $	*/
 
 /*-
  * Copyright 2006-2008 John Birrell 
@@ -226,13 +226,12 @@
 #define SDT_PROBE_DECLARE(prov, mod, func, name)			  \
 	extern struct sdt_probe sdt_##prov##_##mod##_##func##_##name[1]
 
-#define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)	do\
-{	  \
-	if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))	  \
-		(*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id,   \
-		(uintptr_t)(arg0), (uintptr_t)(arg1), (uintptr_t)(arg2),  \
-		(uintptr_t)(arg3), (uintptr_t)(arg4));		  \
-} while (0)
+#define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)	  \
+	(__predict_false(sdt_##prov##_##mod##_##func##_##name->id)	  \
+	? (*sdt_probe_func)(sdt_##prov##_##mod##_##func##_##name->id, \
+		(uintptr_t)(arg0), (uintptr_t)(arg1), (uintptr_t)(arg2),  \
+		(uintptr_t)(arg3), (uintptr_t)(arg4))			  \
+	: 0)
 
 #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype)	  \
 	static struct sdt_argtype sdta_##prov##_##mod##_##func##_##name##num[1]\
@@ -372,31 +371,29 @@
 #define	SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \
 	SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
 /* XXX: void * function casts */
-#define	SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4,	  \
-arg5)	do			  \
-{	  \
-	if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))	  \
-		__FPTRCAST(void (*)(uint32_t, uintptr_t, uintptr_t,	  \
-			uintptr_t, uintptr_t, uintptr_t, uintptr_t),	  \
-		sdt_probe_func)(	  \
+#define	SDT_PROBE6(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5) \
+	(__predict_false(sdt_##prov##_##mod##_##func##_##name->id)	  \
+	? __FPTRCAST(void (*)(uint32_t, uintptr_t, uintptr_t,	  \
+		uintptr_t, uintptr_t, uintptr_t, uintptr_t),	  \
+		sdt_probe_func)(	  \
 			sdt_##prov##_##mod##_##func##_##name->id,	  \
 			(uintptr_t)(arg0), (uintptr_t)(arg1),		  \
 			(uintptr_t)(arg2), (uintptr_t)(arg3),		  \
-			(uintptr_t)(arg4), (uintptr_t)(arg5));		  \
-} while (0)
+			(uintptr_t)(arg4), (uintptr_t)(arg5))		  \
+	: 0)
 #define	SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \
-arg6)	do			  \
-{	  \
-	if (__predict_false(sdt_##prov##_##mod##_##func##_##name->id))	  \
-		__FPTRCAST(void (*)(uint32_t, uintptr_t, uintptr_t,	  \
-			uintptr_t, uintptr_t, uintptr_t, uintptr_t,	  \
-			uintptr_t), sdt_probe_func)(			  \
+arg6)  \
+	(__predict_false(sdt_##prov##_##mod##_##func##_##name->id)	  \
+	? __FPTRCAST(void (*)(uint32_t, uintptr_t, uintptr_t,	  \
+		uintptr_t, uintptr_t, uintptr_t, uintptr_t,		  \
+		uintptr_t),		  \
+		sdt_probe_func)(	  \
 			sdt_##prov##_##mod##_##func##_##name->id,	  \
 			(uintptr_t)(arg0), (uintptr_t)(arg1),		  \
 			(uintptr_t)(arg2), (uintptr_t)(arg3),		  \
 			(uintptr_t)(arg4), (uintptr_t)(arg5),		  \
-			(uintptr_t)(arg6));  \
-} while (0)
+			(uintptr_t)(arg6))  \
+	: 0)
 
 #define	DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4)	do\
 {	  \



Re: CVS commit: src/sys/sys

2024-06-02 Thread Ryo ONODERA
Hi,

Thanks for your fix.
It works fine for me.

"Taylor R Campbell"  writes:

> Module Name:  src
> Committed By: riastradh
> Date: Sat May 25 13:44:48 UTC 2024
>
> Modified Files:
>   src/sys/sys: ucontext.h
>
> Log Message:
> ucontext.h: Expose __UCONTEXT_SIZE to userland.
>
> But don't expose __CTASSERT(__UCONTEXT_SIZE == sizeof(ucontext_t)) to
> userland.
>
> - __UCONTEXT_SIZE will be needed soon by libc and signal trampolines
>   in order to version ucontext so we can safely expand it with
>   architecture extensions.
>
> - __CTASSERT is not safe to use in header files in arbitrary
>   compilation environments (although in the NetBSD kernel build it is
>   safe).  Exposing the __CTASSERT in a header file used by userland
>   appears to have the side effect of breaking the Firefox build in
>   rustc, though the mechanism isn't entirely clear.
>
> Firefox/rustc discussion here:
> https://mail-index.netbsd.org/pkgsrc-users/2024/05/18/msg039578.html
>
> Let's see if this makes a difference -- if it works, great; if not,
> maybe it will help us to narrow down what's happening with rustc and
> Firefox.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.23 -r1.24 src/sys/sys/ucontext.h
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>
> Modified files:
>
> Index: src/sys/sys/ucontext.h
> diff -u src/sys/sys/ucontext.h:1.23 src/sys/sys/ucontext.h:1.24
> --- src/sys/sys/ucontext.h:1.23   Fri May 24 13:50:30 2024
> +++ src/sys/sys/ucontext.hSat May 25 13:44:48 2024
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: ucontext.h,v 1.23 2024/05/24 13:50:30 ryoon Exp $  */
> +/*   $NetBSD: ucontext.h,v 1.24 2024/05/25 13:44:48 riastradh Exp $  */
>  
>  /*-
>   * Copyright (c) 1999, 2003, 2024 The NetBSD Foundation, Inc.
> @@ -82,6 +82,10 @@ struct __ucontext {
>  #define _UC_UCONTEXT_ALIGN (~0)
>  #endif
>  
> +#ifndef __UCONTEXT_SIZE
> +#define  __UCONTEXT_SIZE sizeof(ucontext_t)
> +#endif
> +
>  #ifndef _UC_TLSBASE
>  #error   _UC_TLSBASE not defined.
>  #endif
> @@ -105,8 +109,6 @@ int   cpu_mcontext_validate(struct lwp *, 
>  
>  #ifdef __UCONTEXT_SIZE
>  __CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE);
> -#else
> -#define  __UCONTEXT_SIZE sizeof(ucontext_t)
>  #endif
>  #endif /* _KERNEL */
>  
>

-- 
Ryo ONODERA // r...@tetera.org
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


CVS commit: src/sys/sys

2024-05-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 25 13:44:48 UTC 2024

Modified Files:
src/sys/sys: ucontext.h

Log Message:
ucontext.h: Expose __UCONTEXT_SIZE to userland.

But don't expose __CTASSERT(__UCONTEXT_SIZE == sizeof(ucontext_t)) to
userland.

- __UCONTEXT_SIZE will be needed soon by libc and signal trampolines
  in order to version ucontext so we can safely expand it with
  architecture extensions.

- __CTASSERT is not safe to use in header files in arbitrary
  compilation environments (although in the NetBSD kernel build it is
  safe).  Exposing the __CTASSERT in a header file used by userland
  appears to have the side effect of breaking the Firefox build in
  rustc, though the mechanism isn't entirely clear.

Firefox/rustc discussion here:
https://mail-index.netbsd.org/pkgsrc-users/2024/05/18/msg039578.html

Let's see if this makes a difference -- if it works, great; if not,
maybe it will help us to narrow down what's happening with rustc and
Firefox.


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

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

Modified files:

Index: src/sys/sys/ucontext.h
diff -u src/sys/sys/ucontext.h:1.23 src/sys/sys/ucontext.h:1.24
--- src/sys/sys/ucontext.h:1.23	Fri May 24 13:50:30 2024
+++ src/sys/sys/ucontext.h	Sat May 25 13:44:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucontext.h,v 1.23 2024/05/24 13:50:30 ryoon Exp $	*/
+/*	$NetBSD: ucontext.h,v 1.24 2024/05/25 13:44:48 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2003, 2024 The NetBSD Foundation, Inc.
@@ -82,6 +82,10 @@ struct __ucontext {
 #define _UC_UCONTEXT_ALIGN (~0)
 #endif
 
+#ifndef __UCONTEXT_SIZE
+#define	__UCONTEXT_SIZE		sizeof(ucontext_t)
+#endif
+
 #ifndef _UC_TLSBASE
 #error	_UC_TLSBASE not defined.
 #endif
@@ -105,8 +109,6 @@ int	cpu_mcontext_validate(struct lwp *, 
 
 #ifdef __UCONTEXT_SIZE
 __CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE);
-#else
-#define	__UCONTEXT_SIZE		sizeof(ucontext_t)
 #endif
 #endif /* _KERNEL */
 



CVS commit: src/sys/sys

2024-05-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 25 13:44:48 UTC 2024

Modified Files:
src/sys/sys: ucontext.h

Log Message:
ucontext.h: Expose __UCONTEXT_SIZE to userland.

But don't expose __CTASSERT(__UCONTEXT_SIZE == sizeof(ucontext_t)) to
userland.

- __UCONTEXT_SIZE will be needed soon by libc and signal trampolines
  in order to version ucontext so we can safely expand it with
  architecture extensions.

- __CTASSERT is not safe to use in header files in arbitrary
  compilation environments (although in the NetBSD kernel build it is
  safe).  Exposing the __CTASSERT in a header file used by userland
  appears to have the side effect of breaking the Firefox build in
  rustc, though the mechanism isn't entirely clear.

Firefox/rustc discussion here:
https://mail-index.netbsd.org/pkgsrc-users/2024/05/18/msg039578.html

Let's see if this makes a difference -- if it works, great; if not,
maybe it will help us to narrow down what's happening with rustc and
Firefox.


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

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



CVS commit: src/sys/sys

2024-05-24 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri May 24 13:50:30 UTC 2024

Modified Files:
src/sys/sys: ucontext.h

Log Message:
Move __UCONTEXT_SIZE inside _KERNEL like before

Fix pkgsrc/lang/rust runtime SIGILL error during pkgsrc/www/firefox build.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/sys/ucontext.h

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



CVS commit: src/sys/sys

2024-05-24 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri May 24 13:50:30 UTC 2024

Modified Files:
src/sys/sys: ucontext.h

Log Message:
Move __UCONTEXT_SIZE inside _KERNEL like before

Fix pkgsrc/lang/rust runtime SIGILL error during pkgsrc/www/firefox build.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/sys/ucontext.h

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

Modified files:

Index: src/sys/sys/ucontext.h
diff -u src/sys/sys/ucontext.h:1.22 src/sys/sys/ucontext.h:1.23
--- src/sys/sys/ucontext.h:1.22	Sat May 18 01:21:42 2024
+++ src/sys/sys/ucontext.h	Fri May 24 13:50:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucontext.h,v 1.22 2024/05/18 01:21:42 thorpej Exp $	*/
+/*	$NetBSD: ucontext.h,v 1.23 2024/05/24 13:50:30 ryoon Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2003, 2024 The NetBSD Foundation, Inc.
@@ -82,12 +82,6 @@ struct __ucontext {
 #define _UC_UCONTEXT_ALIGN (~0)
 #endif
 
-#ifdef __UCONTEXT_SIZE
-__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE);
-#else
-#define	__UCONTEXT_SIZE		sizeof(ucontext_t)
-#endif
-
 #ifndef _UC_TLSBASE
 #error	_UC_TLSBASE not defined.
 #endif
@@ -108,6 +102,12 @@ int	setucontext(struct lwp *, const ucon
 void	cpu_getmcontext(struct lwp *, mcontext_t *, unsigned int *);
 int	cpu_setmcontext(struct lwp *, const mcontext_t *, unsigned int);
 int	cpu_mcontext_validate(struct lwp *, const mcontext_t *);
+
+#ifdef __UCONTEXT_SIZE
+__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE);
+#else
+#define	__UCONTEXT_SIZE		sizeof(ucontext_t)
+#endif
 #endif /* _KERNEL */
 
 #endif /* !_SYS_UCONTEXT_H_ */



CVS commit: src/sys/sys

2024-05-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat May 18 01:21:42 UTC 2024

Modified Files:
src/sys/sys: ucontext.h

Log Message:
If  does not define __UCONTEXT_SIZE, define it as
sizeof(ucontext_t).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/sys/ucontext.h

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

Modified files:

Index: src/sys/sys/ucontext.h
diff -u src/sys/sys/ucontext.h:1.21 src/sys/sys/ucontext.h:1.22
--- src/sys/sys/ucontext.h:1.21	Sat May 18 01:16:21 2024
+++ src/sys/sys/ucontext.h	Sat May 18 01:21:42 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucontext.h,v 1.21 2024/05/18 01:16:21 thorpej Exp $	*/
+/*	$NetBSD: ucontext.h,v 1.22 2024/05/18 01:21:42 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2003, 2024 The NetBSD Foundation, Inc.
@@ -82,6 +82,12 @@ struct __ucontext {
 #define _UC_UCONTEXT_ALIGN (~0)
 #endif
 
+#ifdef __UCONTEXT_SIZE
+__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE);
+#else
+#define	__UCONTEXT_SIZE		sizeof(ucontext_t)
+#endif
+
 #ifndef _UC_TLSBASE
 #error	_UC_TLSBASE not defined.
 #endif
@@ -102,10 +108,6 @@ int	setucontext(struct lwp *, const ucon
 void	cpu_getmcontext(struct lwp *, mcontext_t *, unsigned int *);
 int	cpu_setmcontext(struct lwp *, const mcontext_t *, unsigned int);
 int	cpu_mcontext_validate(struct lwp *, const mcontext_t *);
-
-#ifdef __UCONTEXT_SIZE
-__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE);
-#endif
 #endif /* _KERNEL */
 
 #endif /* !_SYS_UCONTEXT_H_ */



CVS commit: src/sys/sys

2024-05-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat May 18 01:21:42 UTC 2024

Modified Files:
src/sys/sys: ucontext.h

Log Message:
If  does not define __UCONTEXT_SIZE, define it as
sizeof(ucontext_t).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/sys/ucontext.h

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



CVS commit: src/sys/sys

2024-05-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat May 18 01:16:21 UTC 2024

Modified Files:
src/sys/sys: ucontext.h

Log Message:
Define the _UC_* flag bits before including .


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/ucontext.h

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

Modified files:

Index: src/sys/sys/ucontext.h
diff -u src/sys/sys/ucontext.h:1.20 src/sys/sys/ucontext.h:1.21
--- src/sys/sys/ucontext.h:1.20	Sat May 18 00:37:41 2024
+++ src/sys/sys/ucontext.h	Sat May 18 01:16:21 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucontext.h,v 1.20 2024/05/18 00:37:41 thorpej Exp $	*/
+/*	$NetBSD: ucontext.h,v 1.21 2024/05/18 01:16:21 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2003, 2024 The NetBSD Foundation, Inc.
@@ -33,24 +33,6 @@
 #define _SYS_UCONTEXT_H_
 
 #include 
-#include 
-
-typedef struct __ucontext	ucontext_t;
-
-struct __ucontext {
-	unsigned int	uc_flags;	/* properties */
-	ucontext_t * 	uc_link;	/* context to resume */
-	sigset_t	uc_sigmask;	/* signals blocked in this context */
-	stack_t		uc_stack;	/* the stack used by this context */
-	mcontext_t	uc_mcontext;	/* machine state */
-#if defined(_UC_MACHINE_PAD)
-	long		__uc_pad[_UC_MACHINE_PAD];
-#endif
-};
-
-#ifndef _UC_UCONTEXT_ALIGN
-#define _UC_UCONTEXT_ALIGN (~0)
-#endif
 
 /* uc_flags */
 #define _UC_SIGMASK	0x01		/* valid uc_sigmask */
@@ -81,6 +63,25 @@ struct __ucontext {
  *	_UC_CLRSTACK	Context does not use signal stack
  */
 
+#include 
+
+typedef struct __ucontext	ucontext_t;
+
+struct __ucontext {
+	unsigned int	uc_flags;	/* properties */
+	ucontext_t * 	uc_link;	/* context to resume */
+	sigset_t	uc_sigmask;	/* signals blocked in this context */
+	stack_t		uc_stack;	/* the stack used by this context */
+	mcontext_t	uc_mcontext;	/* machine state */
+#if defined(_UC_MACHINE_PAD)
+	long		__uc_pad[_UC_MACHINE_PAD];
+#endif
+};
+
+#ifndef _UC_UCONTEXT_ALIGN
+#define _UC_UCONTEXT_ALIGN (~0)
+#endif
+
 #ifndef _UC_TLSBASE
 #error	_UC_TLSBASE not defined.
 #endif



CVS commit: src/sys/sys

2024-05-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat May 18 01:16:21 UTC 2024

Modified Files:
src/sys/sys: ucontext.h

Log Message:
Define the _UC_* flag bits before including .


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/ucontext.h

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



CVS commit: src/sys/sys

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 10:45:13 UTC 2024

Modified Files:
src/sys/sys: lock.h

Log Message:
sys/lock.h: remove stray semicolon from SPINLOCK_BACKOFF macro


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/sys/lock.h

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



CVS commit: src/sys/sys

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 10:45:13 UTC 2024

Modified Files:
src/sys/sys: lock.h

Log Message:
sys/lock.h: remove stray semicolon from SPINLOCK_BACKOFF macro


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/sys/lock.h

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

Modified files:

Index: src/sys/sys/lock.h
diff -u src/sys/sys/lock.h:1.93 src/sys/sys/lock.h:1.94
--- src/sys/sys/lock.h:1.93	Sun May 12 10:34:56 2024
+++ src/sys/sys/lock.h	Sun May 12 10:45:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.93 2024/05/12 10:34:56 rillig Exp $	*/
+/*	$NetBSD: lock.h,v 1.94 2024/05/12 10:45:13 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2006, 2007 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@ do {\
 	}			\
 	if ((count) < SPINLOCK_BACKOFF_MAX)			\
 		(count) += (count);\
-} while (0);
+} while (0)
 
 #ifdef LOCKDEBUG
 #define	SPINLOCK_SPINOUT(spins)		((spins)++ > 0x0fff)



CVS commit: src/sys/sys

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 10:38:03 UTC 2024

Modified Files:
src/sys/sys: module_hook.h

Log Message:
sys/module_hook.h: remove CONSTCOND comment from do-while-0 loop

Lint doesn't need this comment anymore, as there is nothing surprising
or unusual about this idiom.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/sys/module_hook.h

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

Modified files:

Index: src/sys/sys/module_hook.h
diff -u src/sys/sys/module_hook.h:1.6 src/sys/sys/module_hook.h:1.7
--- src/sys/sys/module_hook.h:1.6	Thu Dec 12 22:55:20 2019
+++ src/sys/sys/module_hook.h	Sun May 12 10:38:03 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: module_hook.h,v 1.6 2019/12/12 22:55:20 pgoyette Exp $	*/
+/* $NetBSD: module_hook.h,v 1.7 2024/05/12 10:38:03 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -70,14 +70,14 @@ extern struct hook ## _t {	\
 do {\
 	(hook).f = func;	\
 	module_hook_set(&(hook).hooked, &(hook).lc);		\
-} while /* CONSTCOND */ (0)
+} while (0)
 
 #define MODULE_HOOK_UNSET(hook)	\
 do {\
 	KASSERT((hook).f);	\
 	module_hook_unset(&(hook).hooked, &(hook).lc);		\
 	(hook).f = NULL;	/* paranoia */			\
-} while /* CONSTCOND */ (0)
+} while (0)
 
 #define MODULE_HOOK_CALL(hook, args, default, retval)		\
 do {\
@@ -87,7 +87,7 @@ do {\
 	} else {		\
 		(retval) = (default);\
 	}			\
-} while /* CONSTCOND */ (0)
+} while (0)
 
 #define MODULE_HOOK_CALL_VOID(hook, args, default)		\
 do {\
@@ -97,6 +97,6 @@ do {\
 	} else {		\
 		default;	\
 	}			\
-} while /* CONSTCOND */ (0)
+} while (0)
 
 #endif	/* _SYS_MODULE_HOOK_H */



CVS commit: src/sys/sys

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 10:38:03 UTC 2024

Modified Files:
src/sys/sys: module_hook.h

Log Message:
sys/module_hook.h: remove CONSTCOND comment from do-while-0 loop

Lint doesn't need this comment anymore, as there is nothing surprising
or unusual about this idiom.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/sys/module_hook.h

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



CVS commit: src/sys/sys

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 10:34:56 UTC 2024

Modified Files:
src/sys/sys: bitops.h boot_flag.h bootblock.h buf.h cctr.h cdefs.h
cpu_data.h fd_set.h ieee754.h ipc.h kernhist.h lock.h mbuf.h msg.h
queue.h rbtree.h resourcevar.h sem.h shm.h siginfo.h sigtypes.h
socketvar.h systm.h time.h tree.h

Log Message:
sys/sys: remove CONSTCOND comment from do-while-0 loop

Lint doesn't need this comment anymore, as there is nothing surprising
or unusual about this idiom.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/sys/bitops.h
cvs rdiff -u -r1.7 -r1.8 src/sys/sys/boot_flag.h src/sys/sys/fd_set.h
cvs rdiff -u -r1.59 -r1.60 src/sys/sys/bootblock.h
cvs rdiff -u -r1.134 -r1.135 src/sys/sys/buf.h
cvs rdiff -u -r1.4 -r1.5 src/sys/sys/cctr.h
cvs rdiff -u -r1.162 -r1.163 src/sys/sys/cdefs.h
cvs rdiff -u -r1.55 -r1.56 src/sys/sys/cpu_data.h src/sys/sys/shm.h
cvs rdiff -u -r1.17 -r1.18 src/sys/sys/ieee754.h
cvs rdiff -u -r1.37 -r1.38 src/sys/sys/ipc.h
cvs rdiff -u -r1.26 -r1.27 src/sys/sys/kernhist.h
cvs rdiff -u -r1.92 -r1.93 src/sys/sys/lock.h
cvs rdiff -u -r1.239 -r1.240 src/sys/sys/mbuf.h
cvs rdiff -u -r1.29 -r1.30 src/sys/sys/msg.h
cvs rdiff -u -r1.76 -r1.77 src/sys/sys/queue.h
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/rbtree.h
cvs rdiff -u -r1.58 -r1.59 src/sys/sys/resourcevar.h
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/sem.h src/sys/sys/siginfo.h
cvs rdiff -u -r1.12 -r1.13 src/sys/sys/sigtypes.h
cvs rdiff -u -r1.168 -r1.169 src/sys/sys/socketvar.h
cvs rdiff -u -r1.305 -r1.306 src/sys/sys/systm.h
cvs rdiff -u -r1.80 -r1.81 src/sys/sys/time.h
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/tree.h

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



CVS commit: src/sys/sys

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 10:34:56 UTC 2024

Modified Files:
src/sys/sys: bitops.h boot_flag.h bootblock.h buf.h cctr.h cdefs.h
cpu_data.h fd_set.h ieee754.h ipc.h kernhist.h lock.h mbuf.h msg.h
queue.h rbtree.h resourcevar.h sem.h shm.h siginfo.h sigtypes.h
socketvar.h systm.h time.h tree.h

Log Message:
sys/sys: remove CONSTCOND comment from do-while-0 loop

Lint doesn't need this comment anymore, as there is nothing surprising
or unusual about this idiom.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/sys/bitops.h
cvs rdiff -u -r1.7 -r1.8 src/sys/sys/boot_flag.h src/sys/sys/fd_set.h
cvs rdiff -u -r1.59 -r1.60 src/sys/sys/bootblock.h
cvs rdiff -u -r1.134 -r1.135 src/sys/sys/buf.h
cvs rdiff -u -r1.4 -r1.5 src/sys/sys/cctr.h
cvs rdiff -u -r1.162 -r1.163 src/sys/sys/cdefs.h
cvs rdiff -u -r1.55 -r1.56 src/sys/sys/cpu_data.h src/sys/sys/shm.h
cvs rdiff -u -r1.17 -r1.18 src/sys/sys/ieee754.h
cvs rdiff -u -r1.37 -r1.38 src/sys/sys/ipc.h
cvs rdiff -u -r1.26 -r1.27 src/sys/sys/kernhist.h
cvs rdiff -u -r1.92 -r1.93 src/sys/sys/lock.h
cvs rdiff -u -r1.239 -r1.240 src/sys/sys/mbuf.h
cvs rdiff -u -r1.29 -r1.30 src/sys/sys/msg.h
cvs rdiff -u -r1.76 -r1.77 src/sys/sys/queue.h
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/rbtree.h
cvs rdiff -u -r1.58 -r1.59 src/sys/sys/resourcevar.h
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/sem.h src/sys/sys/siginfo.h
cvs rdiff -u -r1.12 -r1.13 src/sys/sys/sigtypes.h
cvs rdiff -u -r1.168 -r1.169 src/sys/sys/socketvar.h
cvs rdiff -u -r1.305 -r1.306 src/sys/sys/systm.h
cvs rdiff -u -r1.80 -r1.81 src/sys/sys/time.h
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/tree.h

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

Modified files:

Index: src/sys/sys/bitops.h
diff -u src/sys/sys/bitops.h:1.15 src/sys/sys/bitops.h:1.16
--- src/sys/sys/bitops.h:1.15	Sun Sep 12 15:22:05 2021
+++ src/sys/sys/bitops.h	Sun May 12 10:34:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bitops.h,v 1.15 2021/09/12 15:22:05 rillig Exp $	*/
+/*	$NetBSD: bitops.h,v 1.16 2024/05/12 10:34:56 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
@@ -323,7 +323,7 @@ fast_remainder32(uint32_t _v, uint32_t _
 	size_t __i;			\
 	for (__i = 0; __i < __arraycount((__v)->_b); __i++)		\
 		(__v)->_b[__i] = 0;	\
-	} while (/* CONSTCOND */ 0)
+	} while (0)
 #endif /* GCC 2.95 */
 
 #endif /* _SYS_BITOPS_H_ */

Index: src/sys/sys/boot_flag.h
diff -u src/sys/sys/boot_flag.h:1.7 src/sys/sys/boot_flag.h:1.8
--- src/sys/sys/boot_flag.h:1.7	Tue Apr 29 19:16:08 2008
+++ src/sys/sys/boot_flag.h	Sun May 12 10:34:56 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: boot_flag.h,v 1.7 2008/04/29 19:16:08 ad Exp $ */
+/* $NetBSD: boot_flag.h,v 1.8 2024/05/12 10:34:56 rillig Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -86,6 +86,6 @@
 		break;		\
 	} /* switch */		\
 \
-	} while (/* CONSTCOND */ 0)
+	} while (0)
 
 #endif /* _SYS_BOOT_FLAG_H_ */
Index: src/sys/sys/fd_set.h
diff -u src/sys/sys/fd_set.h:1.7 src/sys/sys/fd_set.h:1.8
--- src/sys/sys/fd_set.h:1.7	Sun Jun 24 12:05:40 2018
+++ src/sys/sys/fd_set.h	Sun May 12 10:34:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd_set.h,v 1.7 2018/06/24 12:05:40 kamil Exp $	*/
+/*	$NetBSD: fd_set.h,v 1.8 2024/05/12 10:34:56 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -81,7 +81,7 @@ typedef	struct fd_set {
 	unsigned int __i;		\
 	for (__i = 0; __i < __NFD_SIZE; __i++)\
 		__fds->fds_bits[__i] = 0;\
-	} while (/* CONSTCOND */ 0)
+	} while (0)
 #endif /* GCC 2.95 */
 
 /*
@@ -100,7 +100,7 @@ typedef	struct fd_set {
 	unsigned int __i;		\
 	for (__i = 0; __i < __NFD_SIZE; __i++)\
 		__t->fds_bits[__i] = __f->fds_bits[__i];		\
-	} while (/* CONSTCOND */ 0)
+	} while (0)
 #endif /* GCC 2.95 */
 
 #endif /* _NETBSD_SOURCE */

Index: src/sys/sys/bootblock.h
diff -u src/sys/sys/bootblock.h:1.59 src/sys/sys/bootblock.h:1.60
--- src/sys/sys/bootblock.h:1.59	Sat May 11 22:10:27 2024
+++ src/sys/sys/bootblock.h	Sun May 12 10:34:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootblock.h,v 1.59 2024/05/11 22:10:27 tsutsui Exp $	*/
+/*	$NetBSD: bootblock.h,v 1.60 2024/05/12 10:34:56 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
@@ -800,7 +800,7 @@ struct alpha_boot_block {
 		_i++)		\
 			_cksum += le64toh(_bb->bb_data[_i]);		\
 		*(cksum) = htole64(_cksum);\
-	} while (/*CONSTCOND*/ 0)
+	} while (0)
 
 /* --
  * apple --

Index: src/sys/sys/buf.h
diff -u src/sys/sys/buf.h:1.134 src/sys/sys/buf.h:1.135
--- src/sys/sys/buf.h:1.134	Fri Jul 31 04:07:30 2020
+++ src/sys/sys/buf.h	Sun May 12 10:34:56 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.h,v 1.134 2020/07/31 04:07:30 chs Exp $ */
+/* $NetBSD: buf.h,v 1.135 2024/05/12 10:34:56 rillig Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2007, 2008 The NetBSD Foundation, Inc.
@

CVS commit: src/sys/sys

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 09:34:25 UTC 2024

Modified Files:
src/sys/sys: ktrace.h

Log Message:
sys/ktrace.h: fix off-by-one in snprintb for ktrace flags

There's a one-bit gap between TRC_EMUL and INHERIT.

Noticed by RVP.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/sys/ktrace.h

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

Modified files:

Index: src/sys/sys/ktrace.h
diff -u src/sys/sys/ktrace.h:1.69 src/sys/sys/ktrace.h:1.70
--- src/sys/sys/ktrace.h:1.69	Fri May 10 09:30:47 2024
+++ src/sys/sys/ktrace.h	Sun May 12 09:34:25 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ktrace.h,v 1.69 2024/05/10 09:30:47 rillig Exp $	*/
+/*	$NetBSD: ktrace.h,v 1.70 2024/05/12 09:34:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -265,7 +265,7 @@ struct ktr_execfd {
 "b\16MIB\0" \
 "b\17EXEC_FD\0" \
 "f\30\4VERSION\0" \
-"b\35TRC_EMUL\0" \
+"b\34TRC_EMUL\0" \
 "b\36INHERIT\0" \
 "b\37PERSISTENT\0"
 



CVS commit: src/sys/sys

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 09:34:25 UTC 2024

Modified Files:
src/sys/sys: ktrace.h

Log Message:
sys/ktrace.h: fix off-by-one in snprintb for ktrace flags

There's a one-bit gap between TRC_EMUL and INHERIT.

Noticed by RVP.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/sys/ktrace.h

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



CVS commit: src/sys/sys

2024-05-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 11 13:26:54 UTC 2024

Modified Files:
src/sys/sys: cdefs.h

Log Message:
sys/cdefs.h: Make various macros work more robustly.

Use predefined __-namespace macros inside __BIT, __type_min,
__type_max, and __type_fit:

- Use __CHAR_BIT__ instead of NBBY so this works without sys/types.h
  and without _NETBSD_SOURCE.

- Use __INTMAX_TYPE__, __UINTMAX_TYPE__ instead of intmax_t, uintmax_t
  so this works without stdint.h.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/sys/cdefs.h

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

Modified files:

Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.161 src/sys/sys/cdefs.h:1.162
--- src/sys/sys/cdefs.h:1.161	Wed May  1 07:43:41 2024
+++ src/sys/sys/cdefs.h	Sat May 11 13:26:54 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.161 2024/05/01 07:43:41 rillig Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.162 2024/05/11 13:26:54 riastradh Exp $	*/
 
 /* * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -645,9 +645,12 @@
 
 #ifndef __ASSEMBLER__
 /* __BIT(n): nth bit, where __BIT(0) == 0x1. */
-#define	__BIT(__n)	\
-(((uintmax_t)(__n) >= NBBY * sizeof(uintmax_t)) ? 0 : \
-((uintmax_t)1 << (uintmax_t)((__n) & (NBBY * sizeof(uintmax_t) - 1
+#define	__BIT(__n)			  \
+	(((__UINTMAX_TYPE__)(__n) >= __CHAR_BIT__ * sizeof(__UINTMAX_TYPE__)) \
+	? 0  \
+	: ((__UINTMAX_TYPE__)1 <<	  \
+		(__UINTMAX_TYPE__)((__n) &  \
+		(__CHAR_BIT__ * sizeof(__UINTMAX_TYPE__) - 1
 
 /* __MASK(n): first n bits all set, where __MASK(4) == 0b. */
 #define	__MASK(__n)	(__BIT(__n) - 1)
@@ -720,8 +723,8 @@
  */
 #define	__MACROUSE(e)	(/*LINTED*/(void)sizeof((long)(e)))
 
-#define __type_mask(t) (/*LINTED*/sizeof(t) < sizeof(intmax_t) ? \
-(~((1ULL << (sizeof(t) * NBBY)) - 1)) : 0ULL)
+#define __type_mask(t) (/*LINTED*/sizeof(t) < sizeof(__INTMAX_TYPE__) ? \
+(~((1ULL << (sizeof(t) * __CHAR_BIT__)) - 1)) : 0ULL)
 
 #ifndef __ASSEMBLER__
 static __inline long long __zeroll(void) { return 0; }
@@ -733,8 +736,8 @@ static __inline unsigned long long __zer
 
 #define __negative_p(x) (!((x) > 0) && ((x) != 0))
 
-#define __type_min_s(t) ((t)((1ULL << (sizeof(t) * NBBY - 1
-#define __type_max_s(t) ((t)~((1ULL << (sizeof(t) * NBBY - 1
+#define __type_min_s(t) ((t)((1ULL << (sizeof(t) * __CHAR_BIT__ - 1
+#define __type_max_s(t) ((t)~((1ULL << (sizeof(t) * __CHAR_BIT__ - 1
 #define __type_min_u(t) ((t)0ULL)
 #define __type_max_u(t) ((t)~0ULL)
 #define __type_is_signed(t) (/*LINTED*/__type_min_s(t) + (t)1 < (t)1)
@@ -742,13 +745,18 @@ static __inline unsigned long long __zer
 #define __type_max(t) (__type_is_signed(t) ? __type_max_s(t) : __type_max_u(t))
 
 
-#define __type_fit_u(t, a) (/*LINTED*/!__negative_p(a) && \
-(uintmax_t)((a) + __zeroull()) <= (uintmax_t)__type_max_u(t))
-
-#define __type_fit_s(t, a) (/*LINTED*/__negative_p(a) ? \
-((intmax_t)((a) + __zeroll()) >= (intmax_t)__type_min_s(t)) : \
-((intmax_t)((a) + __zeroll()) >= (intmax_t)0 && \
- (intmax_t)((a) + __zeroll()) <= (intmax_t)__type_max_s(t)))
+#define __type_fit_u(t, a)		  \
+	(/*LINTED*/!__negative_p(a) &&	  \
+	((__UINTMAX_TYPE__)((a) + __zeroull()) <=			  \
+		(__UINTMAX_TYPE__)__type_max_u(t)))
+
+#define __type_fit_s(t, a)		  \
+	(/*LINTED*/__negative_p(a)	  \
+	? ((__INTMAX_TYPE__)((a) + __zeroll()) >=			  \
+		(__INTMAX_TYPE__)__type_min_s(t))			  \
+	: ((__INTMAX_TYPE__)((a) + __zeroll()) >= (__INTMAX_TYPE__)0 &&   \
+		((__INTMAX_TYPE__)((a) + __zeroll()) <=			  \
+		(__INTMAX_TYPE__)__type_max_s(t
 
 /*
  * return true if value 'a' fits in type 't'



CVS commit: src/sys/sys

2024-05-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 11 13:26:54 UTC 2024

Modified Files:
src/sys/sys: cdefs.h

Log Message:
sys/cdefs.h: Make various macros work more robustly.

Use predefined __-namespace macros inside __BIT, __type_min,
__type_max, and __type_fit:

- Use __CHAR_BIT__ instead of NBBY so this works without sys/types.h
  and without _NETBSD_SOURCE.

- Use __INTMAX_TYPE__, __UINTMAX_TYPE__ instead of intmax_t, uintmax_t
  so this works without stdint.h.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/sys/cdefs.h

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



CVS commit: src/sys/sys

2024-05-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 10 09:30:47 UTC 2024

Modified Files:
src/sys/sys: ktrace.h

Log Message:
sys/ktrace.h: fix off-by-one error in snprintb for ktrace flags


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/sys/ktrace.h

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

Modified files:

Index: src/sys/sys/ktrace.h
diff -u src/sys/sys/ktrace.h:1.68 src/sys/sys/ktrace.h:1.69
--- src/sys/sys/ktrace.h:1.68	Wed Jun 29 22:10:43 2022
+++ src/sys/sys/ktrace.h	Fri May 10 09:30:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ktrace.h,v 1.68 2022/06/29 22:10:43 riastradh Exp $	*/
+/*	$NetBSD: ktrace.h,v 1.69 2024/05/10 09:30:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -265,9 +265,9 @@ struct ktr_execfd {
 "b\16MIB\0" \
 "b\17EXEC_FD\0" \
 "f\30\4VERSION\0" \
-"b\36TRC_EMUL\0" \
-"b\37INHERIT\0" \
-"b\40PERSISTENT\0"
+"b\35TRC_EMUL\0" \
+"b\36INHERIT\0" \
+"b\37PERSISTENT\0"
 
 /*
  * trace flags (also in p_traceflags)



CVS commit: src/sys/sys

2024-05-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri May 10 09:30:47 UTC 2024

Modified Files:
src/sys/sys: ktrace.h

Log Message:
sys/ktrace.h: fix off-by-one error in snprintb for ktrace flags


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/sys/ktrace.h

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



CVS commit: src/sys/sys

2024-05-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed May  1 07:43:42 UTC 2024

Modified Files:
src/sys/sys: cdefs.h

Log Message:
sys/cdefs.h: pass __aligned to lint

Lint could parse _Alignas and __attribute__((__aligned__(4))) previously
but simply ignored them. Since today, they affect the layout of struct
and union.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/sys/cdefs.h

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



CVS commit: src/sys/sys

2024-05-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed May  1 07:43:42 UTC 2024

Modified Files:
src/sys/sys: cdefs.h

Log Message:
sys/cdefs.h: pass __aligned to lint

Lint could parse _Alignas and __attribute__((__aligned__(4))) previously
but simply ignored them. Since today, they affect the layout of struct
and union.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/sys/cdefs.h

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

Modified files:

Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.160 src/sys/sys/cdefs.h:1.161
--- src/sys/sys/cdefs.h:1.160	Sun Apr 30 08:45:48 2023
+++ src/sys/sys/cdefs.h	Wed May  1 07:43:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.160 2023/04/30 08:45:48 riastradh Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.161 2024/05/01 07:43:41 rillig Exp $	*/
 
 /* * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -451,7 +451,7 @@
 #if defined(__lint__)
 #define __thread	/* delete */
 #define	__packed	__packed
-#define	__aligned(x)	/* delete */
+#define	__aligned(x)	_Alignas((x))
 #define	__section(x)	/* delete */
 #elif __GNUC_PREREQ__(2, 7) || defined(__PCC__) || defined(__lint__)
 #define	__packed	__attribute__((__packed__))



CVS commit: src/sys/sys

2024-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr 17 18:01:29 UTC 2024

Modified Files:
src/sys/sys: conf.h

Log Message:
sys/conf.h: Need sys/types.h for dev_t, devmajor_t.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/sys/conf.h

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

Modified files:

Index: src/sys/sys/conf.h
diff -u src/sys/sys/conf.h:1.161 src/sys/sys/conf.h:1.162
--- src/sys/sys/conf.h:1.161	Mon Mar 28 12:39:18 2022
+++ src/sys/sys/conf.h	Wed Apr 17 18:01:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: conf.h,v 1.161 2022/03/28 12:39:18 riastradh Exp $	*/
+/*	$NetBSD: conf.h,v 1.162 2024/04/17 18:01:29 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -43,8 +43,9 @@
  * Definitions of device driver entry switches
  */
 
-#include 
 #include 
+#include 
+#include 
 
 struct buf;
 struct knote;
@@ -109,7 +110,7 @@ struct cdevsw {
 extern kmutex_t device_lock;
 
 int devsw_attach(const char *, const struct bdevsw *, devmajor_t *,
-		 const struct cdevsw *, devmajor_t *);
+const struct cdevsw *, devmajor_t *);
 void devsw_detach(const struct bdevsw *, const struct cdevsw *);
 const struct bdevsw *bdevsw_lookup(dev_t);
 const struct cdevsw *cdevsw_lookup(dev_t);



CVS commit: src/sys/sys

2024-04-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr 17 18:01:29 UTC 2024

Modified Files:
src/sys/sys: conf.h

Log Message:
sys/conf.h: Need sys/types.h for dev_t, devmajor_t.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/sys/conf.h

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



CVS commit: src/sys/sys

2024-04-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Apr 10 20:00:12 UTC 2024

Modified Files:
src/sys/sys: disklabel.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/sys/disklabel.h

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

Modified files:

Index: src/sys/sys/disklabel.h
diff -u src/sys/sys/disklabel.h:1.127 src/sys/sys/disklabel.h:1.128
--- src/sys/sys/disklabel.h:1.127	Tue Nov  1 06:47:41 2022
+++ src/sys/sys/disklabel.h	Wed Apr 10 20:00:12 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.h,v 1.127 2022/11/01 06:47:41 simonb Exp $	*/
+/*	$NetBSD: disklabel.h,v 1.128 2024/04/10 20:00:12 andvar Exp $	*/
 
 /*
  * Copyright (c) 1987, 1988, 1993
@@ -127,7 +127,7 @@ struct	partition {		/* the partition tab
  * padding at the end, but that would have been confusing (although that
  * is what actually happens), because the partitions structure is supposed
  * to be variable size and putting a padding uint32_t would be weird.
- * Unfornately mips32 and i386 align uint64_t standalone at an 8 byte
+ * Unfortunately mips32 and i386 align uint64_t standalone at an 8 byte
  * boundary, but in structures at a 4 byte boundary so matt's
  * change did not affect them.
  *



CVS commit: src/sys/sys

2024-04-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Apr 10 20:00:12 UTC 2024

Modified Files:
src/sys/sys: disklabel.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/sys/disklabel.h

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



CVS commit: src/sys/sys

2024-01-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 28 10:06:19 UTC 2024

Modified Files:
src/sys/sys: userret.h

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/userret.h

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

Modified files:

Index: src/sys/sys/userret.h
diff -u src/sys/sys/userret.h:1.34 src/sys/sys/userret.h:1.35
--- src/sys/sys/userret.h:1.34	Sat Sep 23 18:48:05 2023
+++ src/sys/sys/userret.h	Sun Jan 28 10:06:19 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.34 2023/09/23 18:48:05 ad Exp $	*/
+/*	$NetBSD: userret.h,v 1.35 2024/01/28 10:06:19 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2003, 2006, 2008, 2019, 2020, 2023
@@ -41,7 +41,7 @@
  * Define the MI code needed before returning to user mode, for trap and
  * syscall.
  *
- * We handle "exceptional" events: pending signals, stop/exit actions, etc. 
+ * We handle "exceptional" events: pending signals, stop/exit actions, etc.
  * Note that the event must be flagged BEFORE any AST is posted as we are
  * reading unlocked.
  */



CVS commit: src/sys/sys

2024-01-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 28 10:06:19 UTC 2024

Modified Files:
src/sys/sys: userret.h

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/userret.h

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



CVS commit: src/sys/sys

2024-01-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Jan 22 21:15:02 UTC 2024

Modified Files:
src/sys/sys: mbuf.h

Log Message:
fix M_CSUM_BITS bitfield for M_CSUM_BLANK - \37 is the bit before \40

noticed by rillig@ thanks


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/sys/sys/mbuf.h

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



CVS commit: src/sys/sys

2024-01-22 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Jan 22 21:15:02 UTC 2024

Modified Files:
src/sys/sys: mbuf.h

Log Message:
fix M_CSUM_BITS bitfield for M_CSUM_BLANK - \37 is the bit before \40

noticed by rillig@ thanks


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/sys/sys/mbuf.h

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

Modified files:

Index: src/sys/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.238 src/sys/sys/mbuf.h:1.239
--- src/sys/sys/mbuf.h:1.238	Wed Apr 12 06:48:08 2023
+++ src/sys/sys/mbuf.h	Mon Jan 22 21:15:02 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.238 2023/04/12 06:48:08 riastradh Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.239 2024/01/22 21:15:02 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -226,7 +226,7 @@ struct pkthdr {
 
 #define M_CSUM_BITS \
 "\20\1TCPv4\2UDPv4\3TCP_UDP_BAD\4DATA\5TCPv6\6UDPv6\7IPv4\10IPv4_BAD" \
-"\11TSOv4\12TSOv6\39BLANK\40NO_PSEUDOHDR"
+"\11TSOv4\12TSOv6\37BLANK\40NO_PSEUDOHDR"
 
 /*
  * Macros for manipulating csum_data on outgoing packets. These are



CVS commit: src/sys/sys

2024-01-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 22 18:50:46 UTC 2024

Modified Files:
src/sys/sys: socket.h

Log Message:
PR/57871: Haelwenn Monnier: Don't use u_char because it is not defined in with
POSIX_C_SOURCE


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/sys/socket.h

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



CVS commit: src/sys/sys

2024-01-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 22 18:50:46 UTC 2024

Modified Files:
src/sys/sys: socket.h

Log Message:
PR/57871: Haelwenn Monnier: Don't use u_char because it is not defined in with
POSIX_C_SOURCE


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/sys/socket.h

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

Modified files:

Index: src/sys/sys/socket.h
diff -u src/sys/sys/socket.h:1.131 src/sys/sys/socket.h:1.132
--- src/sys/sys/socket.h:1.131	Tue Nov  2 16:35:51 2021
+++ src/sys/sys/socket.h	Mon Jan 22 13:50:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.h,v 1.131 2021/11/02 20:35:51 christos Exp $	*/
+/*	$NetBSD: socket.h,v 1.132 2024/01/22 18:50:46 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -527,7 +527,7 @@ struct cmsghdr {
 	socklen_t	cmsg_len;	/* data byte count, including hdr */
 	int		cmsg_level;	/* originating protocol */
 	int		cmsg_type;	/* protocol-specific type */
-/* followed by	u_char  cmsg_data[]; */
+/* followed by unsigned char cmsg_data[]; */
 };
 
 /*
@@ -552,8 +552,8 @@ struct cmsghdr {
 (__CASTV(char *, (mhdr)->msg_control) + (mhdr)->msg_controllen)
 
 /* given pointer to struct cmsghdr, return pointer to data */
-#define	CMSG_DATA(cmsg) (__CASTV(u_char *, cmsg) + __CMSG_ASIZE)
-#define	CCMSG_DATA(cmsg) (__CASTCV(const u_char *, cmsg) + __CMSG_ASIZE)
+#define	CMSG_DATA(cmsg) (__CASTV(unsigned char *, cmsg) + __CMSG_ASIZE)
+#define	CCMSG_DATA(cmsg) (__CASTCV(const unsigned char *, cmsg) + __CMSG_ASIZE)
 
 /* given pointer to struct cmsghdr, return pointer to next cmsghdr */
 #define	CMSG_NXTHDR(mhdr, cmsg)	\



CVS commit: src/sys/sys

2024-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 20 13:15:46 UTC 2024

Modified Files:
src/sys/sys: sysctl.h

Log Message:
Make __learn_tree always visible. It starts with __ anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/sys/sys/sysctl.h

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



CVS commit: src/sys/sys

2024-01-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 20 13:15:46 UTC 2024

Modified Files:
src/sys/sys: sysctl.h

Log Message:
Make __learn_tree always visible. It starts with __ anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/sys/sys/sysctl.h

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

Modified files:

Index: src/sys/sys/sysctl.h
diff -u src/sys/sys/sysctl.h:1.238 src/sys/sys/sysctl.h:1.239
--- src/sys/sys/sysctl.h:1.238	Fri Jan 19 13:39:59 2024
+++ src/sys/sys/sysctl.h	Sat Jan 20 08:15:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.h,v 1.238 2024/01/19 18:39:59 christos Exp $	*/
+/*	$NetBSD: sysctl.h,v 1.239 2024/01/20 13:15:46 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -1231,9 +1231,7 @@ int	proc_compare(const struct kinfo_proc
 const struct kinfo_proc2 *, const struct kinfo_lwp *);
 void	*asysctl(const int *, size_t, size_t *);
 void	*asysctlbyname(const char *, size_t *);
-#ifdef _LIBC_INTERNAL
 int	__learn_tree(int *, u_int, struct sysctlnode *);
-#endif
 __END_DECLS
 
 #endif	/* !_KERNEL */



CVS commit: src/sys/sys

2024-01-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 19 18:39:59 UTC 2024

Modified Files:
src/sys/sys: ptree.h sha2.h sysctl.h

Log Message:
Add missing decls.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/sys/ptree.h
cvs rdiff -u -r1.3 -r1.4 src/sys/sys/sha2.h
cvs rdiff -u -r1.237 -r1.238 src/sys/sys/sysctl.h

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

Modified files:

Index: src/sys/sys/ptree.h
diff -u src/sys/sys/ptree.h:1.8 src/sys/sys/ptree.h:1.9
--- src/sys/sys/ptree.h:1.8	Sat Oct  6 18:15:09 2012
+++ src/sys/sys/ptree.h	Fri Jan 19 13:39:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptree.h,v 1.8 2012/10/06 22:15:09 matt Exp $	*/
+/*	$NetBSD: ptree.h,v 1.9 2024/01/19 18:39:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -190,5 +190,6 @@ void *	ptree_find_filtered_node(pt_tree_
 	ptree_find_filtered_node((pt), (key), NULL, NULL)
 void	ptree_remove_node(pt_tree_t *, void *);
 void *	ptree_iterate(pt_tree_t *, const void *, pt_direction_t);
+bool	ptree_check(const pt_tree_t *pt);
 
 #endif /* _SYS_PTREE_H_ */

Index: src/sys/sys/sha2.h
diff -u src/sys/sys/sha2.h:1.3 src/sys/sys/sha2.h:1.4
--- src/sys/sys/sha2.h:1.3	Tue May 26 04:04:12 2009
+++ src/sys/sys/sha2.h	Fri Jan 19 13:39:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sha2.h,v 1.3 2009/05/26 08:04:12 joerg Exp $	*/
+/*	$NetBSD: sha2.h,v 1.4 2024/01/19 18:39:59 christos Exp $	*/
 /*	$KAME: sha2.h,v 1.4 2003/07/20 00:28:38 itojun Exp $	*/
 
 /*
@@ -115,6 +115,13 @@ char *SHA512_FileChunk(const char *, cha
 char *SHA512_File(const char *, char *);
 char *SHA512_Data(const uint8_t *, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
 #endif /* !_KERNEL */
+
+#ifdef _LIBC_INTERNAL
+void SHA224_Transform(SHA224_CTX *, const uint32_t*);
+void SHA256_Transform(SHA256_CTX *, const uint32_t*);
+void SHA384_Transform(SHA384_CTX *, const uint64_t*);
+void SHA512_Transform(SHA512_CTX *, const uint64_t*);
+#endif
 __END_DECLS
 
 #endif /* __SHA2_H__ */

Index: src/sys/sys/sysctl.h
diff -u src/sys/sys/sysctl.h:1.237 src/sys/sys/sysctl.h:1.238
--- src/sys/sys/sysctl.h:1.237	Thu Apr  6 23:01:21 2023
+++ src/sys/sys/sysctl.h	Fri Jan 19 13:39:59 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.h,v 1.237 2023/04/07 03:01:21 simonb Exp $	*/
+/*	$NetBSD: sysctl.h,v 1.238 2024/01/19 18:39:59 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -1231,6 +1231,9 @@ int	proc_compare(const struct kinfo_proc
 const struct kinfo_proc2 *, const struct kinfo_lwp *);
 void	*asysctl(const int *, size_t, size_t *);
 void	*asysctlbyname(const char *, size_t *);
+#ifdef _LIBC_INTERNAL
+int	__learn_tree(int *, u_int, struct sysctlnode *);
+#endif
 __END_DECLS
 
 #endif	/* !_KERNEL */



CVS commit: src/sys/sys

2024-01-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 19 18:39:59 UTC 2024

Modified Files:
src/sys/sys: ptree.h sha2.h sysctl.h

Log Message:
Add missing decls.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/sys/ptree.h
cvs rdiff -u -r1.3 -r1.4 src/sys/sys/sha2.h
cvs rdiff -u -r1.237 -r1.238 src/sys/sys/sysctl.h

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



CVS commit: src/sys/sys

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 18:15:37 UTC 2024

Modified Files:
src/sys/sys: device.h

Log Message:
Revert unintended commit (didn't hit CTRL-C fast enough I guess).


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/sys/sys/device.h

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

Modified files:

Index: src/sys/sys/device.h
diff -u src/sys/sys/device.h:1.187 src/sys/sys/device.h:1.188
--- src/sys/sys/device.h:1.187	Mon Jan 15 18:14:23 2024
+++ src/sys/sys/device.h	Mon Jan 15 18:15:37 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.187 2024/01/15 18:14:23 thorpej Exp $ */
+/* $NetBSD: device.h,v 1.188 2024/01/15 18:15:37 thorpej Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -622,16 +622,11 @@ bool		devhandle_is_valid(devhandle_t);
 devhandle_t	devhandle_invalid(void);
 devhandle_type_t devhandle_type(devhandle_t);
 int		devhandle_compare(devhandle_t, devhandle_t);
-devhandle_t	devhandle_subclass(devhandle_t, struct devhandle_impl *,
-		device_call_t (*)(devhandle_t, const char *,
-  devhandle_t *));
 
 device_call_t	devhandle_lookup_device_call(devhandle_t, const char *,
 		devhandle_t *);
-void		devhandle_impl_subclass(struct devhandle_impl *,
-		const struct devhandle_impl *,
-		device_call_t (*)(devhandle_t, const char *,
-  devhandle_t *));
+void		devhandle_impl_inherit(struct devhandle_impl *,
+		const struct devhandle_impl *);
 
 device_t	deviter_first(deviter_t *, deviter_flags_t);
 void		deviter_init(deviter_t *, deviter_flags_t);
@@ -722,13 +717,10 @@ struct device_call_generic {
 	void *args;
 };
 
-int		device_call_generic(device_t, devhandle_t,
-		const struct device_call_generic *);
+int	device_call_generic(device_t, const struct device_call_generic *);
 
 #define	device_call(dev, call)		\
-	device_call_generic((dev), device_handle(dev), &(call)->generic)
-#define	devhandle_call(handle, call)	\
-	device_call_generic(NULL, (handle), &(call)->generic)
+	device_call_generic((dev), &(call)->generic)
 
 #endif /* _KERNEL */
 



CVS commit: src/sys/sys

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 18:15:37 UTC 2024

Modified Files:
src/sys/sys: device.h

Log Message:
Revert unintended commit (didn't hit CTRL-C fast enough I guess).


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/sys/sys/device.h

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



CVS commit: src/sys/sys

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 18:14:24 UTC 2024

Modified Files:
src/sys/sys: device.h evcnt.h

Log Message:
Provide an ev_count32 field for situations where a 32-bit counter is
sufficient (and, notably, might be desirable to avoid 64-bit math on
an older 32-bit platform).  This is overlaid on the 64-bit counter
field, and simply references the correct half based on byte order.


To generate a diff of this commit:
cvs rdiff -u -r1.186 -r1.187 src/sys/sys/device.h
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/evcnt.h

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

Modified files:

Index: src/sys/sys/device.h
diff -u src/sys/sys/device.h:1.186 src/sys/sys/device.h:1.187
--- src/sys/sys/device.h:1.186	Mon May 22 14:58:22 2023
+++ src/sys/sys/device.h	Mon Jan 15 18:14:23 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.186 2023/05/22 14:58:22 riastradh Exp $ */
+/* $NetBSD: device.h,v 1.187 2024/01/15 18:14:23 thorpej Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -622,11 +622,16 @@ bool		devhandle_is_valid(devhandle_t);
 devhandle_t	devhandle_invalid(void);
 devhandle_type_t devhandle_type(devhandle_t);
 int		devhandle_compare(devhandle_t, devhandle_t);
+devhandle_t	devhandle_subclass(devhandle_t, struct devhandle_impl *,
+		device_call_t (*)(devhandle_t, const char *,
+  devhandle_t *));
 
 device_call_t	devhandle_lookup_device_call(devhandle_t, const char *,
 		devhandle_t *);
-void		devhandle_impl_inherit(struct devhandle_impl *,
-		const struct devhandle_impl *);
+void		devhandle_impl_subclass(struct devhandle_impl *,
+		const struct devhandle_impl *,
+		device_call_t (*)(devhandle_t, const char *,
+  devhandle_t *));
 
 device_t	deviter_first(deviter_t *, deviter_flags_t);
 void		deviter_init(deviter_t *, deviter_flags_t);
@@ -717,10 +722,13 @@ struct device_call_generic {
 	void *args;
 };
 
-int	device_call_generic(device_t, const struct device_call_generic *);
+int		device_call_generic(device_t, devhandle_t,
+		const struct device_call_generic *);
 
 #define	device_call(dev, call)		\
-	device_call_generic((dev), &(call)->generic)
+	device_call_generic((dev), device_handle(dev), &(call)->generic)
+#define	devhandle_call(handle, call)	\
+	device_call_generic(NULL, (handle), &(call)->generic)
 
 #endif /* _KERNEL */
 

Index: src/sys/sys/evcnt.h
diff -u src/sys/sys/evcnt.h:1.10 src/sys/sys/evcnt.h:1.11
--- src/sys/sys/evcnt.h:1.10	Tue Aug  3 23:12:14 2021
+++ src/sys/sys/evcnt.h	Mon Jan 15 18:14:23 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: evcnt.h,v 1.10 2021/08/03 23:12:14 andvar Exp $	*/
+/*	$NetBSD: evcnt.h,v 1.11 2024/01/15 18:14:23 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -83,7 +83,10 @@
  */
 
 struct evcnt {
-	uint64_t	ev_count;	/* how many have occurred */
+	union {
+		uint64_t ev_count;	/* how many have occurred */
+		uint32_t ev__count32[2];
+	};
 	TAILQ_ENTRY(evcnt) ev_list;	/* entry on list of all counters */
 	unsigned char	ev_type;	/* counter type; see below */
 	unsigned char	ev_grouplen;	/* 'group' len, excluding NUL */
@@ -95,6 +98,16 @@ struct evcnt {
 };
 TAILQ_HEAD(evcntlist, evcnt);
 
+/*
+ * For 32-bit counters, ev_count32 is the correct half of the 64-bit
+ * counter field.
+ */
+#if _BYTE_ORDER == _BIG_ENDIAN
+#define	ev_count32	ev__count32[1]
+#elif _BYTE_ORDER == _LITTLE_ENDIAN
+#define	ev_count32	ev__count32[0]
+#endif
+
 /* maximum group/name lengths, including trailing NUL */
 #define	EVCNT_STRING_MAX	255
 



CVS commit: src/sys/sys

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon Jan 15 18:14:24 UTC 2024

Modified Files:
src/sys/sys: device.h evcnt.h

Log Message:
Provide an ev_count32 field for situations where a 32-bit counter is
sufficient (and, notably, might be desirable to avoid 64-bit math on
an older 32-bit platform).  This is overlaid on the 64-bit counter
field, and simply references the correct half based on byte order.


To generate a diff of this commit:
cvs rdiff -u -r1.186 -r1.187 src/sys/sys/device.h
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/evcnt.h

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



Re: CVS commit: src/sys/sys

2024-01-06 Thread Christos Zoulas
In article <2017973.usquhbg...@britannica.bec.de>,
Joerg Sonnenberger   wrote:
>On Tuesday, January 2, 2024 8:27:57 PM CET Christos Zoulas wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Tue Jan  2 19:27:57 UTC 2024
>> 
>> Modified Files:
>>  src/sys/sys: rbtree.h
>> 
>> Log Message:
>> This uses size_t, so it always needs , remove ifdefs.
>
>sys/types.h is one of the most polluting headers we have. This is a huge
>step backwards...

You realize of course that it was working before because it was getting
sys/types.h from sys/endian.h which had an include cycle before which I was
trying to fix. Now sys/endian.h does not include sys/types.h which is a step
forward. Yes, our headers are messy but we are trying to clean them.


Happy New Year,

christos



CVS commit: src/sys/sys

2024-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan  3 18:43:52 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
break the cycle: this does not need  it only needs 


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/sys/endian.h

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

Modified files:

Index: src/sys/sys/endian.h
diff -u src/sys/sys/endian.h:1.31 src/sys/sys/endian.h:1.32
--- src/sys/sys/endian.h:1.31	Mon Aug  8 14:55:18 2022
+++ src/sys/sys/endian.h	Wed Jan  3 13:43:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: endian.h,v 1.31 2022/08/08 18:55:18 rillig Exp $	*/
+/*	$NetBSD: endian.h,v 1.32 2024/01/03 18:43:52 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -52,7 +52,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #ifndef in_addr_t
 typedef __in_addr_t	in_addr_t;



CVS commit: src/sys/sys

2024-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan  3 18:43:52 UTC 2024

Modified Files:
src/sys/sys: endian.h

Log Message:
break the cycle: this does not need  it only needs 


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/sys/endian.h

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



Re: CVS commit: src/sys/sys

2024-01-02 Thread Robert Elz
Date:Tue, 2 Jan 2024 21:20:42 -0500
From:Jason Thorpe 
Message-ID:  

  |  seems safe

Safe probably, but also wrong.   It looks to be there puerly
for the __BEGIN_DECLS / __END_DECLS definitions - which are
needed just beause  has prototypes for lseek()
truncate() and ftruncate() which make no sense in 
at all (beyond ancient history).

kre


Re: CVS commit: src/sys/sys

2024-01-02 Thread Jason Thorpe



> On Jan 2, 2024, at 8:41 PM, Robert Elz  wrote:
> 
> I doubt that  should really be including 
> and almost certainly not , and shouldn't have prototypes
> for any functions at all.

 seems safe — all of that stuff is in the implementation namespace.

-- thorpej



Re: CVS commit: src/sys/sys

2024-01-02 Thread Robert Elz
Date:Wed, 3 Jan 2024 03:15:39 +0300
From:Valery Ushakov 
Message-ID:  

  | for userland uses should include stddef.h where size_t is supposed
  | to come from

Unfortunately, while  is defined to specify size_t it
isn't specified to include ssize_t - and many things that need
size_t also need ssize_t (which includes src/usr.bin/tprof one of
the users of )

All of this is horribly ugly - perhaps we'd do better to remove
stuff from  that shouldn't be there (which is probably
any definition which doesn't end in _t except probably the old u_char
u_short ... and their uchar/ushort/... variants).   In particular
I doubt that  should really be including 
and almost certainly not , and shouldn't have prototypes
for any functions at all.

kre



Re: CVS commit: src/sys/sys

2024-01-02 Thread Valery Ushakov
On Wed, Jan 03, 2024 at 01:06:57 +0100, Joerg Sonnenberger wrote:
> Date: Wed, 03 Jan 2024 01:06:57 +0100
> From: Joerg Sonnenberger 
> Subject: Re: CVS commit: src/sys/sys
> To: source-changes-d@netbsd.org
> 
> On Tuesday, January 2, 2024 8:27:57 PM CET Christos Zoulas wrote:
> > Module Name:src
> > Committed By:   christos
> > Date:   Tue Jan  2 19:27:57 UTC 2024
> > 
> > Modified Files:
> > src/sys/sys: rbtree.h
> > 
> > Log Message:
> > This uses size_t, so it always needs , remove ifdefs.
> 
> sys/types.h is one of the most polluting headers we have. This is a huge
> step backwards...

Yes, I think we should keep the ifdef and for userland uses should
include stddef.h where size_t is supposed to come from (is inttypes.h
really needed there, or is it it just b/c it happens to include most
of the same stuff that stddef.h does and hence define size_t?)

-uwe


Re: CVS commit: src/sys/sys

2024-01-02 Thread Joerg Sonnenberger
On Tuesday, January 2, 2024 8:27:57 PM CET Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Tue Jan  2 19:27:57 UTC 2024
> 
> Modified Files:
>   src/sys/sys: rbtree.h
> 
> Log Message:
> This uses size_t, so it always needs , remove ifdefs.

sys/types.h is one of the most polluting headers we have. This is a huge
step backwards...

Joerg




CVS commit: src/sys/sys

2024-01-02 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jan  2 22:39:00 UTC 2024

Modified Files:
src/sys/sys: rbtree.h

Log Message:
Fix previous so  isn't included with _KERNEL (etc).
Like it used to be.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/rbtree.h

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

Modified files:

Index: src/sys/sys/rbtree.h
diff -u src/sys/sys/rbtree.h:1.10 src/sys/sys/rbtree.h:1.11
--- src/sys/sys/rbtree.h:1.10	Tue Jan  2 22:35:22 2024
+++ src/sys/sys/rbtree.h	Tue Jan  2 22:39:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbtree.h,v 1.10 2024/01/02 22:35:22 kre Exp $	*/
+/*	$NetBSD: rbtree.h,v 1.11 2024/01/02 22:39:00 kre Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include 
 #include 
 
-#ifdef RBDEBUG
+#if !defined(_KERNEL) && !defined(_STANDALONE) && defined(RBDEBUG)
 #include 
 #endif
 



CVS commit: src/sys/sys

2024-01-02 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jan  2 22:39:00 UTC 2024

Modified Files:
src/sys/sys: rbtree.h

Log Message:
Fix previous so  isn't included with _KERNEL (etc).
Like it used to be.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/rbtree.h

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



CVS commit: src/sys/sys

2024-01-02 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jan  2 22:35:22 UTC 2024

Modified Files:
src/sys/sys: rbtree.h

Log Message:
Put back  - but only when RBDEBUG is defined (the
similarly conditional rb_tree_check() prototype needs "bool").


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

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



CVS commit: src/sys/sys

2024-01-02 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jan  2 22:35:22 UTC 2024

Modified Files:
src/sys/sys: rbtree.h

Log Message:
Put back  - but only when RBDEBUG is defined (the
similarly conditional rb_tree_check() prototype needs "bool").


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

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

Modified files:

Index: src/sys/sys/rbtree.h
diff -u src/sys/sys/rbtree.h:1.9 src/sys/sys/rbtree.h:1.10
--- src/sys/sys/rbtree.h:1.9	Tue Jan  2 19:27:57 2024
+++ src/sys/sys/rbtree.h	Tue Jan  2 22:35:22 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbtree.h,v 1.9 2024/01/02 19:27:57 christos Exp $	*/
+/*	$NetBSD: rbtree.h,v 1.10 2024/01/02 22:35:22 kre Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -36,6 +36,10 @@
 #include 
 #include 
 
+#ifdef RBDEBUG
+#include 
+#endif
+
 __BEGIN_DECLS
 
 typedef struct rb_node {



CVS commit: src/sys/sys

2024-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan  2 19:27:57 UTC 2024

Modified Files:
src/sys/sys: rbtree.h

Log Message:
This uses size_t, so it always needs , remove ifdefs.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/sys/rbtree.h

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

Modified files:

Index: src/sys/sys/rbtree.h
diff -u src/sys/sys/rbtree.h:1.8 src/sys/sys/rbtree.h:1.9
--- src/sys/sys/rbtree.h:1.8	Fri Jul 21 07:26:23 2023
+++ src/sys/sys/rbtree.h	Tue Jan  2 14:27:57 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbtree.h,v 1.8 2023/07/21 11:26:23 riastradh Exp $	*/
+/*	$NetBSD: rbtree.h,v 1.9 2024/01/02 19:27:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -32,12 +32,7 @@
 #ifndef _SYS_RBTREE_H_
 #define	_SYS_RBTREE_H_
 
-#if defined(_KERNEL) || defined(_STANDALONE)
 #include 
-#else
-#include 
-#include 
-#endif
 #include 
 #include 
 



CVS commit: src/sys/sys

2024-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan  2 19:27:57 UTC 2024

Modified Files:
src/sys/sys: rbtree.h

Log Message:
This uses size_t, so it always needs , remove ifdefs.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/sys/rbtree.h

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



CVS commit: src/sys/sys

2023-12-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec  2 19:11:52 UTC 2023

Modified Files:
src/sys/sys: vmem.h vmem_impl.h

Log Message:
vmem_init() requires the caller to include  in order
to know the storage size of "struct vmem", so put the prototype for
vmem_init() there as well.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/sys/vmem.h
cvs rdiff -u -r1.5 -r1.6 src/sys/sys/vmem_impl.h

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

Modified files:

Index: src/sys/sys/vmem.h
diff -u src/sys/sys/vmem.h:1.22 src/sys/sys/vmem.h:1.23
--- src/sys/sys/vmem.h:1.22	Tue Jun 16 06:42:36 2020
+++ src/sys/sys/vmem.h	Sat Dec  2 19:11:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmem.h,v 1.22 2020/06/16 06:42:36 thorpej Exp $	*/
+/*	$NetBSD: vmem.h,v 1.23 2023/12/02 19:11:52 thorpej Exp $	*/
 
 /*-
  * Copyright (c)2006 YAMAMOTO Takashi,
@@ -64,9 +64,6 @@ vmem_t *	vmem_create(const char *, vmem_
 vmem_t *	vmem_xcreate(const char *, vmem_addr_t, vmem_size_t,
 		vmem_size_t, vmem_ximport_t *, vmem_release_t *, vmem_t *,
 		vmem_size_t, vm_flag_t, int);
-vmem_t *	vmem_init(vmem_t *, const char *, vmem_addr_t, vmem_size_t,
-		vmem_size_t, vmem_import_t *, vmem_release_t *, vmem_t *,
-		vmem_size_t, vm_flag_t, int);
 void		vmem_destroy(vmem_t *);
 int		vmem_alloc(vmem_t *, vmem_size_t, vm_flag_t, vmem_addr_t *);
 void		vmem_free(vmem_t *, vmem_addr_t, vmem_size_t);

Index: src/sys/sys/vmem_impl.h
diff -u src/sys/sys/vmem_impl.h:1.5 src/sys/sys/vmem_impl.h:1.6
--- src/sys/sys/vmem_impl.h:1.5	Tue Jul  7 03:23:33 2020
+++ src/sys/sys/vmem_impl.h	Sat Dec  2 19:11:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmem_impl.h,v 1.5 2020/07/07 03:23:33 thorpej Exp $	*/
+/*	$NetBSD: vmem_impl.h,v 1.6 2023/12/02 19:11:52 thorpej Exp $	*/
 
 /*-
  * Copyright (c)2006 YAMAMOTO Takashi,
@@ -139,4 +139,8 @@ struct vmem_btag {
 
 #define	BT_END(bt)	((bt)->bt_start + (bt)->bt_size - 1)
 
+vmem_t *	vmem_init(vmem_t *, const char *, vmem_addr_t, vmem_size_t,
+		vmem_size_t, vmem_import_t *, vmem_release_t *, vmem_t *,
+		vmem_size_t, vm_flag_t, int);
+
 #endif /* !_SYS_VMEM_IMPL_H_ */



CVS commit: src/sys/sys

2023-12-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec  2 19:11:52 UTC 2023

Modified Files:
src/sys/sys: vmem.h vmem_impl.h

Log Message:
vmem_init() requires the caller to include  in order
to know the storage size of "struct vmem", so put the prototype for
vmem_init() there as well.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/sys/vmem.h
cvs rdiff -u -r1.5 -r1.6 src/sys/sys/vmem_impl.h

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



CVS commit: src/sys/sys

2023-11-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 22 12:15:09 UTC 2023

Modified Files:
src/sys/sys: pax.h

Log Message:
PAGE_SIZE will not evaluate to a vaddr_t expression on all architectures
(e.g. sparc), so cast it to that.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/sys/pax.h

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

Modified files:

Index: src/sys/sys/pax.h
diff -u src/sys/sys/pax.h:1.28 src/sys/sys/pax.h:1.29
--- src/sys/sys/pax.h:1.28	Tue Nov 21 14:35:36 2023
+++ src/sys/sys/pax.h	Wed Nov 22 12:15:09 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: pax.h,v 1.28 2023/11/21 14:35:36 riastradh Exp $ */
+/* $NetBSD: pax.h,v 1.29 2023/11/22 12:15:09 martin Exp $ */
 
 /*-
  * Copyright (c) 2006 Elad Efrat 
@@ -150,7 +150,7 @@ pax_aslr_stack_gap(struct exec_package *
 static inline vaddr_t
 pax_aslr_exec_offset(struct exec_package *epp, vaddr_t align)
 {
-	return MAX(align, PAGE_SIZE);
+	return MAX(align, (vaddr_t)PAGE_SIZE);
 }
 static inline voff_t
 pax_aslr_rtld_offset(struct exec_package *epp, vaddr_t align, int use_topdown)



CVS commit: src/sys/sys

2023-11-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 22 12:15:09 UTC 2023

Modified Files:
src/sys/sys: pax.h

Log Message:
PAGE_SIZE will not evaluate to a vaddr_t expression on all architectures
(e.g. sparc), so cast it to that.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/sys/pax.h

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



CVS commit: src/sys/sys

2023-11-08 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Wed Nov  8 19:27:13 UTC 2023

Modified Files:
src/sys/sys: un.h

Log Message:
Use a #define for sockaddr_un.sun_path and add the historical context around
why it is set to 104. (struct sockaddr needed to fit into an mbuf)

>From FreeBSD; no objections on current-users@.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/sys/un.h

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

Modified files:

Index: src/sys/sys/un.h
diff -u src/sys/sys/un.h:1.60 src/sys/sys/un.h:1.61
--- src/sys/sys/un.h:1.60	Sun Aug  8 20:54:49 2021
+++ src/sys/sys/un.h	Wed Nov  8 19:27:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: un.h,v 1.60 2021/08/08 20:54:49 nia Exp $	*/
+/*	$NetBSD: un.h,v 1.61 2023/11/08 19:27:13 jschauma Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -44,12 +44,20 @@ typedef __sa_family_t	sa_family_t;
 #endif
 
 /*
+ * Historically, (struct sockaddr) needed to fit inside an mbuf.
+ * For this reason, UNIX domain sockets were therefore limited to
+ * 104 bytes. While this limit is no longer necessary, it is kept for
+ * binary compatibility reasons.
+ */
+#define	SUNPATHLEN	104
+
+/*
  * Definitions for UNIX IPC domain.
  */
 struct	sockaddr_un {
-	uint8_t		sun_len;	/* total sockaddr length */
-	sa_family_t	sun_family;	/* AF_LOCAL */
-	char		sun_path[104];	/* path name (gag) */
+	uint8_t		sun_len;		/* total sockaddr length */
+	sa_family_t	sun_family;		/* AF_LOCAL */
+	char		sun_path[SUNPATHLEN];	/* path name (gag) */
 };
 
 /*



CVS commit: src/sys/sys

2023-11-08 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Wed Nov  8 19:27:13 UTC 2023

Modified Files:
src/sys/sys: un.h

Log Message:
Use a #define for sockaddr_un.sun_path and add the historical context around
why it is set to 104. (struct sockaddr needed to fit into an mbuf)

>From FreeBSD; no objections on current-users@.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/sys/un.h

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



CVS commit: src/sys/sys

2023-10-27 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Fri Oct 27 14:34:58 UTC 2023

Modified Files:
src/sys/sys: clock.h

Log Message:
revert previous and go back to ifdef and 'include '

As noted on current-users, using sys/stdint.h breaks building tools
(albeit perhaps surprisingly so).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/sys/clock.h

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

Modified files:

Index: src/sys/sys/clock.h
diff -u src/sys/sys/clock.h:1.6 src/sys/sys/clock.h:1.7
--- src/sys/sys/clock.h:1.6	Thu Oct 26 14:04:45 2023
+++ src/sys/sys/clock.h	Fri Oct 27 14:34:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.h,v 1.6 2023/10/26 14:04:45 jschauma Exp $	*/
+/*	$NetBSD: clock.h,v 1.7 2023/10/27 14:34:58 jschauma Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -32,7 +32,9 @@
 #ifndef _SYS_CLOCK_H_
 #define _SYS_CLOCK_H_
 
-#include 
+#if !defined(_KERNEL) && !defined(_STANDALONE) 
+#include 
+#endif
 
 /* Some handy constants. */
 #define SECS_PER_MINUTE		60



CVS commit: src/sys/sys

2023-10-27 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Fri Oct 27 14:34:58 UTC 2023

Modified Files:
src/sys/sys: clock.h

Log Message:
revert previous and go back to ifdef and 'include '

As noted on current-users, using sys/stdint.h breaks building tools
(albeit perhaps surprisingly so).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/sys/clock.h

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



CVS commit: src/sys/sys

2023-10-26 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Thu Oct 26 14:04:46 UTC 2023

Modified Files:
src/sys/sys: clock.h

Log Message:
change include to sys/stdint.h, as suggested by simonb@

This avoids the need for #ifdefs, and stdint.h turns out to be a symlink
to sys/stdint.h to begin with.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/sys/clock.h

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

Modified files:

Index: src/sys/sys/clock.h
diff -u src/sys/sys/clock.h:1.5 src/sys/sys/clock.h:1.6
--- src/sys/sys/clock.h:1.5	Thu Oct 26 00:59:16 2023
+++ src/sys/sys/clock.h	Thu Oct 26 14:04:45 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.h,v 1.5 2023/10/26 00:59:16 jschauma Exp $	*/
+/*	$NetBSD: clock.h,v 1.6 2023/10/26 14:04:45 jschauma Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -32,9 +32,7 @@
 #ifndef _SYS_CLOCK_H_
 #define _SYS_CLOCK_H_
 
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-#include 
-#endif
+#include 
 
 /* Some handy constants. */
 #define SECS_PER_MINUTE		60



CVS commit: src/sys/sys

2023-10-26 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Thu Oct 26 14:04:46 UTC 2023

Modified Files:
src/sys/sys: clock.h

Log Message:
change include to sys/stdint.h, as suggested by simonb@

This avoids the need for #ifdefs, and stdint.h turns out to be a symlink
to sys/stdint.h to begin with.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/sys/clock.h

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



CVS commit: src/sys/sys

2023-10-25 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Thu Oct 26 00:59:16 UTC 2023

Modified Files:
src/sys/sys: clock.h

Log Message:
include stdint.h if not in kernel/standalone mode

This fixes problems with including sys/clock.h by itself and avoids
having to order headers counter to share/style.

ifdefs suggested by tnn@ on netbsd-users@.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/sys/clock.h

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

Modified files:

Index: src/sys/sys/clock.h
diff -u src/sys/sys/clock.h:1.4 src/sys/sys/clock.h:1.5
--- src/sys/sys/clock.h:1.4	Thu Apr 19 21:19:07 2018
+++ src/sys/sys/clock.h	Thu Oct 26 00:59:16 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.h,v 1.4 2018/04/19 21:19:07 christos Exp $	*/
+/*	$NetBSD: clock.h,v 1.5 2023/10/26 00:59:16 jschauma Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -32,6 +32,10 @@
 #ifndef _SYS_CLOCK_H_
 #define _SYS_CLOCK_H_
 
+#if !defined(_KERNEL) && !defined(_STANDALONE)
+#include 
+#endif
+
 /* Some handy constants. */
 #define SECS_PER_MINUTE		60
 #define SECS_PER_HOUR		3600



CVS commit: src/sys/sys

2023-10-25 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Thu Oct 26 00:59:16 UTC 2023

Modified Files:
src/sys/sys: clock.h

Log Message:
include stdint.h if not in kernel/standalone mode

This fixes problems with including sys/clock.h by itself and avoids
having to order headers counter to share/style.

ifdefs suggested by tnn@ on netbsd-users@.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/sys/clock.h

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   >