diff --git a/contrib/elftoolchain/strings/strings.1 b/contrib/elftoolchain/strings/strings.1 index 205afdfc4505..74f0d8628925 100644 --- a/contrib/elftoolchain/strings/strings.1 +++ b/contrib/elftoolchain/strings/strings.1 @@ -1,165 +1,165 @@ .\" Copyright (c) 2007 S.Sam Arun Raj .\" All rights reserved. .\" .\" 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. .\" .\" $Id: strings.1 3360 2016-01-24 18:34:06Z jkoshy $ .\" .Dd January 24, 2016 .Dt STRINGS 1 .Os .Sh NAME .Nm strings .Nd "print the strings of printable characters in files" .Sh SYNOPSIS .Nm .Op Fl a | Fl -all .Op Fl e Ar encoding | Fl -encoding= Ns Ar encoding .Op Fl f | Fl -print-file-name .Op Fl h | Fl -help .Op Fl n Ar number | Fl -bytes= Ns Ar number | Fl Ar number .Op Fl o .Op Fl t Ar radix | Fl -radix= Ns Ar radix .Op Fl v | Fl -version .Op Ar .Sh DESCRIPTION For each .Ar file specified, the .Nm utility prints contiguous sequences of printable characters that are at least .Va n characters long and are followed by an unprintable character. The default value of .Va n is 4. By default, the .Nm utility only scans the initialized and loaded sections of ELF objects; for other file types, the entire file is scanned. The .Nm utility is mainly used for determining the contents of non-text files. .Pp If no file name is specified as an argument, standard input is read. .Pp The following options are available: .Bl -tag -width indent .It Fl a | Fl -all For ELF objects, scan the entire file for printable strings. .It Fl e Ar encoding | Fl -encoding= Ns Ar encoding Select the character encoding to be used while searching for strings. Valid values for argument .Ar encoding are: .Bl -tag -width indent -compact .It Ar s for single 7-bit-byte characters (ASCII, ISO 8859). .It Ar S for single 8-bit-byte characters. .It Ar l for 16-bit little-endian. .It Ar b for 16-bit big-endian. .It Ar L for 32-bit little-endian. .It Ar B for 32-bit big-endian. .El The default is to assume that characters are encoded using a single 7-bit byte. .It Fl f | Fl -print-file-name Print the name of the file before each string. .It Fl h | Fl -help Print a usage summary and exit. .It Xo .Fl n Ar number | .Fl -bytes= Ns Ar number | .Fl Ar number .Xc Print the contiguous character sequence of at least .Ar number characters long, instead of the default of 4 characters. Argument .Ar number should specify a positive decimal integer. .It Fl o Equivalent to specifying .Fl t Ar o . .It Fl t Ar radix | Fl -radix= Ns Ar radix Print the offset from the start of the file before each string using the specified radix. Valid values for argument .Ar radix are: .Bl -tag -width indent -compact .It Ar d for decimal .It Ar o for octal .It Ar x for hexadecimal .El .It Fl v | Fl -version Display a version identifier and exit. .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES To display strings in .Pa /bin/ls use: .Dl "$ strings /bin/ls" .Pp To display strings in all sections of .Pa /bin/ln use: .Dl "$ strings -a /bin/ln" .Pp To display strings in all sections of .Pa /bin/cat prefixed with the filename and the offset within the file use: .Dl "$ strings -a -f -t x /bin/cat" .Sh SEE ALSO .Xr ar 1 , .Xr nm 1 , .Xr objdump 1 , .Xr ranlib , .Xr readelf 1 , .Xr size 1 .Sh HISTORY The first FreeBSD .Nm utility appeared in -.Fx v3. +.Fx v3 . It was later discontinued in .Fx v5 , when i386-only a.out format was dropped in favor of ELF. .Sh AUTHORS .An -nosplit The .Nm utility was re-written by .An S.Sam Arun Raj Aq Mt samarunraj@gmail.com . This manual page was written by .An S.Sam Arun Raj Aq Mt samarunraj@gmail.com . diff --git a/lib/libc/stdbit/stdc_bit_ceil.3 b/lib/libc/stdbit/stdc_bit_ceil.3 index 470b255f471e..12644ab56c58 100644 --- a/lib/libc/stdbit/stdc_bit_ceil.3 +++ b/lib/libc/stdbit/stdc_bit_ceil.3 @@ -1,81 +1,81 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_BIT_CEIL 3 .Os .Sh NAME .Nm stdc_bit_ceil .Nd round up to the next power of\~2 .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned char .Fn stdc_bit_ceil_uc "unsigned char value" .Ft unsigned short .Fn stdc_bit_ceil_us "unsigned short value" .Ft unsigned int .Fn stdc_bit_ceil_ui "unsigned int value" .Ft unsigned long .Fn stdc_bit_ceil_ul "unsigned long value" .Ft unsigned long long .Fn stdc_bit_ceil_ull "unsigned long long value" .Ft typeof Ns Pq Em value .Fn stdc_bit_ceil "value" .Sh DESCRIPTION The .Nm stdc_bit_ceil_ Ns Em type Ns () family of functions rounds .Fa value up to the next power of\~2, where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_bit_ceil "value" type-generic macro picks the appropriate .Nm stdc_bit_ceil_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns .Fa value round up to the next power of\~2. If this value is not representable, 0\~is returned. .Sh SEE ALSO .Xr stdbit 3 , .Xr stdc_bit_floor 3 .Sh STANDARDS The .Nm stdc_bit_ceil_ Ns Em type Ns () family of functions and the .Fn stdc_bit_ceil type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_bit_ceil_ Ns Em type Ns () family of functions and the .Fn stdc_bit_ceil type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_bit_floor.3 b/lib/libc/stdbit/stdc_bit_floor.3 index 3e90c34f070f..375bc922fc2f 100644 --- a/lib/libc/stdbit/stdc_bit_floor.3 +++ b/lib/libc/stdbit/stdc_bit_floor.3 @@ -1,83 +1,83 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_BIT_FLOOR 3 .Os .Sh NAME .Nm stdc_bit_floor .Nd round down to the previous power of\~2 .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned char .Fn stdc_bit_floor_uc "unsigned char value" .Ft unsigned short .Fn stdc_bit_floor_us "unsigned short value" .Ft unsigned int .Fn stdc_bit_floor_ui "unsigned int value" .Ft unsigned long .Fn stdc_bit_floor_ul "unsigned long value" .Ft unsigned long long .Fn stdc_bit_floor_ull "unsigned long long value" .Ft typeof Ns Pq Em value .Fn stdc_bit_floor "value" .Sh DESCRIPTION The .Nm stdc_bit_floor_ Ns Em type Ns () family of functions rounds .Fa value down to the previous power of\~2, where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_bit_floor "value" type-generic macro picks the appropriate .Nm stdc_bit_floor_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns .Fa value round down to the previous power of\~2. If .Fa value is equal to zero, zero is returned. .Sh SEE ALSO .Xr stdbit 3 , .Xr stdc_bit_ceil 3 .Sh STANDARDS The .Nm stdc_bit_floor_ Ns Em type Ns () family of functions and the .Fn stdc_bit_floor type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_bit_floor_ Ns Em type Ns () family of functions and the .Fn stdc_bit_floor type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_bit_width.3 b/lib/libc/stdbit/stdc_bit_width.3 index 8d59886818d3..73aad274911c 100644 --- a/lib/libc/stdbit/stdc_bit_width.3 +++ b/lib/libc/stdbit/stdc_bit_width.3 @@ -1,104 +1,104 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_BIT_WIDTH 3 .Os .Sh NAME .Nm stdc_bit_width .Nd find the first trailing one in an intege .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_bit_width_uc "unsigned char value" .Ft unsigned int .Fn stdc_bit_width_us "unsigned short value" .Ft unsigned int .Fn stdc_bit_width_ui "unsigned int value" .Ft unsigned int .Fn stdc_bit_width_ul "unsigned long value" .Ft unsigned int .Fn stdc_bit_width_ull "unsigned long long value" .Ft unsigned int .Fn stdc_bit_width "value" .Sh DESCRIPTION The .Nm stdc_bit_width_ Ns Em type Ns () family of functions returns the number of bits needed to represent .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_bit_width "value" type-generic macro picks the appropriate .Nm stdc_bit_width_ Ns Em type Ns () function based on the type of .Fa value . .Pp Functions .Fn stdc_bit_width_ui , .Fn stdc_bit_width_ul , and .Fn stdc_bit_width_ull are identical to .Bx 4.3 functions .Xr fls 3 , .Xr flsl 3 , and .Xr flsll 3 respectively, except for operating on unsigned instead of signed values. .Sh RETURN VALUES Returns the least number of bits needed to represent .Fa value . If .Fa value is zero, the return value is zero. Otherwise it is .EQ 1 + \(lf log sub 2 italic value \(rf . .EN .Sh SEE ALSO .Xr bit_fls 3 , .Xr fls 3 , .Xr flsl 3 , .Xr flsll 3 , .Xr stdbit 3 , .Xr stdc_count_leading_zeros 3 , .Xr stdc_first_leading_one 3 .Sh STANDARDS The .Nm stdc_bit_width_ Ns Em type Ns () family of functions and the .Fn stdc_bit_width type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_bit_width_ Ns Em type Ns () family of functions and the .Fn stdc_bit_width type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_count_ones.3 b/lib/libc/stdbit/stdc_count_ones.3 index 6de92216c24b..c6667a74694c 100644 --- a/lib/libc/stdbit/stdc_count_ones.3 +++ b/lib/libc/stdbit/stdc_count_ones.3 @@ -1,85 +1,85 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_COUNT_ONES 3 .Os .Sh NAME .Nm stdc_count_ones .Nd count the ones in an integer .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_count_ones_uc "unsigned char value" .Ft unsigned int .Fn stdc_count_ones_us "unsigned short value" .Ft unsigned int .Fn stdc_count_ones_ui "unsigned int value" .Ft unsigned int .Fn stdc_count_ones_ul "unsigned long value" .Ft unsigned int .Fn stdc_count_ones_ull "unsigned long long value" .Ft unsigned int .Fn stdc_count_ones "value" .Sh DESCRIPTION The .Nm stdc_count_ones_ Ns Em type Ns () family of functions returns the number of bits set to\~1 in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. This is also known as the .Dq population count (popcount) or .Dq Hamming weight operation. The .Fn stdc_count_ones "value" type-generic macro picks the appropriate .Nm stdc_count_ones_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns the number of bits set to\~1 in .Fa value . .Sh SEE ALSO .Xr bit_count 3 , .Xr stdbit 3 , .Xr stdc_count_zeros 3 , .Xr stdc_has_single_bit 3 .Sh STANDARDS The .Nm stdc_count_ones_ Ns Em type Ns () family of functions and the .Fn stdc_count_ones type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_count_ones_ Ns Em type Ns () family of functions and the .Fn stdc_count_ones type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_count_zeros.3 b/lib/libc/stdbit/stdc_count_zeros.3 index 762ba62d3793..a83685670a4f 100644 --- a/lib/libc/stdbit/stdc_count_zeros.3 +++ b/lib/libc/stdbit/stdc_count_zeros.3 @@ -1,84 +1,84 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_COUNT_ZEROS 3 .Os .Sh NAME .Nm stdc_count_zeros .Nd count the zeros in an integer .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_count_zeros_uc "unsigned char value" .Ft unsigned int .Fn stdc_count_zeros_us "unsigned short value" .Ft unsigned int .Fn stdc_count_zeros_ui "unsigned int value" .Ft unsigned int .Fn stdc_count_zeros_ul "unsigned long value" .Ft unsigned int .Fn stdc_count_zeros_ull "unsigned long long value" .Ft unsigned int .Fn stdc_count_zeros "value" .Sh DESCRIPTION The .Nm stdc_count_zeros_ Ns Em type Ns () family of functions returns the number of bits set to\~0 in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. This is also known as the .Dq population count (popcount) or .Dq Hamming weight of the complement of .Fa value . The .Fn stdc_count_zeros "value" type-generic macro picks the appropriate .Nm stdc_count_zeros_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns the number of bits set to\~0 in .Fa value . .Sh SEE ALSO .Xr stdbit 3 , .Xr stdc_count_ones 3 .Sh STANDARDS The .Nm stdc_count_zeros_ Ns Em type Ns () family of functions and the .Fn stdc_count_zeros type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_count_zeros_ Ns Em type Ns () family of functions and the .Fn stdc_count_zeros type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_first_leading_one.3 b/lib/libc/stdbit/stdc_first_leading_one.3 index 48f62d997043..010df45e7d59 100644 --- a/lib/libc/stdbit/stdc_first_leading_one.3 +++ b/lib/libc/stdbit/stdc_first_leading_one.3 @@ -1,93 +1,93 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_FIRST_LEADING_ONE 3 .Os .Sh NAME .Nm stdc_first_leading_one .Nd find the first leading one in an integer .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_first_leading_one_uc "unsigned char value" .Ft unsigned int .Fn stdc_first_leading_one_us "unsigned short value" .Ft unsigned int .Fn stdc_first_leading_one_ui "unsigned int value" .Ft unsigned int .Fn stdc_first_leading_one_ul "unsigned long value" .Ft unsigned int .Fn stdc_first_leading_one_ull "unsigned long long value" .Ft unsigned int .Fn stdc_first_leading_one "value" .Sh DESCRIPTION The .Nm stdc_first_leading_one_ Ns Em type Ns () family of functions returns the index of the most significant set bit in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_first_leading_one "value" type-generic macro picks the appropriate .Nm stdc_first_leading_one_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns the index of the most significant set bit in .Fa value . The bits are numbered such that the most significant bit has number\~1, and the least significant bit has number .Ms w where .Ms w is the number of bits in the type of .Fa value . If no bits are set in .Fa value (i.\^e.\& .Fa value is zero), zero is returned. .Sh SEE ALSO .Xr fls 3 , .Xr stdbit 3 , .Xr stdc_leading_zeros 3 , .Xr stdc_first_leading_zero 3 , .Xr stdc_first_trailing_one 3 .Sh STANDARDS The .Nm stdc_first_leading_one_ Ns Em type Ns () family of functions and the .Fn stdc_first_leading_one type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_first_leading_one_ Ns Em type Ns () family of functions and the .Fn stdc_first_leading_one type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_first_leading_zero.3 b/lib/libc/stdbit/stdc_first_leading_zero.3 index 317b6263acb0..7e99729921f1 100644 --- a/lib/libc/stdbit/stdc_first_leading_zero.3 +++ b/lib/libc/stdbit/stdc_first_leading_zero.3 @@ -1,92 +1,92 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_FIRST_LEADING_ZERO 3 .Os .Sh NAME .Nm stdc_first_leading_zero .Nd find the first leading zero in an integer .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_first_leading_zero_uc "unsigned char value" .Ft unsigned int .Fn stdc_first_leading_zero_us "unsigned short value" .Ft unsigned int .Fn stdc_first_leading_zero_ui "unsigned int value" .Ft unsigned int .Fn stdc_first_leading_zero_ul "unsigned long value" .Ft unsigned int .Fn stdc_first_leading_zero_ull "unsigned long long value" .Ft unsigned int .Fn stdc_first_leading_zero "value" .Sh DESCRIPTION The .Nm stdc_first_leading_zero_ Ns Em type Ns () family of functions returns the index of the most significant clear bit in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_first_leading_zero "value" type-generic macro picks the appropriate .Nm stdc_first_leading_zero_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns the index of the most significant clear bit in .Fa value . The bits are numbered such that the most significant bit has number\~1, and the least significant bit has number .Ms w where .Ms w is the number of bits in the type of .Fa value . If no bits are clear in .Fa value (i.\^e.\& .Fa value is the bitwise complement of zero), zero is returned. .Sh SEE ALSO .Xr stdbit 3 , .Xr stdc_leading_ones 3 , .Xr stdc_first_leading_ones 3 , .Xr stdc_first_trailing_zero 3 .Sh STANDARDS The .Nm stdc_first_leading_zero_ Ns Em type Ns () family of functions and the .Fn stdc_first_leading_zero type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_first_leading_zero_ Ns Em type Ns () family of functions and the .Fn stdc_first_leading_zero type-generic macro were added in .Fx 15.1. -.Sh AUTHOR +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_first_trailing_one.3 b/lib/libc/stdbit/stdc_first_trailing_one.3 index 0b590ac39732..e3432ad7f75d 100644 --- a/lib/libc/stdbit/stdc_first_trailing_one.3 +++ b/lib/libc/stdbit/stdc_first_trailing_one.3 @@ -1,110 +1,110 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_FIRST_TRAILING_ONE 3 .Os .Sh NAME .Nm stdc_first_trailing_one .Nd find the first trailing one in an integer .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_first_trailing_one_uc "unsigned char value" .Ft unsigned int .Fn stdc_first_trailing_one_us "unsigned short value" .Ft unsigned int .Fn stdc_first_trailing_one_ui "unsigned int value" .Ft unsigned int .Fn stdc_first_trailing_one_ul "unsigned long value" .Ft unsigned int .Fn stdc_first_trailing_one_ull "unsigned long long value" .Ft unsigned int .Fn stdc_first_trailing_one "value" .Sh DESCRIPTION The .Nm stdc_first_trailing_one_ Ns Em type Ns () family of functions returns the index of the least significant set bit in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_first_trailing_one "value" type-generic macro picks the appropriate .Nm stdc_first_trailing_one_ Ns Em type Ns () function based on the type of .Fa value . .Pp Functions .Fn stdc_first_trailing_one_ui , .Fn stdc_first_trailing_one_ul , and .Fn stdc_first_trailing_one_ull are identical to .Bx 4.3 functions .Xr ffs 3 , .Xr ffsl 3 , and .Xr ffsll 3 respectively, except for operating on unsigned instead of signed values. .Sh RETURN VALUES Returns the index of the least significant set bit in .Fa value . The bits are numbered such that the least significant bit has number\~1, and the most significant bit has number .Ms w where .Ms w is the number of bits in the type of .Fa value . If no bits are set in .Fa value (i.\^e.\& .Fa value is zero), one is returned. .Sh SEE ALSO .Xr bit_ffs 3 , .Xr ffs 3 , .Xr ffsl 3 , .Xr ffsll 3 , .Xr stdbit 3 , .Xr stdc_trailing_zeros 3 , .Xr stdc_first_trailing_zero 3 , .Xr stdc_first_leading_one 3 .Sh STANDARDS The .Nm stdc_first_trailing_one_ Ns Em type Ns () family of functions and the .Fn stdc_first_trailing_one type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_first_trailing_one_ Ns Em type Ns () family of functions and the .Fn stdc_first_trailing_one type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_first_trailing_zero.3 b/lib/libc/stdbit/stdc_first_trailing_zero.3 index bc4f7982d765..a9f6fb1ca9f8 100644 --- a/lib/libc/stdbit/stdc_first_trailing_zero.3 +++ b/lib/libc/stdbit/stdc_first_trailing_zero.3 @@ -1,93 +1,93 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_FIRST_TRAILING_ZERO 3 .Os .Sh NAME .Nm stdc_first_trailing_zero .Nd find the first trailing zero in an integer .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_first_trailing_zero_uc "unsigned char value" .Ft unsigned int .Fn stdc_first_trailing_zero_us "unsigned short value" .Ft unsigned int .Fn stdc_first_trailing_zero_ui "unsigned int value" .Ft unsigned int .Fn stdc_first_trailing_zero_ul "unsigned long value" .Ft unsigned int .Fn stdc_first_trailing_zero_ull "unsigned long long value" .Ft unsigned int .Fn stdc_first_trailing_zero "value" .Sh DESCRIPTION The .Nm stdc_first_trailing_zero_ Ns Em type Ns () family of functions returns the index of the least significant clear bit in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_first_trailing_zero "value" type-generic macro picks the appropriate .Nm stdc_first_trailing_zero_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns the index of the least significant clear bit in .Fa value . The bits are numbered such that the least significant bit has number\~1, and the most significant bit has number .Ms w where .Ms w is the number of bits in the type of .Fa value . If no bits are clear in .Fa value (i.\^e.\& .Fa value is the bitwise complement of zero), zero is returned. .Sh SEE ALSO .Xr bit_ffc 3 , .Xr stdbit 3 , .Xr stdc_trailing_ones 3 , .Xr stdc_first_trailing_ones 3 , .Xr stdc_first_leading_zero 3 .Sh STANDARDS The .Nm stdc_first_trailing_zero_ Ns Em type Ns () family of functions and the .Fn stdc_first_trailing_zero type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_first_trailing_zero_ Ns Em type Ns () family of functions and the .Fn stdc_first_trailing_zero type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_has_single_bit.3 b/lib/libc/stdbit/stdc_has_single_bit.3 index 8f82c552216a..55f96a0419ea 100644 --- a/lib/libc/stdbit/stdc_has_single_bit.3 +++ b/lib/libc/stdbit/stdc_has_single_bit.3 @@ -1,98 +1,98 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_HAS_SINGLE_BIT 3 .Os .Sh NAME .Nm stdc_has_single_bit .Nd check for single bit set .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft bool .Fn stdc_has_single_bit_uc "unsigned char value" .Ft bool .Fn stdc_has_single_bit_us "unsigned short value" .Ft bool .Fn stdc_has_single_bit_ui "unsigned int value" .Ft bool .Fn stdc_has_single_bit_ul "unsigned long value" .Ft bool .Fn stdc_has_single_bit_ull "unsigned long long value" .Ft bool .Fn stdc_has_single_bit "value" .Sh DESCRIPTION The .Nm stdc_has_single_bit_ Ns Em type Ns () family of functions checks if there is exactly one bit set in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_has_single_bit "value" type-generic macro picks the appropriate .Nm stdc_has_single_bit_ Ns Em type Ns () function based on the type of .Fa value . .Pp The functions in this family behave similarly to the .Fn powerof2 "value" macro of .In sys/param.h , but differ when .Fa value is zero: while .Fn powerof2 considers zero to be a power of two, .Fn stdc_has_single_bit does not. .Sh RETURN VALUES Returns .Sy true if exactly one bit is set in .Fa value , otherwise returns .Sy false . I.\^e. the function determines if .Fa value is a power of two. .Sh SEE ALSO .Xr stdbit 3 , .Xr stdc_count_ones 3 .Sh STANDARDS The .Nm stdc_has_single_bit_ Ns Em type Ns () family of functions and the .Fn stdc_has_single_bit type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_has_single_bit_ Ns Em type Ns () family of functions and the .Fn stdc_has_single_bit type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_leading_ones.3 b/lib/libc/stdbit/stdc_leading_ones.3 index 6cf7989b73ea..51a555292e3c 100644 --- a/lib/libc/stdbit/stdc_leading_ones.3 +++ b/lib/libc/stdbit/stdc_leading_ones.3 @@ -1,86 +1,86 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_LEADING_ONES 3 .Os .Sh NAME .Nm stdc_leading_ones .Nd find the number of leading ones in an integer .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_leading_ones_uc "unsigned char value" .Ft unsigned int .Fn stdc_leading_ones_us "unsigned short value" .Ft unsigned int .Fn stdc_leading_ones_ui "unsigned int value" .Ft unsigned int .Fn stdc_leading_ones_ul "unsigned long value" .Ft unsigned int .Fn stdc_leading_ones_ull "unsigned long long value" .Ft unsigned int .Fn stdc_leading_ones "value" .Sh DESCRIPTION The .Nm stdc_leading_ones_ Ns Em type Ns () family of functions returns the number of leading ones in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_leading_ones "value" type-generic macro picks the appropriate .Nm stdc_leading_ones_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns the number of leading ones in .Fa value . If .Fa value is all ones, the total number of bits in the type of .Fa value is returned. .Sh SEE ALSO .Xr stdbit 3 , .Xr stdc_leading_zeros 3 , .Xr stdc_trailing_ones 3 , .Xr stdc_first_leading_zero 3 .Sh STANDARDS The .Nm stdc_leading_ones_ Ns Em type Ns () family of functions and the .Fn stdc_leading_ones type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_leading_ones_ Ns Em type Ns () family of functions and the .Fn stdc_leading_ones type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_leading_zeros.3 b/lib/libc/stdbit/stdc_leading_zeros.3 index 7a7a203ac78c..89098c241db5 100644 --- a/lib/libc/stdbit/stdc_leading_zeros.3 +++ b/lib/libc/stdbit/stdc_leading_zeros.3 @@ -1,86 +1,86 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_LEADING_ZEROS 3 .Os .Sh NAME .Nm stdc_leading_zeros .Nd find the number of leading zeros in an integer .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_leading_zeros_uc "unsigned char value" .Ft unsigned int .Fn stdc_leading_zeros_us "unsigned short value" .Ft unsigned int .Fn stdc_leading_zeros_ui "unsigned int value" .Ft unsigned int .Fn stdc_leading_zeros_ul "unsigned long value" .Ft unsigned int .Fn stdc_leading_zeros_ull "unsigned long long value" .Ft unsigned int .Fn stdc_leading_zeros "value" .Sh DESCRIPTION The .Nm stdc_leading_zeros_ Ns Em type Ns () family of functions returns the number of leading zeros in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_leading_zeros "value" type-generic macro picks the appropriate .Nm stdc_leading_zeros_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns the number of leading zeros in .Fa value . If .Fa value is all zeros, the total number of bits in the type of .Fa value is returned. .Sh SEE ALSO .Xr stdbit 3 , .Xr stdc_leading_ones 3 , .Xr stdc_trailing_zeros 3 , .Xr stdc_first_leading_one 3 .Sh STANDARDS The .Nm stdc_leading_zeros_ Ns Em type Ns () family of functions and the .Fn stdc_leading_zeros type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_leading_zeros_ Ns Em type Ns () family of functions and the .Fn stdc_leading_zeros type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_trailing_ones.3 b/lib/libc/stdbit/stdc_trailing_ones.3 index 96277506fc17..d197f39d721c 100644 --- a/lib/libc/stdbit/stdc_trailing_ones.3 +++ b/lib/libc/stdbit/stdc_trailing_ones.3 @@ -1,86 +1,86 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_TRAILING_ONES 3 .Os .Sh NAME .Nm stdc_trailing_ones .Nd find the number of trailing ones in an integer .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_trailing_ones_uc "unsigned char value" .Ft unsigned int .Fn stdc_trailing_ones_us "unsigned short value" .Ft unsigned int .Fn stdc_trailing_ones_ui "unsigned int value" .Ft unsigned int .Fn stdc_trailing_ones_ul "unsigned long value" .Ft unsigned int .Fn stdc_trailing_ones_ull "unsigned long long value" .Ft unsigned int .Fn stdc_trailing_ones "value" .Sh DESCRIPTION The .Nm stdc_trailing_ones_ Ns Em type Ns () family of functions returns the number of trailing ones in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_trailing_ones "value" type-generic macro picks the appropriate .Nm stdc_trailing_ones_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns the number of trailing ones in .Fa value . If .Fa value is all ones, the total number of bits in the type of .Fa value is returned. .Sh SEE ALSO .Xr stdbit 3 , .Xr stdc_leading_ones 3 , .Xr stdc_trailing_zeros 3 , .Xr stdc_first_trailing_zero 3 .Sh STANDARDS The .Nm stdc_trailing_ones_ Ns Em type Ns () family of functions and the .Fn stdc_trailing_ones type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_trailing_ones_ Ns Em type Ns () family of functions and the .Fn stdc_trailing_ones type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libc/stdbit/stdc_trailing_zeros.3 b/lib/libc/stdbit/stdc_trailing_zeros.3 index 4bc675590ee7..9ebb2298eb44 100644 --- a/lib/libc/stdbit/stdc_trailing_zeros.3 +++ b/lib/libc/stdbit/stdc_trailing_zeros.3 @@ -1,87 +1,87 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDC_TRAILING_ZEROS 3 .Os .Sh NAME .Nm stdc_trailing_zeros .Nd find the number of trailing zeros in an integer .Sh SYNOPSIS .Lb libc .In stdbit.h .Ft unsigned int .Fn stdc_trailing_zeros_uc "unsigned char value" .Ft unsigned int .Fn stdc_trailing_zeros_us "unsigned short value" .Ft unsigned int .Fn stdc_trailing_zeros_ui "unsigned int value" .Ft unsigned int .Fn stdc_trailing_zeros_ul "unsigned long value" .Ft unsigned int .Fn stdc_trailing_zeros_ull "unsigned long long value" .Ft unsigned int .Fn stdc_trailing_zeros "value" .Sh DESCRIPTION The .Nm stdc_trailing_zeros_ Ns Em type Ns () family of functions returns the number of trailing zeros in .Fa value , where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. The .Fn stdc_trailing_zeros "value" type-generic macro picks the appropriate .Nm stdc_trailing_zeros_ Ns Em type Ns () function based on the type of .Fa value . .Sh RETURN VALUES Returns the number of trailing zeros in .Fa value . If .Fa value is all zeros, the total number of bits in the type of .Fa value is returned. .Sh SEE ALSO .Xr ffs 3 , .Xr stdbit 3 , .Xr stdc_leading_zeros 3 , .Xr stdc_trailing_ones 3 , .Xr stdc_first_trailing_one 3 .Sh STANDARDS The .Nm stdc_trailing_zeros_ Ns Em type Ns () family of functions and the .Fn stdc_trailing_zeros type-generic macro conform to .St -isoC-2023 . .Sh HISTORY The .Nm stdc_trailing_zeros_ Ns Em type Ns () family of functions and the .Fn stdc_trailing_zeros type-generic macro were added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/lib/libsys/lio_listio.2 b/lib/libsys/lio_listio.2 index bda65c38b1ac..94a5390ed83b 100644 --- a/lib/libsys/lio_listio.2 +++ b/lib/libsys/lio_listio.2 @@ -1,248 +1,249 @@ .\" Copyright (c) 2003 Tim J. Robbins .\" All rights reserved. .\" .\" 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. .\" .Dd January 13, 2024 .Dt LIO_LISTIO 2 .Os .Sh NAME .Nm lio_listio .Nd "list directed I/O (REALTIME)" .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In aio.h .Ft int .Fo lio_listio .Fa "int mode" .Fa "struct aiocb * const list[]" .Fa "int nent" .Fa "struct sigevent *sig" .Fc .Sh DESCRIPTION The .Fn lio_listio function initiates a list of I/O requests with a single function call. The .Fa list argument is an array of pointers to .Vt aiocb structures describing each operation to perform, with .Fa nent elements. .Dv NULL elements are ignored. .Pp The .Va aio_lio_opcode field of each .Vt aiocb specifies the operation to be performed. The following operations are supported: .Bl -tag -width ".Dv LIO_WRITE" .It Dv LIO_READ Read data as if by a call to .Xr aio_read 2 . .It Dv LIO_READV Read data as if by a call to .Xr aio_readv 2 . .It Dv LIO_NOP No operation. .It Dv LIO_WRITE Write data as if by a call to .Xr aio_write 2 . .It Dv LIO_WRITEV Write data as if by a call to .Xr aio_writev 2 . .El .Pp If the .Dv LIO_READ , .Dv LIO_READV , .Dv LIO_WRITE , .Dv LIO_WRITEV opcodes are or-ed with the .Dv LIO_FOFFSET flag, the corresponding read or write operation uses the current file descriptor offset instead of .Va aio_offset from .Vt aiocb . .Pp If the .Fa mode argument is .Dv LIO_WAIT , .Fn lio_listio does not return until all the requested operations have been completed. If .Fa mode is .Dv LIO_NOWAIT , .Fa sig can be used to request asynchronous notification when all operations have completed. If .Fa sig is .Dv NULL , no notification is sent. .Pp For .Dv SIGEV_KEVENT notifications, the posted kevent will contain: .Bl -column ".Va filter" .It Sy Member Ta Sy Value .It Va ident Ta Fa list .It Va filter Ta Dv EVFILT_LIO .It Va udata Ta value stored in .Fa sig->sigev_value .El .Pp For .Dv SIGEV_SIGNO and .Dv SIGEV_THREAD_ID notifications, the information for the queued signal will include .Dv SI_ASYNCIO in the .Va si_code field and the value stored in .Fa sig->sigev_value in the .Va si_value field. .Pp For .Dv SIGEV_THREAD notifications, the value stored in .Fa sig->sigev_value is passed to the .Fa sig->sigev_notify_function as described in .Xr sigevent 3 . .Pp The order in which the requests are carried out is not specified; in particular, there is no guarantee that they will be executed in the order 0, 1, ..., .Fa nent Ns \-1 . .Sh RETURN VALUES If .Fa mode is .Dv LIO_WAIT , the .Fn lio_listio function returns 0 if the operations completed successfully, otherwise \-1. .Pp If .Fa mode is .Dv LIO_NOWAIT , the .Fn lio_listio function returns 0 if the operations are successfully queued, otherwise \-1. .Sh ERRORS The .Fn lio_listio function will fail if: .Bl -tag -width Er .It Bq Er EAGAIN There are not enough resources to enqueue the requests. .It Bq Er EAGAIN The request would cause the system-wide limit .Dv {AIO_MAX} to be exceeded. .It Bq Er EINVAL The .Fa mode argument is neither .Dv LIO_WAIT nor .Dv LIO_NOWAIT , or .Fa nent is greater than .Dv {AIO_LISTIO_MAX} . .It Bq Er EINVAL The asynchronous notification method in .Fa sig->sigev_notify is invalid or not supported. .It Bq Er EINTR A signal interrupted the system call before it could be completed. .It Bq Er EIO One or more requests failed. .El .Pp In addition, the .Fn lio_listio function may fail for any of the reasons listed for .Xr aio_read 2 and .Xr aio_write 2 . .Pp If .Fn lio_listio succeeds, or fails with an error code of .Er EAGAIN , EINTR , or .Er EIO , some of the requests may have been initiated. The caller should check the error status of each .Vt aiocb structure individually by calling .Xr aio_error 2 . .Sh SEE ALSO .Xr aio_error 2 , .Xr aio_read 2 , .Xr aio_readv 2 , .Xr aio_write 2 , .Xr aio_writev 2 , .Xr read 2 , .Xr write 2 , .Xr sigevent 3 , .Xr siginfo 3 , .Xr aio 4 .Sh STANDARDS The .Fn lio_listio function is expected to conform to .St -p1003.1-2001 . The .Dv LIO_READV and .Dv LIO_WRITEV operations are -.Fx extensions, and should not be used in portable code. +.Fx +extensions, and should not be used in portable code. .Sh HISTORY The .Fn lio_listio system call first appeared in .Fx 3.0 . diff --git a/share/man/man3/stdbit.3 b/share/man/man3/stdbit.3 index bdee56cc8013..5c71b2650df6 100644 --- a/share/man/man3/stdbit.3 +++ b/share/man/man3/stdbit.3 @@ -1,120 +1,120 @@ .\" .\" Copyright (c) 2025 Robert Clausecker .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd November 9, 2025 .Dt STDBIT 3 .Os .Sh NAME .Nm stdbit .Nd bit and byte utilities .Sh SYNOPSIS .Lb libc .In stdbit.h .Fd #define __STDC_ENDIAN_LITTLE__ .Fd #define __STDC_ENDIAN_BIG__ .Fd #define __STDC_ENDIAN_NATIVE__ .Ft unsigned int .Fn stdc_count_leading_zeros "value" .Ft unsigned int .Fn stdc_count_leading_ones "value" .Ft unsigned int .Fn stdc_count_trailing_zeros "value" .Ft unsigned int .Fn stdc_count_trailing_ones "value" .Ft unsigned int .Fn stdc_first_leading_zero "value" .Ft unsigned int .Fn stdc_first_leading_one "value" .Ft unsigned int .Fn stdc_first_trailing_zero "value" .Ft unsigned int .Fn stdc_first_trailing_one "value" .Ft unsigned int .Fn stdc_count_zeros "value" .Ft unsigned int .Fn stdc_count_ones "value" .Ft bool .Fn stdc_has_single_bit "value" .Ft unsigned int .Fn stdc_bit_width "value" .Ft typeof Ns Pq Em value .Fn stdc_bit_floor "value" .Ft typeof Ns Pq Em value .Fn stdc_bit_ceil "value" .Sh DESCRIPTION The .Dv __STDC_ENDIAN_NATIVE__ macro describes the byte order or endianness of the machine for which the program is built. If the machine has big-endian byte order, this macro is equal to .Dv __STDC_ENDIAN_BIG__ . If the machine has little-endian byte order, this macro is equal to .Dv __STDC_ENDIAN_LITTLE__ . Otherwise, the macro has a value that is equal to neither. .Pp The bit and byte utility functions analyze the bits within a datum. Each function .Em func is provided in five variants .Nm stdc_ Ns Em func Ns Em _ Ns Em type Ns Pq Em value where .Fa value is of type .Va unsigned char , .Va unsigned short , .Va unsigned int , .Va unsigned long , or .Va unsigned long long for .Em type being .Sy uc , .Sy us , .Sy ui , .Sy ul , or .Sy ull respectively. Additionally, for each .Em func , a type-generic macro .Nm stdc_ Ns Em func Ns Pq Em value that picks the appropriate function .Nm stdc_ Ns Em func Ns Em _ Ns Em type Ns Pq Em value based on the type of .Fa value is provided. .Sh SEE ALSO .Xr arch 7 , .Xr bitstring 3 , .Xr ffs 3 , .Xr fls 3 , .Xr stdc_count_leading_zeros 3 , .Xr stdc_count_leading_ones 3 , .Xr stdc_count_trailing_zeros 3 , .Xr stdc_count_trailing_ones 3 , .Xr stdc_first_leading_zero 3 , .Xr stdc_first_leading_one 3 , .Xr stdc_first_trailing_zero 3 , .Xr stdc_first_trailing_one 3 , .Xr stdc_count_zeros 3 , .Xr stdc_count_ones 3 , .Xr stdc_has_single_bit 3 , .Xr stdc_bit_width 3 , .Xr stdc_bit_floor 3 , .Xr stdc_bit_ceil 3 .Sh STANDARDS The macros and functions of the .In stdbit.h header conform to .St -isoC-2023 . .Sh HISTORY The .In stdbit.h header and the macros and functions defined therein where added in -.Fx 15.1. -.Sh AUTHOR +.Fx 15.1 . +.Sh AUTHORS .An Robert Clausecker Aq Mt fuz@FreeBSD.org diff --git a/share/man/man4/bridge.4 b/share/man/man4/bridge.4 index 3af952256d3a..3d10b06c05b5 100644 --- a/share/man/man4/bridge.4 +++ b/share/man/man4/bridge.4 @@ -1,743 +1,743 @@ .\" .\" SPDX-License-Identifier: BSD-4-Clause .\" .\" $NetBSD: bridge.4,v 1.5 2004/01/31 20:14:11 jdc Exp $ .\" .\" Copyright 2001 Wasabi Systems, Inc. .\" All rights reserved. .\" .\" Written by Jason R. Thorpe for Wasabi Systems, Inc. .\" .\" 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. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed for the NetBSD Project by .\" Wasabi Systems, Inc. .\" 4. The name of Wasabi Systems, Inc. may not be used to endorse .\" or promote products derived from this software without specific prior .\" written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC .\" 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. .\" .Dd October 13, 2025 .Dt IF_BRIDGE 4 .Os .Sh NAME .Nm if_bridge .Nd network bridge device .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device if_bridge" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent if_bridge_load="YES" bridgestp_load="YES" .Ed .Sh DESCRIPTION The .Nm driver creates a logical link between two or more IEEE 802 networks that use the same (or .Dq "similar enough" ) framing format. For example, it is possible to bridge Ethernet and 802.11 networks together, but it is not possible to bridge Ethernet and Token Ring together. .Pp Each .Nm interface is created at runtime using interface cloning. This is most easily done with the .Xr ifconfig 8 .Cm create command or using the .Va cloned_interfaces variable in .Xr rc.conf 5 . .Pp When it is created, the .Nm interface gets assigned a link (MAC) address in the range of universally administered addresses reserved for the FreeBSD Foundation by hashing the host UUID, jail name, and the interface name. If this fails, a random, locally administered address is generated instead. This address is guaranteed to be unique .Em only across all .Nm interfaces on the local machine. Thus you can theoretically have two bridges on different machines with the same link addresses. The address can be changed by assigning the desired link address using .Xr ifconfig 8 . .Pp If .Xr sysctl 8 node .Va net.link.bridge.inherit_mac has a non-zero value, the newly created bridge will inherit the MAC address from its first member instead of choosing a random link-level address. This will provide more predictable bridge MAC addresses without any additional configuration, but currently this feature is known to break some L2 protocols, for example PPPoE that is provided by .Xr ng_pppoe 4 and .Xr ppp 8 . Currently this feature is considered as experimental and is turned off by default. .Pp A bridge can be used to provide several services, such as a simple 802.11-to-Ethernet bridge for wireless hosts, or traffic isolation. .Pp A bridge works like a switch, forwarding traffic from one interface to another. Multicast and broadcast packets are always forwarded to all interfaces that are part of the bridge. For unicast traffic, the bridge learns which MAC addresses are associated with which interfaces and will forward the traffic selectively. .Pp By default the bridge logs MAC address port flapping to .Xr syslog 3 . This behavior can be disabled by setting the .Xr sysctl 8 variable .Va net.link.bridge.log_mac_flap to .Li 0 . .Pp All the bridged member interfaces need to be up in order to pass network traffic. These can be enabled using .Xr ifconfig 8 or .Va ifconfig_ Ns Ao Ar interface Ac Ns Li ="up" in .Xr rc.conf 5 . .Pp The MTU of the first member interface to be added is used as the bridge MTU. All additional members will have their MTU changed to match. If the MTU of a bridge is changed after its creation, the MTU of all member interfaces is also changed to match. .Pp The TOE, TSO, TXCSUM and TXCSUM6 capabilities on all interfaces added to the bridge are disabled if any of the interfaces do not support/enable them. The LRO capability is always disabled. All the capabilities are restored when the interface is removed from the bridge. Changing capabilities at run-time may cause NIC reinit and a link flap. .Pp The bridge supports .Dq monitor mode , where the packets are discarded after .Xr bpf 4 processing, and are not processed or forwarded further. This can be used to multiplex the input of two or more interfaces into a single .Xr bpf 4 stream. This is useful for reconstructing the traffic for network taps that transmit the RX/TX signals out through two separate interfaces. .Pp To allow the host to communicate with bridge members, IP addresses should be assigned to the .Nm interface itself, not to the bridge's member interfaces. Attempting to assign an IP address to a bridge member interface, or add a member interface with an assigned IP address to a bridge, will return an .Dv EINVAL .Dq ( "Invalid argument" ) error. For compatibility with older releases where this was permitted, setting the .Xr sysctl 8 variable .Va net.link.bridge.member_ifaddrs to 1 will permit this configuration. This sysctl variable will be removed in -.Fx 16.0. +.Fx 16.0 . .Sh IPV6 SUPPORT .Nm supports the .Li AF_INET6 address family on bridge interfaces. The following .Xr rc.conf 5 variable configures an IPv6 link-local address on .Li bridge0 interface: .Bd -literal -offset indent ifconfig_bridge0_ipv6="inet6 auto_linklocal" .Ed .Pp However, the .Li AF_INET6 address family has a concept of scope zone. Bridging multiple interfaces changes the zone configuration because multiple links are merged to each other and form a new single link while the member interfaces still work individually. This means each member interface still has a separate link-local scope zone and the .Nm interface has another single, aggregated link-local scope zone at the same time. This situation is clearly against the description .Qq zones of the same scope cannot overlap in Section 5, RFC 4007. Although it works in most cases, it can cause some counterintuitive or undesirable behavior in some edge cases when both, the .Nm interface and one of the member interfaces, have an IPv6 address and applications use both of them. .Pp To prevent this situation, .Nm checks whether a link-local scoped IPv6 address is configured on a member interface to be added and the .Nm interface. When the .Nm interface has IPv6 addresses, IPv6 addresses on the member interface will be automatically removed before the interface is added. .Pp This behavior can be disabled by setting .Xr sysctl 8 variable .Va net.link.bridge.allow_llz_overlap to .Li 1 . .Pp Note that .Li ACCEPT_RTADV and .Li AUTO_LINKLOCAL interface flags are not enabled by default on .Nm interfaces even when .Va net.inet6.ip6.accept_rtadv and/or .Va net.inet6.ip6.auto_linklocal is set to .Li 1 . .Sh SPANNING TREE The .Nm driver implements the Rapid Spanning Tree Protocol (RSTP or 802.1w) with backwards compatibility with the legacy Spanning Tree Protocol (STP). Spanning Tree is used to detect and remove loops in a network topology. .Pp RSTP provides faster spanning tree convergence than legacy STP, the protocol will exchange information with neighbouring switches to quickly transition to forwarding without creating loops. .Pp The code will default to RSTP mode but will downgrade any port connected to a legacy STP network so is fully backward compatible. A bridge can be forced to operate in STP mode without rapid state transitions via the .Va proto command in .Xr ifconfig 8 . .Pp The bridge can log STP port changes to .Xr syslog 3 by setting the .Va net.link.bridge.log_stp node using .Xr sysctl 8 . .Sh VLAN SUPPORT Virtual LANs (VLANs), defined in the IEEE 802.1Q standard, allow traffic on a bridge to be segregated into separate logical networks which cannot communicate with each other. For example, two interfaces in VLAN 10 would be able to communicate with each other, but not with another interface in VLAN 20. .Pp Each VLAN is identified by a number between 1 and 4094 inclusive. By default, all traffic on the bridge is assigned to "VLAN 0", a pseudo-VLAN used for historical compatibility. When VLANs are in use on a bridge, it is recommended to explicitly assign all traffic to a VLAN rather than using VLAN 0. .Pp The bridge implements Independent VLAN Learning (IVL), meaning that host addresses are learned separately for each VLAN, and the same host address may exist on several different ports in different VLANs. .Pp If a .Xr vlan 4 interface is configured on an interface which is also an .Nm member interface, all tagged frames will be processed by the .Xr vlan 4 interface and will not be visible to the bridge. This configuration is not recommended and may be unsupported in a future release. .Ss Tagged and untagged traffic Incoming frames on a member interface may be either tagged or untagged. Tagged frames contain an 802.1Q header indicating which VLAN the frame belongs to, while untagged frames do not. When a tagged frame is received, the frame is automatically assigned to the VLAN in the tag (subject to any configured VLAN access list), while untagged frames are assigned to the interface's configured Port VLAN ID (PVID), or to VLAN 0 if no PVID is configured. .Ss Assigning interfaces to VLANs An interface's PVID may be configured using the .Xr ifconfig 8 .Cm ifuntagged command: .Bd -literal -offset indent ifconfig bridge0 ifuntagged ix0 10 .Ed .Pp Or by using the .Cm untagged option to .Cm addm : .Bd -literal -offset indent ifconfig bridge0 addm ix0 untagged 10 .Ed .Pp This will assign all untagged traffic received on the interface to the specified VLAN, and any traffic transmitted on the interface in this VLAN will have its VLAN tag (if present) removed. Conversely, any traffic transmitted on the interface in a different VLAN will have a tag added, to allow the remote system to assign the traffic to the appropriate VLAN. .Ss Host communication in a VLAN Sometimes it is useful to allow the host itself to communicate in a VLAN, for example to provide routing to other hosts in the VLAN. To do this, create a .Xr vlan 4 interface on top of the .Nm interface with the appropriate VLAN tag. For example, to allow the host to communicate in VLAN 10: .Bd -literal -offset indent ifconfig bridge0.10 create inet6 2001:db8::1/64 .Ed .Ss Configuring the VLAN access list (VLAN filtering) For historical reasons, the default .Nm configuration allows all interfaces to send tagged traffic for any VLAN, meaning that VLANs do not provide security separation. To restrict which interfaces may communicate in which VLANs, enable VLAN filtering on the bridge: .Bd -literal -offset indent ifconfig bridge0 vlanfilter .Ed .Pp This has the following effects on bridge members: .Bl -bullet -offset indent .It No untagged frames will be accepted from a member interface unless the interface has a PVID configured. .It No tagged frames will be accepted from a member interface unless the VLAN identifier is present in the interface's VLAN access list. .It Frames with stacked tags (Q-in-Q) will not be accepted from a member interface unless the .Cm qinq option (see below) has been configured for that member. .El .Pp To configure the VLAN access list, use the .Xr ifconfig 8 .Cm iftagged , .Cm +iftagged or .Cm -iftagged commands. For example, to allow an interface to communicate in VLANs 10, 20, and any VLAN from 100 to 199: .Bd -literal -offset indent ifconfig bridge0 iftagged ix0 10,20,100-199 .Ed .Ss IEEE 802.1ad (Q-in-Q) configuration IEEE 802.1ad, also called Q-in-Q or .Dq tag stacking , allows a single Ethernet frame to contain multiple tags. This allows one Ethernet network to transport traffic between endpoints using its own VLAN tags without interfering with any pre-existing tags, and is often used in service provider networks to provide .Dq virtual wire Ethernet services. .Pp When VLAN filtering is enabled, .Nm does not permit member interfaces to send Q-in-Q frames, because in certain configuration this allows .Dq VLAN-hopping attacks on the bridge. For example, consider a bridge with port ix0 configured as a tagged port in VLAN 10, and port ix1 configured as untagged in VLAN 10 and tagged in VLAN 20. If ix0 is allowed to send Q-in-Q frames, then it can send a frame with two tags: one for VLAN 10, followed by one for VLAN 20. When the bridge forwards the frame to ix1, it will strip the VLAN tag for VLAN 10, then forward the frame to ix1 with the tag for VLAN 20 intact, effectively allowing ix1 to send traffic on VLAN 20 even though the bridge configuration should not permit that. .Pp To permit an interface to send Q-in-Q frames, set the .Xr ifconfig 8 .Cm qinq flag on the interface. This is only required on the interface which will send Q-in-Q frames, not the interface receiving the frames. .Pp Alternatively, set the .Cm defqinq flag on the bridge itself to enable Q-in-Q for all newly-added interfaces by default. .Sh PACKET FILTERING Packet filtering can be used with any firewall package that hooks in via the .Xr pfil 9 framework. When filtering is enabled, bridged packets will pass through the filter inbound on the originating interface, on the bridge interface and outbound on the appropriate interfaces. Either stage can be disabled. The filtering behavior can be controlled using .Xr sysctl 8 : .Bl -tag -width indent .It Va net.link.bridge.pfil_onlyip Controls the handling of non-IP packets which are not passed to .Xr pfil 9 . Set to .Li 1 to only allow IP packets to pass (subject to firewall rules), set to .Li 0 to unconditionally pass all non-IP Ethernet frames. .It Va net.link.bridge.pfil_member Set to .Li 1 to enable filtering on the incoming and outgoing member interfaces, set to .Li 0 to disable it. .It Va net.link.bridge.pfil_bridge Set to .Li 1 to enable filtering on the bridge interface, set to .Li 0 to disable it. .It Va net.link.bridge.pfil_local_phys Set to .Li 1 to additionally filter on the physical interface for locally destined packets. Set to .Li 0 to disable this feature. .It Va net.link.bridge.ipfw Set to .Li 1 to enable layer2 filtering with .Xr ipfirewall 4 , set to .Li 0 to disable it. This needs to be enabled for .Xr dummynet 4 support. When .Va ipfw is enabled, .Va pfil_bridge and .Va pfil_member will be disabled so that IPFW is not run twice; these can be re-enabled if desired. .It Va net.link.bridge.ipfw_arp Set to .Li 1 to enable layer2 ARP filtering with .Xr ipfirewall 4 , set to .Li 0 to disable it. Requires .Va ipfw to be enabled. .El .Pp ARP and REVARP packets are forwarded without being filtered and others that are not IP nor IPv6 packets are not forwarded when .Va pfil_onlyip is enabled. IPFW can filter Ethernet types using .Cm mac-type so all packets are passed to the filter for processing. .Pp The packets originating from the bridging host will be seen by the filter on the interface that is looked up in the routing table. .Pp The packets destined to the bridging host will be seen by the filter on the interface with the MAC address equal to the packet's destination MAC. There are situations when some of the bridge members are sharing the same MAC address (for example the .Xr vlan 4 interfaces: they are currently sharing the MAC address of the parent physical interface). It is not possible to distinguish between these interfaces using their MAC address, excluding the case when the packet's destination MAC address is equal to the MAC address of the interface on which the packet was entered to the system. In this case the filter will see the incoming packet on this interface. In all other cases the interface seen by the packet filter is chosen from the list of bridge members with the same MAC address and the result strongly depends on the member addition sequence and the actual implementation of .Nm . It is not recommended to rely on the order chosen by the current .Nm implementation since it may change in the future. .Pp The previous paragraph is best illustrated with the following pictures. Let .Bl -bullet .It the MAC address of the incoming packet's destination is .Nm nn:nn:nn:nn:nn:nn , .It the interface on which packet entered the system is .Nm ifX , .It .Nm ifX MAC address is .Nm xx:xx:xx:xx:xx:xx , .It there are possibly other bridge members with the same MAC address .Nm xx:xx:xx:xx:xx:xx , .It the bridge has more than one interface that are sharing the same MAC address .Nm yy:yy:yy:yy:yy:yy ; we will call them .Nm vlanY1 , .Nm vlanY2 , etc. .El .Pp If the MAC address .Nm nn:nn:nn:nn:nn:nn is equal to .Nm xx:xx:xx:xx:xx:xx the filter will see the packet on interface .Nm ifX no matter if there are any other bridge members carrying the same MAC address. But if the MAC address .Nm nn:nn:nn:nn:nn:nn is equal to .Nm yy:yy:yy:yy:yy:yy then the interface that will be seen by the filter is one of the .Nm vlanYn . It is not possible to predict the name of the actual interface without the knowledge of the system state and the .Nm implementation details. .Pp This problem arises for any bridge members that are sharing the same MAC address, not only to the .Xr vlan 4 ones: they were taken just as an example of such a situation. So if one wants to filter the locally destined packets based on their interface name, one should be aware of this implication. The described situation will appear at least on the filtering bridges that are doing IP-forwarding; in some of such cases it is better to assign the IP address only to the .Nm interface and not to the bridge members. Enabling .Va net.link.bridge.pfil_local_phys will let you do the additional filtering on the physical interface. .Sh NETMAP .Xr netmap 4 applications may open a bridge interface in emulated mode. The netmap application will receive all packets which arrive from member interfaces. In particular, packets which would otherwise be forwarded to another member interface will be received by the netmap application. .Pp When the .Xr netmap 4 application transmits a packet to the host stack via the bridge interface, .Nm receive it and attempts to determine its .Ql source interface by looking up the source MAC address in the interface's learning tables. Packets for which no matching source interface is found are dropped and the input error counter is incremented. If a matching source interface is found, .Nm treats the packet as though it was received from the corresponding interface and handles it normally without passing the packet back to .Xr netmap 4 . .Sh EXAMPLES The following when placed in the file .Pa /etc/rc.conf will cause a bridge called .Dq Li bridge0 to be created, and will add the interfaces .Dq Li wlan0 and .Dq Li fxp0 to the bridge, and then enable packet forwarding. Such a configuration could be used to implement a simple 802.11-to-Ethernet bridge (assuming the 802.11 interface is in ad-hoc mode). .Bd -literal -offset indent cloned_interfaces="bridge0" ifconfig_bridge0="addm wlan0 addm fxp0 up" .Ed .Pp For the bridge to forward packets, all member interfaces and the bridge need to be up. The above example would also require: .Bd -literal -offset indent create_args_wlan0="wlanmode hostap" ifconfig_wlan0="up ssid my_ap mode 11g" ifconfig_fxp0="up" .Ed .Pp The following will cause a bridge to be created with two VLANs, 10 and 20, where the .Dq Li em interfaces can only communicate in their assigned VLANs, while .Dq Li ix0 is a trunk port which can communicate in either VLAN: .Bd -literal -offset indent cloned_interfaces="bridge0" ifconfig_bridge0="vlanfilter \e addm em0 untagged 10 \e addm em1 untagged 10 \e addm em2 untagged 20 \e addm em3 untagged 20 \e addm ix0 tagged 10,20" ifconfig_em0="up" ifconfig_em1="up" ifconfig_em2="up" ifconfig_em3="up" ifconfig_ix0="up" .Ed .Pp The previous example could be extended to allow the host to communicate in VLANs 10 and 20: .Bd -literal -offset indent vlans_bridge0="10 20" ifconfig_bridge0_10_ipv6="inet6 2001:db8:0:10::1/64" ifconfig_bridge0_20_ipv6="inet6 2001:db8:0:20::1/64" .Ed .Pp Consider a system with two 4-port Ethernet boards. The following will cause a bridge consisting of all 8 ports with Rapid Spanning Tree enabled to be created: .Bd -literal -offset indent ifconfig bridge0 create ifconfig bridge0 \e addm fxp0 stp fxp0 \e addm fxp1 stp fxp1 \e addm fxp2 stp fxp2 \e addm fxp3 stp fxp3 \e addm fxp4 stp fxp4 \e addm fxp5 stp fxp5 \e addm fxp6 stp fxp6 \e addm fxp7 stp fxp7 \e up .Ed .Pp The bridge can be used as a regular host interface at the same time as bridging between its member ports. In this example, the bridge connects em0 and em1, and will receive its IP address through DHCP: .Bd -literal -offset indent cloned_interfaces="bridge0" ifconfig_bridge0="addm em0 addm em1 DHCP" ifconfig_em0="up" ifconfig_em1="up" .Ed .Pp The bridge can tunnel Ethernet across an IP internet using the EtherIP protocol. This can be combined with .Xr ipsec 4 to provide an encrypted connection. Create a .Xr gif 4 interface and set the local and remote IP addresses for the tunnel, these are reversed on the remote bridge. .Bd -literal -offset indent ifconfig gif0 create ifconfig gif0 tunnel 1.2.3.4 5.6.7.8 up ifconfig bridge0 create ifconfig bridge0 addm fxp0 addm gif0 up .Ed .Sh SEE ALSO .Xr gif 4 , .Xr ipf 4 , .Xr ipfw 4 , .Xr netmap 4 , .Xr pf 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY The .Nm driver first appeared in .Fx 6.0 . .Sh AUTHORS .An -nosplit The .Nm bridge driver was originally written by .An Jason L. Wright Aq Mt jason@thought.net as part of an undergraduate independent study at the University of North Carolina at Greensboro. .Pp This version of the .Nm driver has been heavily modified from the original version by .An Jason R. Thorpe Aq Mt thorpej@wasabisystems.com . .Pp Rapid Spanning Tree Protocol (RSTP) support was added by .An Andrew Thompson Aq Mt thompsa@FreeBSD.org . .Sh BUGS The .Nm driver currently supports only Ethernet and Ethernet-like (e.g., 802.11) network devices, which can be configured with the same MTU size as the bridge device. diff --git a/share/man/man4/bxe.4 b/share/man/man4/bxe.4 index c82565e19583..c80617ac20ea 100644 --- a/share/man/man4/bxe.4 +++ b/share/man/man4/bxe.4 @@ -1,342 +1,343 @@ .\" Copyright (c) 2014 Qlogic Corporation. All rights reserved. .\" .\" 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. .\" .Dd April 29, 2012 .Dt BXE 4 .Os .Sh NAME .Nm bxe .Nd QLogic NetXtreme II Ethernet 10Gb PCIe adapter driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device bxe" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent if_bxe_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for PCIe 10Gb Ethernet adapters based on the QLogic NetXtreme II family of 10Gb chips. The driver supports Jumbo Frames, VLAN tagging, checksum offload (IPv4, TCP, UDP, IPv6-TCP, IPv6-UDP), MSI-X interrupts, TCP Segmentation Offload (TSO), Large Receive Offload (LRO), and Receive Side Scaling (RSS). .Sh HARDWARE The .Nm driver provides support for various NICs based on the QLogic NetXtreme II family of 10Gb Ethernet controller chips, including the following: .Pp .Bl -bullet -compact .It QLogic NetXtreme II BCM57710 10Gb .It QLogic NetXtreme II BCM57711 10Gb .It QLogic NetXtreme II BCM57711E 10Gb .It QLogic NetXtreme II BCM57712 10Gb .It QLogic NetXtreme II BCM57712-MF 10Gb .It QLogic NetXtreme II BCM57800 10Gb .It QLogic NetXtreme II BCM57800-MF 10Gb .It QLogic NetXtreme II BCM57810 10Gb .It QLogic NetXtreme II BCM57810-MF 10Gb .It QLogic NetXtreme II BCM57840 10Gb / 20Gb .It QLogic NetXtreme II BCM57840-MF 10Gb .El .Sh CONFIGURATION There a number of configuration parameters that can be set to tweak the driver's behavior. These parameters can be set via the .Xr loader.conf 5 file to take effect during the next system boot. The following parameters affect ALL instances of the driver. .Bl -tag -width indent .It Va hw.bxe.debug DEFAULT = 0 .br Sets the default logging level of the driver. See the Diagnostics and Debugging section below for more details. .It Va hw.bxe.interrupt_mode DEFAULT = 2 .br Sets the default interrupt mode: 0=IRQ, 1=MSI, 2=MSIX. If set to MSIX and allocation fails, the driver will roll back and attempt MSI allocation. If MSI allocation fails, the driver will roll back and attempt fixed level IRQ allocation. If IRQ allocation fails, then the driver load fails. With MSI/MSIX, the driver attempts to allocate a vector for each queue in addition to one more for default processing. .It Va hw.bxe.queue_count DEFAULT = 4 .br Sets the default number of fast path packet processing queues. Note that one MSI/MSIX interrupt vector is allocated per-queue. .It Va hw.bxe.max_rx_bufs DEFAULT = 0 .br Sets the maximum number of receive buffers to allocate per-queue. Zero(0) means to allocate a receive buffer for every buffer descriptor. By default this equates to 4080 buffers per-queue which is the maximum value for this config parameter. .It Va hw.bxe.hc_rx_ticks DEFAULT = 25 .br Sets the number of ticks for host interrupt coalescing in the receive path. .It Va hw.bxe.hc_tx_ticks DEFAULT = 50 .br Sets the number of ticks for host interrupt coalescing in the transmit path. .It Va hw.bxe.rx_budget DEFAULT = 0xffffffff .br Sets the maximum number of receive packets to process in an interrupt. If the budget is reached then the remaining/pending packets will be processed in a scheduled taskqueue. .It Va hw.bxe.max_aggregation_size DEFAULT = 32768 .br Sets the maximum LRO aggregation byte size. The higher the value the more packets the hardware will aggregate. Maximum is 65K. .It Va hw.bxe.mrrs DEFAULT = -1 .br Sets the PCI MRRS: -1=Auto, 0=128B, 1=256B, 2=512B, 3=1KB .It Va hw.bxe.autogreeen DEFAULT = 0 .br Set AutoGrEEEN: 0=HW_DEFAULT, 1=FORCE_ON, 2=FORCE_OFF .It Va hw.bxe.udp_rss DEFAULT = 0 .br Enable/Disable 4-tuple RSS for UDP: 0=DISABLED, 1=ENABLED .El .Pp Special care must be taken when modifying the number of queues and receive buffers. -.Fx imposes a limit on the maximum number of +.Fx +imposes a limit on the maximum number of .Xr mbuf 9 allocations. If buffer allocations fail, the interface initialization will fail and the interface will not be usable. The driver does not make a best effort for buffer allocations. It is an all or nothing effort. .Pp You can tweak the .Xr mbuf 9 allocation limit using .Xr sysctl 8 and view the current usage with .Xr netstat 1 as follows: .Bd -literal -offset indent # netstat -m # sysctl kern.ipc.nmbclusters # sysctl kern.ipc.nmbclusters=<#> .Ed .Pp There are additional configuration parameters that can be set on a per-instance basis to dynamically override the default configuration. The '#' below must be replaced with the driver instance / interface unit number: .Bl -tag -width indent .It Va dev.bxe.#.debug DEFAULT = 0 .br Sets the default logging level of the driver instance. See .Va hw.bxe.debug above and the Diagnostics and Debugging section below for more details. .It Va dev.bxe.#.rx_budget DEFAULT = 0xffffffff .br Sets the maximum number of receive packets to process in an interrupt for the driver instance. See .Va hw.bxe.rx_budget above for more details. .El .Pp Additional items can be configured using .Xr ifconfig 8 : .Bl -tag -width indent .It Va MTU - Maximum Transmission Unit DEFAULT = 1500 .br RANGE = 46-9184 .br # ifconfig bxe# mtu .It Va Promiscuous Mode DEFAULT = OFF .br # ifconfig bxe# [ promisc | -promisc ] .It Va Rx/Tx Checksum Offload DEFAULT = RX/TX CSUM ON .br Note that the Rx and Tx settings are not independent. .br # ifconfig bxe# [ rxcsum | -rxcsum | txcsum | -txcsum ] .It Va TSO - TCP Segmentation Offload DEFAULT = ON .br # ifconfig bxe# [ tso | -tso | tso6 | -tso6 ] .It Va LRO - TCP Large Receive Offload DEFAULT = ON .br # ifconfig bxe# [ lro | -lro ] .El .Sh DIAGNOSTICS AND DEBUGGING There are many statistics exposed by .Nm via .Xr sysctl 8 . .Pp To dump the default driver configuration: .Bd -literal -offset indent # sysctl -a | grep hw.bxe .Ed .Pp To dump every instance's configuration and detailed statistics: .Bd -literal -offset indent # sysctl -a | grep dev.bxe .Ed .Pp To dump information for a single instance (replace the '#' with the driver instance / interface unit number): .Bd -literal -offset indent # sysctl -a | grep dev.bxe.# .Ed .Pp To dump information for all the queues of a single instance: .Bd -literal -offset indent # sysctl -a | grep dev.bxe.#.queue .Ed .Pp To dump information for a single queue of a single instance (replace the additional '#' with the queue number): .Bd -literal -offset indent # sysctl -a | grep dev.bxe.#.queue.# .Ed .Pp The .Nm driver has the ability to dump a ton of debug messages to the system log. The default level of logging can be set with the .Va hw.bxe.debug .Xr sysctl 8 . Take care with this setting as it can result in too many logs being dumped. Since this parameter is the default one, it affects every instance and will dramatically change the timing in the driver. A better alternative to aid in debugging is to dynamically change the debug level of a specific instance with the .Va dev.bxe.#.debug .Xr sysctl 8 . This allows you to turn on/off logging of various debug groups on-the-fly. .Pp The different debug groups that can be toggled are: .Bd -literal -offset indent DBG_LOAD 0x00000001 /* load and unload */ DBG_INTR 0x00000002 /* interrupt handling */ DBG_SP 0x00000004 /* slowpath handling */ DBG_STATS 0x00000008 /* stats updates */ DBG_TX 0x00000010 /* packet transmit */ DBG_RX 0x00000020 /* packet receive */ DBG_PHY 0x00000040 /* phy/link handling */ DBG_IOCTL 0x00000080 /* ioctl handling */ DBG_MBUF 0x00000100 /* dumping mbuf info */ DBG_REGS 0x00000200 /* register access */ DBG_LRO 0x00000400 /* lro processing */ DBG_ASSERT 0x80000000 /* debug assert */ DBG_ALL 0xFFFFFFFF /* flying monkeys */ .Ed .Pp For example, to debug an issue in the receive path on bxe0: .Bd -literal -offset indent # sysctl dev.bxe.0.debug=0x22 .Ed .Pp When finished turn the logging back off: .Bd -literal -offset indent # sysctl dev.bxe.0.debug=0 .Ed .Sh SUPPORT For support questions please contact your QLogic approved reseller or QLogic Technical Support at .Pa http://support.qlogic.com , or by E-mail at .Aq Mt support@qlogic.com . .Sh SEE ALSO .Xr netstat 1 , .Xr altq 4 , .Xr arp 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY The .Nm device driver first appeared in .Fx 9.0 . .Sh AUTHORS The .Nm driver was written by .An Eric Davis Aq Mt edavis@broadcom.com , .An David Christensen Aq Mt davidch@broadcom.com , and .An Gary Zambrano Aq Mt zambrano@broadcom.com . diff --git a/share/man/man4/inet.4 b/share/man/man4/inet.4 index 08ca67a7edad..bec94173aba4 100644 --- a/share/man/man4/inet.4 +++ b/share/man/man4/inet.4 @@ -1,366 +1,367 @@ .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" 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. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .Dd December 31, 2024 .Dt INET 4 .Os .Sh NAME .Nm inet .Nd Internet protocol family .Sh SYNOPSIS .In sys/types.h .In netinet/in.h .Sh DESCRIPTION The Internet protocol family is a collection of protocols layered atop the .Em Internet Protocol .Pq Tn IP transport layer, and utilizing the Internet address format. The Internet family provides protocol support for the .Dv SOCK_STREAM , SOCK_DGRAM , and .Dv SOCK_RAW socket types; the .Dv SOCK_RAW interface provides access to the .Tn IP protocol. .Sh ADDRESSING Internet addresses are four byte quantities, stored in network standard format (on little endian machines, such as the .Tn alpha , .Tn amd64 and .Tn i386 these are word and byte reversed). The include file .In netinet/in.h defines this address as a discriminated union. .Pp Sockets bound to the Internet protocol family utilize the following addressing structure, .Bd -literal -offset indent struct sockaddr_in { uint8_t sin_len; sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; char sin_zero[8]; }; .Ed .Pp Sockets may be created with the local address .Dv INADDR_ANY to affect .Dq wildcard matching on incoming messages. The address in a .Xr connect 2 or .Xr sendto 2 call may be given as .Dv INADDR_ANY to mean .Dq this host . The distinguished address .Dv INADDR_BROADCAST is allowed as a shorthand for the broadcast address on the primary network if the first network configured supports broadcast. .Sh PROTOCOLS The Internet protocol family is comprised of the .Tn IP network protocol, Internet Control Message Protocol .Pq Tn ICMP , Internet Group Management Protocol .Pq Tn IGMP , Transmission Control Protocol .Pq Tn TCP , and User Datagram Protocol .Pq Tn UDP . .Tn TCP is used to support the .Dv SOCK_STREAM abstraction while .Tn UDP is used to support the .Dv SOCK_DGRAM abstraction. A raw interface to .Tn IP is available by creating an Internet socket of type .Dv SOCK_RAW . The .Tn ICMP message protocol is accessible from a raw socket. .Pp The .Nm address on an interface consist of the address itself, the netmask, either broadcast address in case of a broadcast interface or peers address in case of point-to-point interface. The following .Xr ioctl 2 commands are provided for a datagram socket in the Internet domain: .Pp .Bl -tag -width ".Dv SIOCGIFBRDADDR" -offset indent -compact .It Dv SIOCAIFADDR Add address to an interface. The command requires .Ft struct in_aliasreq as argument. .It Dv SIOCDIFADDR Delete address from an interface. The command requires .Ft struct ifreq as argument. .It Dv SIOCGIFADDR .It Dv SIOCGIFBRDADDR .It Dv SIOCGIFDSTADDR .It Dv SIOCGIFNETMASK Return address information from interface. The returned value is in .Ft struct ifreq . This way of address information retrieval is obsoleted, a preferred way is to use .Xr getifaddrs 3 API. .El .Ss MIB (sysctl) Variables In addition to the variables supported by the transport protocols in .Va net.inet (for which the respective manual pages may be consulted), there are a number of general variables implemented in the .Va net.inet.ip branch of the .Xr sysctl 3 MIB, which can be also read or modified with .Xr sysctl 8 . The following general variables are defined: .Bl -tag -width ".Va accept_sourceroute" .It Va accept_sourceroute Boolean: enable/disable accepting of source-routed IP packets (default false). .It Va allow_net0 Boolean: allow forwarding of, and ICMP responses to, packets with addresses in 0.0.0.0/8. .It Va allow_net240 Boolean: allow forwarding of, and ICMP responses to, packets with addresses in 240.0.0.0/4. .It Va curfrags Integer: Current number of IPv4 fragments across all reassembly queues in all VNETs (read-only). .It Va forwarding Boolean: enable/disable forwarding of IP packets. Defaults to off. .It Va fragpackets Integer: Current number of IPv4 fragment reassembly queue entries for the VNET (read-only). .It Va fragttl Integer: time to live for IPv4 packet fragments in the per-VNET reassemby queue. .It Va loopback_prefixlen Integer: prefix length of the address space reserved for loopback purposes. The default is 8, meaning that 127.0.0.0/8 is reserved for loopback, and cannot be sent, received, or forwarded on a non-loopback interface. Use of other values is experimental. .It Va maxfragbucketsize Integer: maximum number of reassembly queues per bucket. Fragmented packets are hashed to buckets. Each bucket has a list of reassembly queues. The system must compare the incoming packets to the existing reassembly queues in the bucket to find a matching reassembly queue. To preserve system resources, the system limits the number of reassembly queues allowed in each bucket. This limit is recalculated when the number of mbuf clusters is changed or when the value of .Va maxfragpackets changes. This is a per-VNET limit. .It Va maxfragpackets Integer: maximum number of fragmented packets the host will accept and simultaneously hold in the reassembly queue for a particular VNET. 0 means that the host will not accept any fragmented packets for that VNET. \-1 means that the host will not apply this limit for that VNET. This limit is recalculated when the number of mbuf clusters is changed. This is a per-VNET limit. .It Va maxfrags Integer: maximum number of fragments the host will accept and simultaneously hold across all reassembly queues in all VNETs. If set to 0, reassembly is disabled. If set to -1, this limit is not applied. This limit is recalculated when the number of mbuf clusters is changed. This is a global limit. .It Va maxfragsperpacket Integer: maximum number of fragments the host will accept and hold in the reassembly queue for a packet. 0 means that the host will not accept any fragmented packets for the VNET. This is a per-VNET limit. .It Va mcast Variables under the .Va net.inet.ip.mcast node are documented in .Xr ip 4 . .It Va no_same_prefix Boolean: Refuse to create same prefixes on different interfaces. This is a per-VNET value. .It Va portrange Variables under the .Va net.inet.ip.portrange node control port ranges used by transport protocols; see .Xr ip 4 for details. .It Va process_options Integer: control IP options processing. By setting this variable to 0, all IP options in the incoming packets will be ignored, and the packets will be passed unmodified. By setting to 1, IP options in the incoming packets will be processed accordingly. By setting to 2, an .Tn ICMP .Dq "prohibited by filter" message will be sent back in response to incoming packets with IP options. Default is 1. This .Xr sysctl 8 variable affects packets destined for a local host as well as packets forwarded to some other host. .It Va random_id Boolean: control IP IDs generation behavior. Setting this .Xr sysctl 8 to 1 causes the ID field in .Em non-atomic IP datagrams (or all IP datagrams, if .Va rfc6864 is disabled) to be randomized instead of incremented by 1 with each packet generated. This closes a minor information leak which allows remote observers to determine the rate of packet generation on the machine by watching the counter. At the same time, on high-speed links, it can decrease the ID reuse cycle greatly. Default is 0 (sequential IP IDs). IPv6 flow IDs and fragment IDs are always random. .It Va random_id_collisions Integer: count of IP ID collisions (read-only, per-VNET). .It Va random_id_period Integer: size of the IP ID array, which is the number of previous packets for which the IDs are recorded. The number must be between 512 and 32768 inclusive. This is a per-VNET value. .It Va random_id_total Integer: count of IP IDs created (read-only, per-VNET). .It Va reass_hashsize Number of hash slots in the IPv4 reassembly queue (loader tunable). .It Va redirect Boolean: enable/disable sending of ICMP redirects in response to .Tn IP packets for which a better, and for the sender directly reachable, route and next hop is known. Defaults to on. .It Va rfc1122_strong_es Boolean: in non-forwarding mode .Pq forwarding is disabled partially implement the Strong End System model per RFC1122. If a packet with destination address that is local arrives on a different interface than the interface the address belongs to, the packet would be silently dropped. Enabling this option may break certain setups, e.g. having an alias address(es) on loopback that are expected to be reachable by outside traffic. Enabling some other network features, e.g. .Xr carp 4 or destination address rewriting .Xr pfil 4 filters may override and bypass this check. Disabled by default. .It Va rfc6864 Boolean: control IP IDs generation behaviour. True value enables RFC6864 support, which specifies that IP ID field of .Em atomic datagrams can be set to any value. The -.Fx implementation sets it to zero. +.Fx +implementation sets it to zero. Enabled by default. .It Va source_address_validation Boolean: perform source address validation for packets destined for the local host. Consider this as following Section 3.2 of RFC3704/BCP84, where we treat local host as our own infrastructure. Forwarded packets are unaffected by this and it should not be considered an anti-spoof feature for a router. Enabled by default. .It Va sourceroute Boolean: enable/disable forwarding of source-routed IP packets (default false). .It Va ttl Integer: default time-to-live .Pq Dq TTL to use for outgoing .Tn IP packets. .El .Sh SEE ALSO .Xr ioctl 2 , .Xr socket 2 , .Xr getifaddrs 3 , .Xr sysctl 3 , .Xr icmp 4 , .Xr intro 4 , .Xr ip 4 , .Xr ipfirewall 4 , .Xr route 4 , .Xr tcp 4 , .Xr udp 4 , .Xr sysctl 8 , .Xr pfil 9 .Rs .%T "An Introductory 4.3 BSD Interprocess Communication Tutorial" .%B PS1 .%N 7 .Re .Rs .%T "An Advanced 4.3 BSD Interprocess Communication Tutorial" .%B PS1 .%N 8 .Re .Sh HISTORY The .Nm protocol interface appeared in .Bx 4.2 . The .Dq protocol cloning code appeared in .Fx 2.1 . .Sh CAVEATS The Internet protocol support is subject to change as the Internet protocols develop. Users should not depend on details of the current implementation, but rather the services exported. diff --git a/share/man/man4/sume.4 b/share/man/man4/sume.4 index b36f924875e6..80c731fc7d53 100644 --- a/share/man/man4/sume.4 +++ b/share/man/man4/sume.4 @@ -1,96 +1,97 @@ .\"- .\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2020 Denis Salopek .\" .\" 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. .\" .Dd August 30, 2020 .Dt SUME 4 amd64 .Os .Sh NAME .Nm sume .Nd "NetFPGA SUME 4x10Gb Ethernet driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device sume" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent if_sume_load="YES" .Ed .Sh DESCRIPTION The .Nm driver provides support for NetFPGA SUME Virtex-7 FPGA Development Board with the reference NIC bitstream loaded onto it. The HDL design for the reference NIC project uses the RIFFA based DMA engine to communicate with the host machine over PCIe. Every packet is transmitted to / from the board via a single DMA transaction, taking up to two or three interrupts per one transaction which yields low performance. .Pp There is no support for Jumbo frames as the hardware is capable of dealing only with frames with maximum size of 1514 bytes. The hardware does not support multicast filtering, provides no checksums, and offers no other offloading. .Sh SEE ALSO .Xr arp 4 , .Xr netgraph 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr vlan 4 , .Xr ifconfig 8 .Sh AUTHORS The Linux .Nm driver was originally written by .An -nosplit .An Bjoern A. Zeeb . The -.Fx version and this manual page were written by +.Fx +version and this manual page were written by .An Denis Salopek as a GSoC project. More information about the project can be found here: .Pa https://wiki.freebsd.org/SummerOfCode2020Projects/NetFPGA_SUME_Driver .Sh BUGS The reference NIC hardware design provides no mechanism for quiescing inbound traffic from interfaces configured as DOWN. All packets from administratively disabled interfaces are transferred to main memory, leaving the driver with the task of dropping such packets, thus consuming PCI bandwidth, interrupts and CPU cycles in vain. .Pp Pre-built FPGA bitstream from the NetFPGA project may not work correctly. At higher RX packet rates, the newly incoming packets can overwrite the ones in an internal FIFO so the packets would arrive in main memory corrupted, until a physical reset of the board. .Pp Occasionally, the driver can get stuck in a non-IDLE TX state due to a missed interrupt. The driver includes a watchdog function which monitors for such a condition and resets the board automatically. For more details, visit the NetFPGA SUME project site. diff --git a/usr.bin/elfctl/elfctl.1 b/usr.bin/elfctl/elfctl.1 index e72c6bcf250a..c9e168234554 100644 --- a/usr.bin/elfctl/elfctl.1 +++ b/usr.bin/elfctl/elfctl.1 @@ -1,123 +1,124 @@ .\" Copyright 2019 The FreeBSD Foundation. .\" .\" This software was developed by Bora Ozarslan under sponsorship from .\" the FreeBSD Foundation. .\" .\" 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. .\" .Dd October 5, 2023 .Dt ELFCTL 1 .Os .Sh NAME .Nm elfctl .Nd change an ELF binary's feature control note .Sh SYNOPSIS .Nm .Op Fl h | Fl -help .Op Fl i .Op Fl l .Op Fl e Ar featurelist .Ar .Sh DESCRIPTION The .Nm utility modifies feature flags in the feature control note in an ELF binary. .Pp The options are as follows: .Bl -tag -width indent .It Fl h | Fl -help Print a usage message and exit. .It Fl i Ignore unknown feature flags in .Ar featurelist . .It Fl l List known ELF feature flags. .It Fl e Ar featurelist Edit features from the given comma separated list .Ar featurelist . .Ar featurelist starts with one of the three operations: .Dq Li + to turn on the features, .Dq Li - to turn off the features, .Dq Li = to only turn on the given features. A comma separated list of feature names or numeric values follows the operation. .El .Pp If .Fl e is not specified .Nm displays the status of each feature in the ELF note in each .Ar . .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails if a file does not exist, is too short, or fails to find or edit features note. .Sh EXAMPLES The following is an example of a typical usage of the .Nm command: .Bd -literal -offset indent elfctl file elfctl -e +noaslr file .Ed .Pp Features may be specified as numerical values: .Bd -literal -offset indent elfctl -e =0x0001,0x0004 file .Ed .Pp Features may also be specified as a single combined value: .Bd -literal -offset indent elfctl -e =0x5 file .Ed .Sh NOTES On amd64, on a machine with LA57 (5-level paging) mode supported and enabled, if both .Va la57 and .Va la48 feature flags are specified, the .Va la57 feature has priority over .Va la48 . The .Va vm.pmap.prefer_uva_la48 sysctl MIB defines the default user address space size for binaries which do not set either of these flags. .Sh SEE ALSO .Xr mitigations 7 .Sh HISTORY .Nm first appeared in .Fx 12.2 . .Sh AUTHORS +.An -nosplit .Nm was written by -.An Bora Ozarslan Mt borako.ozarslan@gmail.com +.An Bora Ozarslan Aq Mt borako.ozarslan@gmail.com under sponsorship from the -.Fx Foundation. +.An FreeBSD Foundation . diff --git a/usr.bin/ipcrm/ipcrm.1 b/usr.bin/ipcrm/ipcrm.1 index 556c7bdfd99a..c0a11f410036 100644 --- a/usr.bin/ipcrm/ipcrm.1 +++ b/usr.bin/ipcrm/ipcrm.1 @@ -1,120 +1,123 @@ .\" Copyright (c) 1994 Adam Glass .\" All rights reserved. .\" .\" 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. The name of the Author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY Adam Glass ``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 Adam Glass 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. .\"" .Dd December 12, 2007 .Dt IPCRM 1 .Os .Sh NAME .Nm ipcrm .Nd "remove the specified message queues, semaphore sets, and shared segments" .Sh SYNOPSIS .Nm .Op Fl W .Op Fl v .Op Fl q Ar msqid .Op Fl m Ar shmid .Op Fl s Ar semid .Op Fl Q Ar msgkey .Op Fl M Ar shmkey .Op Fl S Ar semkey .Ar ... .Sh DESCRIPTION The .Nm utility removes the specified message queues, semaphores and shared memory segments. These System V IPC objects can be specified by their creation ID or any associated key. .Pp The following options are generic: -.Bl -tag -width indent +.Bl -tag -width "-Q msgkey" .It Fl v If specified once with -W or with -1 for an object, it will show all removed objects. If specified twice with -W or with -1 for an objects, it will show all removed objects and all failed removals. .It Fl W Try to wipe all specified message queues, semaphores and shared memory segments. .It Fl y Use the .Xr kvm 3 interface instead of the .Xr sysctl 3 interface to extract the required information. If .Nm is to operate on the running system, using .Xr kvm 3 will require read privileges to .Pa /dev/kmem . .El .Pp The following options are used to specify which IPC objects will be removed. Any number and combination of these options can be used: -.Bl -tag -width indent +.Bl -tag -width "-Q msgkey" .It Fl q Ar msqid Remove the message queue associated with the ID .Ar msqid from the system. .It Fl m Ar shmid Mark the shared memory segment associated with ID .Ar shmid for removal. This marked segment will be destroyed after the last detach. .It Fl s Ar semid Remove the semaphore set associated with ID .Ar semid from the system. .It Fl Q Ar msgkey Remove the message queue associated with key .Ar msgkey from the system. .It Fl M Ar shmkey Mark the shared memory segment associated with key .Ar shmkey for removal. This marked segment will be destroyed after the last detach. .It Fl S Ar semkey Remove the semaphore set associated with key .Ar semkey from the system. .El .Pp The identifiers and keys associated with these System V IPC objects can be determined by using .Xr ipcs 1 . If the identifier or the key is -1, it will remove all these objects. .Sh SEE ALSO .Xr ipcs 1 .Sh HISTORY The wiping of all System V IPC objects was first implemented in -.Fx 6.4 No and 7.1. +.Fx 6.4 +and +.Fx 7.1 . .Sh AUTHORS +.An -nosplit The original author was .An Adam Glass . The wiping of all System V IPC objects was thought up by .An Callum Gibson and extended and implemented by .An Edwin Groothuis .