diff options
| -rw-r--r-- | contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h | 5 | ||||
| -rw-r--r-- | share/examples/mdoc/example.1 | 23 | ||||
| -rw-r--r-- | share/examples/mdoc/example.3 | 23 | ||||
| -rw-r--r-- | share/examples/mdoc/example.4 | 23 | ||||
| -rw-r--r-- | share/examples/mdoc/example.9 | 23 | ||||
| -rw-r--r-- | share/man/man5/style.mdoc.5 | 30 | ||||
| -rw-r--r-- | share/man/man9/g_bio.9 | 3 | ||||
| -rw-r--r-- | share/man/man9/uio.9 | 14 | ||||
| -rw-r--r-- | sys/net/altq/altq_cbq.c | 2 | ||||
| -rw-r--r-- | sys/net/altq/altq_fairq.c | 2 | ||||
| -rw-r--r-- | sys/net/altq/altq_priq.c | 2 | ||||
| -rw-r--r-- | sys/net/if.c | 34 | ||||
| -rw-r--r-- | usr.bin/w/w.c | 33 | 
13 files changed, 83 insertions, 134 deletions
| diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h index 7ab63905ed4f..7d090ba682b3 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.h @@ -78,6 +78,11 @@ public:    void AddHIPIncludeArgs(const llvm::opt::ArgList &DriverArgs,                           llvm::opt::ArgStringList &CC1Args) const override; +  bool IsAArch64OutlineAtomicsDefault( +      const llvm::opt::ArgList &Args) const override { +    return true; +  } +    UnwindTableLevel    getDefaultUnwindTableLevel(const llvm::opt::ArgList &Args) const override;    bool isPIEDefault(const llvm::opt::ArgList &Args) const override; diff --git a/share/examples/mdoc/example.1 b/share/examples/mdoc/example.1 index 0bdabe95aa95..daffb8bc0422 100644 --- a/share/examples/mdoc/example.1 +++ b/share/examples/mdoc/example.1 @@ -1,28 +1,7 @@  .\" -.\" SPDX-License-Identifier: BSD-2-Clause -.\"  .\" Copyright (c) [year] [your name]  .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\"    notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\"    notice, this list of conditions and the following disclaimer in the -.\"    documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. +.\" SPDX-License-Identifier: BSD-2-Clause  .\"  .\" Note: The date here should be updated whenever a non-trivial  .\" change is made to the manual page. diff --git a/share/examples/mdoc/example.3 b/share/examples/mdoc/example.3 index c4e85062cad1..22c398e0491c 100644 --- a/share/examples/mdoc/example.3 +++ b/share/examples/mdoc/example.3 @@ -1,28 +1,7 @@  .\" -.\" SPDX-License-Identifier: BSD-2-Clause -.\"  .\" Copyright (c) [year] [your name]  .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\"    notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\"    notice, this list of conditions and the following disclaimer in the -.\"    documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. +.\" SPDX-License-Identifier: BSD-2-Clause  .\"  .\" Note: The date here should be updated whenever a non-trivial  .\" change is made to the manual page. diff --git a/share/examples/mdoc/example.4 b/share/examples/mdoc/example.4 index 47ae5456b79a..e627f81af530 100644 --- a/share/examples/mdoc/example.4 +++ b/share/examples/mdoc/example.4 @@ -1,28 +1,7 @@  .\" -.\" SPDX-License-Identifier: BSD-2-Clause -.\"  .\" Copyright (c) [year] [your name]  .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\"    notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\"    notice, this list of conditions and the following disclaimer in the -.\"    documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. +.\" SPDX-License-Identifier: BSD-2-Clause  .\"  .\" Note: The date here should be updated whenever a non-trivial  .\" change is made to the manual page. diff --git a/share/examples/mdoc/example.9 b/share/examples/mdoc/example.9 index 1dd24a99fd42..f105f7465f2c 100644 --- a/share/examples/mdoc/example.9 +++ b/share/examples/mdoc/example.9 @@ -1,28 +1,7 @@  .\" -.\" SPDX-License-Identifier: BSD-2-Clause -.\"  .\" Copyright (c) [year] [your name]  .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\"    notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\"    notice, this list of conditions and the following disclaimer in the -.\"    documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. +.\" SPDX-License-Identifier: BSD-2-Clause  .\"  .\" Note: The date here should be updated whenever a non-trivial  .\" change is made to the manual page. diff --git a/share/man/man5/style.mdoc.5 b/share/man/man5/style.mdoc.5 index c1592bf8b87f..41c0c3783c80 100644 --- a/share/man/man5/style.mdoc.5 +++ b/share/man/man5/style.mdoc.5 @@ -1,30 +1,9 @@  .\" -.\" SPDX-License-Identifier: BSD-2-Clause -.\" -.\" Copyright (c) 2018-2022 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" Copyright (c) 2018-2025 Mateusz Piotrowski <0mp@FreeBSD.org>  .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\"    notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\"    notice, this list of conditions and the following disclaimer in the -.\"    documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. +.\" SPDX-License-Identifier: BSD-2-Clause  .\" -.Dd January 29, 2022 +.Dd October 24, 2025  .Dt STYLE.MDOC 5  .Os  .Sh NAME @@ -74,6 +53,9 @@ Historically,  was the preferred way before the deprecation of  .Sy \&Li .  .El +.Ss Copyright Header +Refer to +.Xr style 9 .  .Ss EXAMPLES Section  .Bl -dash -width ""  .It diff --git a/share/man/man9/g_bio.9 b/share/man/man9/g_bio.9 index 8fad07b0f327..21b76cff04b6 100644 --- a/share/man/man9/g_bio.9 +++ b/share/man/man9/g_bio.9 @@ -22,7 +22,7 @@  .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF  .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  .\" -.Dd August 7, 2019 +.Dd October 26, 2025  .Dt G_BIO 9  .Os  .Sh NAME @@ -309,6 +309,7 @@ example_start(struct bio *bp)  }  .Ed  .Sh SEE ALSO +.Xr dtrace_io 4 ,  .Xr geom 4 ,  .Xr DECLARE_GEOM_CLASS 9 ,  .Xr g_access 9 , diff --git a/share/man/man9/uio.9 b/share/man/man9/uio.9 index e6240c4e51d3..b143eb6e8e62 100644 --- a/share/man/man9/uio.9 +++ b/share/man/man9/uio.9 @@ -23,7 +23,7 @@  .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF  .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  .\" -.Dd March 11, 2017 +.Dd October 22, 2025  .Dt UIO 9  .Os  .Sh NAME @@ -107,10 +107,14 @@ The I/O vector points into the kernel address space.  Do not copy, already in object.  .El  .It Va uio_rw -The direction of the desired transfer, either -.Dv UIO_READ -or -.Dv UIO_WRITE . +The direction of the desired transfer. +The supported flags are: +.Bl -tag -width "UIO_WRITE" +.It Dv UIO_READ +Transfer data from the buffers into the I/O vectors. +.It Dv UIO_WRITE +Transfer data from the I/O vectors into the buffers. +.El  .It Va uio_td  The pointer to a  .Vt "struct thread" diff --git a/sys/net/altq/altq_cbq.c b/sys/net/altq/altq_cbq.c index bcba09267289..07c61fccb19b 100644 --- a/sys/net/altq/altq_cbq.c +++ b/sys/net/altq/altq_cbq.c @@ -172,6 +172,8 @@ cbq_request(struct ifaltq *ifq, int req, void *arg)  static void  get_class_stats(class_stats_t *statsp, struct rm_class *cl)  { +	memset(statsp, 0, sizeof(*statsp)); +  	statsp->xmit_cnt	= cl->stats_.xmit_cnt;  	statsp->drop_cnt	= cl->stats_.drop_cnt;  	statsp->over		= cl->stats_.over; diff --git a/sys/net/altq/altq_fairq.c b/sys/net/altq/altq_fairq.c index e20eea91b1a1..49046da24594 100644 --- a/sys/net/altq/altq_fairq.c +++ b/sys/net/altq/altq_fairq.c @@ -856,6 +856,8 @@ get_class_stats(struct fairq_classstats *sp, struct fairq_class *cl)  {  	fairq_bucket_t *b; +	memset(sp, 0, sizeof(*sp)); +  	sp->class_handle = cl->cl_handle;  	sp->qlimit = cl->cl_qlimit;  	sp->xmit_cnt = cl->cl_xmitcnt; diff --git a/sys/net/altq/altq_priq.c b/sys/net/altq/altq_priq.c index 32ebfdefbfbe..8023dc12e029 100644 --- a/sys/net/altq/altq_priq.c +++ b/sys/net/altq/altq_priq.c @@ -597,6 +597,8 @@ priq_purgeq(struct priq_class *cl)  static void  get_class_stats(struct priq_classstats *sp, struct priq_class *cl)  { +	memset(sp, 0, sizeof(*sp)); +  	sp->class_handle = cl->cl_handle;  	sp->qlength = qlen(cl->cl_q);  	sp->qlimit = qlimit(cl->cl_q); diff --git a/sys/net/if.c b/sys/net/if.c index 46ebabe09a51..c642e99136d8 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2806,15 +2806,20 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)  		break;  	case SIOCAIFGROUP: +	{ +		const char *groupname; +  		error = priv_check(td, PRIV_NET_ADDIFGROUP);  		if (error)  			return (error); -		error = if_addgroup(ifp, -		    ((struct ifgroupreq *)data)->ifgr_group); +		groupname = ((struct ifgroupreq *)data)->ifgr_group; +		if (strnlen(groupname, IFNAMSIZ) == IFNAMSIZ) +			return (EINVAL); +		error = if_addgroup(ifp, groupname);  		if (error != 0)  			return (error);  		break; - +	}  	case SIOCGIFGROUP:  	{  		struct epoch_tracker et; @@ -2826,15 +2831,20 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)  	}  	case SIOCDIFGROUP: +	{ +		const char *groupname; +  		error = priv_check(td, PRIV_NET_DELIFGROUP);  		if (error)  			return (error); -		error = if_delgroup(ifp, -		    ((struct ifgroupreq *)data)->ifgr_group); +		groupname = ((struct ifgroupreq *)data)->ifgr_group; +		if (strnlen(groupname, IFNAMSIZ) == IFNAMSIZ) +			return (EINVAL); +		error = if_delgroup(ifp, groupname);  		if (error != 0)  			return (error);  		break; - +	}  	default:  		error = ENOIOCTL;  		break; @@ -2978,9 +2988,17 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td)  		goto out_noref;  	case SIOCGIFGMEMB: -		error = if_getgroupmembers((struct ifgroupreq *)data); -		goto out_noref; +	{ +		struct ifgroupreq *req; +		req = (struct ifgroupreq *)data; +		if (strnlen(req->ifgr_name, IFNAMSIZ) == IFNAMSIZ) { +			error = EINVAL; +			goto out_noref; +		} +		error = if_getgroupmembers(req); +		goto out_noref; +	}  #if defined(INET) || defined(INET6)  	case SIOCSVH:  	case SIOCGVH: diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 7c67a851ca99..94b7880532b1 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -476,7 +476,7 @@ main(int argc, char *argv[])  static void  pr_header(time_t *nowp, int nusers)  { -	char buf[64]; +	char buf[64], *s, *e;  	struct sbuf upbuf;  	double avenrun[3];  	struct timespec tp; @@ -487,8 +487,15 @@ pr_header(time_t *nowp, int nusers)  	 * Print time of day.  	 */  	if (strftime(buf, sizeof(buf), -	    use_ampm ? "%l:%M%p" : "%k:%M", localtime(nowp)) != 0) -		xo_emit("{:time-of-day/%s} ", buf); +	    use_ampm ? "%l:%M%p" : "%k:%M", localtime(nowp)) != 0) { +		s = buf; +		if (xo_get_style(NULL) != XO_STYLE_TEXT) { +			/* trim leading whitespace */ +			while (isspace((unsigned char)*s)) +				s++; +		} +		xo_emit("{:time-of-day/%s} ", s); +	}  	/*  	 * Print how long system has been up.  	 */ @@ -519,21 +526,31 @@ pr_header(time_t *nowp, int nusers)  		if (days > 0)  			sbuf_printf(&upbuf, " %ld day%s,", -				days, days > 1 ? "s" : ""); +			    days, days > 1 ? "s" : "");  		if (hrs > 0 && mins > 0)  			sbuf_printf(&upbuf, " %2ld:%02ld,", hrs, mins);  		else if (hrs > 0)  			sbuf_printf(&upbuf, " %ld hr%s,", -				hrs, hrs > 1 ? "s" : ""); +			    hrs, hrs > 1 ? "s" : "");  		else if (mins > 0)  			sbuf_printf(&upbuf, " %ld min%s,", -				mins, mins > 1 ? "s" : ""); +			    mins, mins > 1 ? "s" : "");  		else  			sbuf_printf(&upbuf, " %ld sec%s,", -				secs, secs > 1 ? "s" : ""); +			    secs, secs > 1 ? "s" : "");  		if (sbuf_finish(&upbuf) != 0)  			xo_err(1, "Could not generate output"); -		xo_emit("{:uptime-human/%s}", sbuf_data(&upbuf)); +		s = sbuf_data(&upbuf); +		if (xo_get_style(NULL) != XO_STYLE_TEXT) { +			e = s + sbuf_len(&upbuf) - 1; +			/* trim leading whitespace */ +			while (isspace((unsigned char)*s)) +				s++; +			/* trim trailing comma */ +			if (e > s && *e == ',') +				*e = '\0'; +		} +		xo_emit("{:uptime-human/%s}", s);  		sbuf_delete(&upbuf);  	} | 
