summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.d/git41
-rw-r--r--CONTRIBUTING.d/patches26
-rw-r--r--man/man3/mbsinit.356
-rw-r--r--man/man3type/locale_t.3type43
-rw-r--r--man/man3type/mbstate_t.3type84
-rw-r--r--man/man3type/wchar_t.3type4
-rw-r--r--man/man3type/wint_t.3type56
-rw-r--r--man/man5/elf.54
-rw-r--r--man/man7/string_copying.742
-rw-r--r--man/man8/ld.so.81
-rw-r--r--share/mk/configure/build-depends/binutils/ld.mk3
-rw-r--r--share/mk/dist/check/_.mk7
12 files changed, 288 insertions, 79 deletions
diff --git a/CONTRIBUTING.d/git b/CONTRIBUTING.d/git
new file mode 100644
index 000000000..4f1003a61
--- /dev/null
+++ b/CONTRIBUTING.d/git
@@ -0,0 +1,41 @@
+Name
+ Git - instructions for configuring git(1)
+
+Description
+ git-diff(1), gitattributes(5)
+ To produce useful hunk contexts in manual pages, we need to hack
+ git(1)'s idea of a function name, and also to tell git what is a
+ manual page.
+
+ $ git config --global diff.man.xfuncname '^\.S[SHsh] .*$';
+ $ echo '*.[0-9]* diff=man' >>~/.config/git/attributes;
+
+ git-format-patch(1)
+ Send patches to the right addresses.
+
+ $ git config --local format.to 'Alejandro Colomar <alx@kernel.org>';
+ $ git config --local format.cc '<linux-man@vger.kernel.org>';
+
+ git-send-email(1)
+ If mutt(1) or neomutt(1) are configured in the system,
+ git-send-email(1) can be configured to use any of them as a
+ driver. Recent versions of neomutt(1) can enable crypto with -C.
+
+ $ git config --global \
+ sendemail.sendmailcmd 'neomutt -C -H - && true';
+ or
+ $ git config --global sendemail.sendmailcmd 'mutt -H - && true';
+
+See also
+ git-config(1)
+ git-diff(1)
+ git-format-patch(1)
+ git-send-email(1)
+ gitattributes(5)
+ mutt(1)
+ neomutt(1)
+
+ CONTRIBUTING.d/*
+
+ <https://git-send-email.io/>
+ <https://neomutt.org/feature/cli-crypto>
diff --git a/CONTRIBUTING.d/patches b/CONTRIBUTING.d/patches
index afd8c2e36..35f492341 100644
--- a/CONTRIBUTING.d/patches
+++ b/CONTRIBUTING.d/patches
@@ -5,6 +5,8 @@ Description
If you know how to fix a problem in a manual page (if not, see
<CONTRIBUTING.d/bugs>), then send a patch in an email.
+ - Configure git(1) for this project. See <CONTRIBUTING.d/git>.
+
- Follow the instructions for sending mail to the mailing list
from <CONTRIBUTING.d/mail>. See also "Send the patches"
below.
@@ -121,30 +123,12 @@ Description
Send the patches
We recommend using git-send-email(1) to send the patches to the
mailing list. For instructions on how to configure and use it,
- see <https://git-send-email.io/>. It can also be configured to
- use mutt(1) as a driver, which only requires the following
- section in <~/.gitconfig> (assuming mutt(1) is already configured
- for sending mail):
-
- [sendemail]
- sendmailcmd = mutt -H - && true
-
- In <man-pages/.git/config>, the following configuration will
- simplify sending to the right addresses:
-
- [sendemail]
- to = Alejandro Colomar <alx@kernel.org>
- cc = linux-man@vger.kernel.org
+ see <https://git-send-email.io/>. See also <CONTRIBUTING.d/git>.
Sign the patches with PGP
See <CONTRIBUTING.d/mail> for more details on signing your mail
- to the list. git-send-email(1) can be configured to use a recent
- version of neomutt(1) (>= 20240201), to sign patches with PGP
- (assuming neomutt(1) is already configured for sending signed
- mail). neomutt(1)'s -C flag enables crypto:
-
- [sendemail]
- sendmailcmd = neomutt -C -H - && true
+ to the list. See also <CONTRIBUTING.d/git> for instructions for
+ configuring git-send-email(1) to use neomutt(1) as a driver.
See also
CONTRIBUTING
diff --git a/man/man3/mbsinit.3 b/man/man3/mbsinit.3
index 3ace32b69..689e2bfa9 100644
--- a/man/man3/mbsinit.3
+++ b/man/man3/mbsinit.3
@@ -1,5 +1,6 @@
'\" t
-.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
+.\" Copyright, Bruno Haible <haible@clisp.cons.org>
+.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
.\"
.\" SPDX-License-Identifier: GPL-2.0-or-later
.\"
@@ -11,7 +12,9 @@
.\"
.TH mbsinit 3 (date) "Linux man-pages (unreleased)"
.SH NAME
-mbsinit \- test for initial shift state
+mbsinit
+\-
+test for initial shift state
.SH LIBRARY
Standard C library
.RI ( libc ", " \-lc )
@@ -22,54 +25,6 @@ Standard C library
.BI "int mbsinit(const mbstate_t *" ps );
.fi
.SH DESCRIPTION
-Character conversion between the multibyte representation and the wide
-character representation uses conversion state, of type
-.IR mbstate_t .
-Conversion of a string uses a finite-state machine; when it is interrupted
-after the complete conversion of a number of characters, it may need to
-save a state for processing the remaining characters.
-Such a conversion
-state is needed for the sake of encodings such as ISO/IEC\~2022 and UTF-7.
-.P
-The initial state is the state at the beginning of conversion of a string.
-There are two kinds of state: the one used by multibyte to wide character
-conversion functions, such as
-.BR mbsrtowcs (3),
-and the one used by wide
-character to multibyte conversion functions, such as
-.BR wcsrtombs (3),
-but they both fit in a
-.IR mbstate_t ,
-and they both have the same
-representation for an initial state.
-.P
-For 8-bit encodings, all states are equivalent to the initial state.
-For multibyte encodings like UTF-8, EUC-*, BIG5, or SJIS, the wide character
-to multibyte conversion functions never produce non-initial states, but the
-multibyte to wide-character conversion functions like
-.BR mbrtowc (3)
-do
-produce non-initial states when interrupted in the middle of a character.
-.P
-One possible way to create an
-.I mbstate_t
-in initial state is to set it to zero:
-.P
-.in +4n
-.EX
-mbstate_t state;
-memset(&state, 0, sizeof(state));
-.EE
-.in
-.P
-On Linux, the following works as well, but might generate compiler warnings:
-.P
-.in +4n
-.EX
-mbstate_t state = { 0 };
-.EE
-.in
-.P
The function
.BR mbsinit ()
tests whether
@@ -110,6 +65,7 @@ depends on the
category of the
current locale.
.SH SEE ALSO
+.BR mbstate_t (3type),
.BR mbrlen (3),
.BR mbrtowc (3),
.BR mbsrtowcs (3),
diff --git a/man/man3type/locale_t.3type b/man/man3type/locale_t.3type
new file mode 100644
index 000000000..abaa980ce
--- /dev/null
+++ b/man/man3type/locale_t.3type
@@ -0,0 +1,43 @@
+.\" Copyright (c) 2024 by Alejandro Colomar <alx@kernel.org>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH locale_t 3type (date) "Linux man-pages (unreleased)"
+.SH NAME
+locale_t
+\-
+locale object
+.SH LIBRARY
+Standard C library
+.RI ( libc )
+.SH SYNOPSIS
+.nf
+.B #include <locale.h>
+.P
+.BR typedef " /* ... */ " locale_t;
+.fi
+.SH DESCRIPTION
+.I locale_t
+is a type used for storing a locale object.
+.SH STANDARDS
+POSIX.1-2008.
+.SH HISTORY
+POSIX.1-2008.
+.SH NOTES
+The following headers also provide this type:
+.IR <ctype.h> ,
+.IR <langinfo.h> ,
+.IR <monetary.h> ,
+.IR <string.h> ,
+.IR <strings.h> ,
+.IR <time.h> ,
+.IR <wchar.h> ,
+.IR <wctype.h> .
+.SH SEE ALSO
+.BR duplocale (3),
+.BR freelocale (3),
+.BR newlocale (3),
+.BR setlocale (3),
+.BR uselocale (3),
+.BR locale (5),
+.BR locale (7)
diff --git a/man/man3type/mbstate_t.3type b/man/man3type/mbstate_t.3type
new file mode 100644
index 000000000..fc78c627e
--- /dev/null
+++ b/man/man3type/mbstate_t.3type
@@ -0,0 +1,84 @@
+.\" Copyright, Bruno Haible <haible@clisp.cons.org>
+.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
+.\"
+.\" SPDX-License-Identifier: GPL-2.0-or-later
+.\"
+.\" References consulted:
+.\" GNU glibc-2 source code and manual
+.\" Dinkumware C library reference http://www.dinkumware.com/
+.\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
+.\" ISO/IEC 9899:1999
+.\"
+.TH mbstate_t 3type (date) "Linux man-pages (unreleased)"
+.SH NAME
+mbstate_t
+\-
+multi-byte-character conversion state
+.SH LIBRARY
+Standard C library
+.RI ( libc )
+.SH SYNOPSIS
+.nf
+.B #include <wchar.h>
+.P
+.BR typedef " /* ... */ " mbstate_t;
+.fi
+.SH DESCRIPTION
+Character conversion between the multibyte representation and the wide
+character representation uses conversion state, of type
+.IR mbstate_t .
+Conversion of a string uses a finite-state machine; when it is interrupted
+after the complete conversion of a number of characters, it may need to
+save a state for processing the remaining characters.
+Such a conversion
+state is needed for the sake of encodings such as ISO/IEC\~2022 and UTF-7.
+.P
+The initial state is the state at the beginning of conversion of a string.
+There are two kinds of state: the one used by multibyte to wide character
+conversion functions, such as
+.BR mbsrtowcs (3),
+and the one used by wide
+character to multibyte conversion functions, such as
+.BR wcsrtombs (3),
+but they both fit in a
+.IR mbstate_t ,
+and they both have the same
+representation for an initial state.
+.P
+For 8-bit encodings, all states are equivalent to the initial state.
+For multibyte encodings like UTF-8, EUC-*, BIG5, or SJIS, the wide character
+to multibyte conversion functions never produce non-initial states, but the
+multibyte to wide-character conversion functions like
+.BR mbrtowc (3)
+do
+produce non-initial states when interrupted in the middle of a character.
+.P
+One possible way to create an
+.I mbstate_t
+in initial state is to set it to zero:
+.P
+.in +4n
+.EX
+mbstate_t state;
+memset(&state, 0, sizeof(state));
+.EE
+.in
+.P
+On Linux, the following works as well, but might generate compiler warnings:
+.P
+.in +4n
+.EX
+mbstate_t state = { 0 };
+.EE
+.in
+.SH STANDARDS
+C11, POSIX.1-2008.
+.SH HISTORY
+C99, POSIX.1-2001.
+.SH SEE ALSO
+.BR mbrlen (3),
+.BR mbrtowc (3),
+.BR mbsinit (3),
+.BR mbsrtowcs (3),
+.BR wcrtomb (3),
+.BR wcsrtombs (3)
diff --git a/man/man3type/wchar_t.3type b/man/man3type/wchar_t.3type
index 4c98d63dd..d012bfa2e 100644
--- a/man/man3type/wchar_t.3type
+++ b/man/man3type/wchar_t.3type
@@ -14,7 +14,7 @@ Standard C library
.nf
.B #include <stddef.h>
.P
-.BR typedef " /* ... */ " wchar_t;
+.BR typedef " /* ... */ " wchar_t;
.P
.B #include <stdint.h>
.P
@@ -41,7 +41,7 @@ The following headers also provide this type:
.IR <wchar.h> ,
.IR <wctype.h> .
.P
-The following header provides these macros:
+The following header also provides these macros:
.IR <wchar.h> .
.SH SEE ALSO
.BR wint_t (3type),
diff --git a/man/man3type/wint_t.3type b/man/man3type/wint_t.3type
new file mode 100644
index 000000000..5d8532ea7
--- /dev/null
+++ b/man/man3type/wint_t.3type
@@ -0,0 +1,56 @@
+.\" Copyright (c) 2024 by Alejandro Colomar <alx@kernel.org>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH wint_t 3type (date) "Linux man-pages (unreleased)"
+.SH NAME
+wint_t,
+WEOF
+\-
+integer type capable of storing any wchar_t of WEOF
+.SH LIBRARY
+Standard C library
+.RI ( libc )
+.SH SYNOPSIS
+.nf
+.B #include <wchar.h>
+.P
+.BR typedef " /* ... */ " wint_t;
+.P
+.BR "#define WEOF " "/* ... */"
+.P
+.B #include <stdint.h>
+.P
+.BR "#define WINT_WIDTH " "/* ... */"
+.BR "#define WINT_MAX " "/* ... */"
+.BR "#define WINT_MIN " "/* ... */"
+.fi
+.SH DESCRIPTION
+.I wint_t
+is a type used in functions that work with wide characters.
+It is capable of storing any valid wchar_t or WEOF.
+It is an integer type.
+.P
+.B WEOF
+is used by wide-character functions
+to indicate the end of an input file
+or an error.
+It is of type
+.IR wint_t .
+.SH STANDARDS
+C11, POSIX.1-2008.
+.SH HISTORY
+C99, POSIX.1-2001.
+.P
+The
+.B WINT_WIDTH
+macro was added in C23.
+.SH NOTES
+The following header also provides
+.I wint_t
+and
+.BR WEOF :
+.IR <wctype.h> .
+.SH SEE ALSO
+.BR wchar_t (3type),
+.BR fputwc (3)
diff --git a/man/man5/elf.5 b/man/man5/elf.5
index 9aff88afb..57136159c 100644
--- a/man/man5/elf.5
+++ b/man/man5/elf.5
@@ -1787,7 +1787,7 @@ Address of the termination function
String table offset to name of shared object
.TP
.B DT_RPATH
-String table offset to library search path (deprecated)
+String table offset to search path for direct and indirect library dependencies
.TP
.B DT_SYMBOLIC
Alert linker to search this shared object before the executable for symbols
@@ -1819,7 +1819,7 @@ Instruct dynamic linker to process all relocations before
transferring control to the executable
.TP
.B DT_RUNPATH
-String table offset to library search path
+String table offset to search path for direct library dependencies
.TP
.B DT_LOPROC
.TQ
diff --git a/man/man7/string_copying.7 b/man/man7/string_copying.7
index 281fff8be..0be53d1cf 100644
--- a/man/man7/string_copying.7
+++ b/man/man7/string_copying.7
@@ -61,6 +61,9 @@ const char *restrict " src ,
// Catenate a null-padded character sequence into a string.
.BI "char *strncat(char *restrict " dst ", const char " src "[restrict ." ssize ],
.BI " size_t " ssize );
+.P
+// Duplicate a null-padded character sequence into a string.
+.BI "char *strndup(const char " src [. ssize "], size_t " ssize );
.fi
.\" ----- SYNOPSIS :: Known-length character sequences --------------------/
.SS Known-length character sequences
@@ -154,6 +157,11 @@ a pointer to the new location of the terminating null character
(or one after the last character in a character sequence)
after the call,
so that the programmer can use it to chain such calls.
+.\" ----- DESCRIPTION :: Terms (and abbreviations) :: duplicate -------/
+.TP
+.I duplicate
+Allocate a new buffer
+where a copy is placed.
.\" ----- DESCRIPTION :: Copy, catenate, and chain-copy ---------------/
.SS Copy, catenate, and chain-copy
Originally,
@@ -252,6 +260,8 @@ use
and then you can treat it as a known-length character sequence;
or use
.BR strncat (3)
+or
+.BR strndup (3)
directly.
.\" ----- DESCRIPTION :: Known-length character sequences -----------------/
.SS Known-length character sequences
@@ -342,7 +352,11 @@ holds a string before the call.
has an even more misleading name than the functions above.
List of functions:
.IP \[bu] 3
+.PD 0
.BR strncat (3)
+.IP \[bu]
+.BR strndup (3)
+.PD
.P
Other functions operate on an input character sequence
to create an output character sequence.
@@ -453,6 +467,15 @@ they are not related at all.
.IP
.I \%stpcpy(mempcpy(dst,\ src,\ strnlen(src,\ NITEMS(src))),\ \[dq]\[dq])
is a faster alternative to this function.
+.\" ----- DESCRIPTION :: Functions :: strndup(3) ----------------------/
+.TP
+.BR strndup (3)
+Duplicate the input character sequence,
+contained in a null-padded fixed-size buffer,
+into a newly allocated destination string.
+.IP
+The string must be freed with
+.BR free (3).
.\" ----- DESCRIPTION :: Functions :: mempcpy(3) ----------------------/
.TP
.BR mempcpy (3)
@@ -508,6 +531,9 @@ The
.I dst
pointer,
which is useless.
+.TP
+.BR strndup (3)
+The newly allocated string.
.\" ----- ERRORS ------------------------------------------------------/
.SH ERRORS
Most of these functions don't set
@@ -526,6 +552,13 @@ was
.B E2BIG
The string has been truncated.
.RE
+.TP
+.BR strndup (3)
+.RS
+.TP
+.B ENOMEM
+Insufficient memory available to allocate duplicate string.
+.RE
.\" ----- NOTES :: strscpy(9) -----------------------------------------/
.SH NOTES
The Linux kernel has an internal function for copying strings,
@@ -689,6 +722,15 @@ strncat(buf, u->ut_user, NITEMS(u->ut_user));
len = strlen(buf);
puts(buf);
.EE
+.\" ----- EXAMPLES :: strndup(3) --------------------------------------/
+.TP
+.BR strndup (3)
+.EX
+buf = strndup(u->ut_user, NITEMS(u->ut_user));
+len = strlen(buf);
+puts(buf);
+free(buf);
+.EE
.\" ----- EXAMPLES :: mempcpy(3) --------------------------------------/
.TP
.BR mempcpy (3)
diff --git a/man/man8/ld.so.8 b/man/man8/ld.so.8
index fa75b7820..23cddb9df 100644
--- a/man/man8/ld.so.8
+++ b/man/man8/ld.so.8
@@ -61,7 +61,6 @@ then it is searched for in the following order:
Using the directories specified in the
DT_RPATH dynamic section attribute
of the binary if present and DT_RUNPATH attribute does not exist.
-Use of DT_RPATH is deprecated.
.IP (2)
Using the environment variable
.BR LD_LIBRARY_PATH ,
diff --git a/share/mk/configure/build-depends/binutils/ld.mk b/share/mk/configure/build-depends/binutils/ld.mk
index c27cd252d..687039f77 100644
--- a/share/mk/configure/build-depends/binutils/ld.mk
+++ b/share/mk/configure/build-depends/binutils/ld.mk
@@ -6,13 +6,14 @@ ifndef MAKEFILE_CONFIGURE_BUILD_DEPENDS_BINUTILS_LD_INCLUDED
MAKEFILE_CONFIGURE_BUILD_DEPENDS_BINUTILS_LD_INCLUDED := 1
+include $(MAKEFILEDIR)/configure/build-depends/cpp/cpp.mk
include $(MAKEFILEDIR)/configure/build-depends/gcc/cc.mk
include $(MAKEFILEDIR)/configure/build-depends/coreutils/echo.mk
include $(MAKEFILEDIR)/configure/build-depends/pkgconf/pkgconf.mk
include $(MAKEFILEDIR)/configure/verbose.mk
-LD := $(CC) $(CFLAGS)
+LD := $(CC) $(CPPFLAGS) $(CFLAGS)
LD_HAS_FUSE_LINKER_PLUGIN := \
diff --git a/share/mk/dist/check/_.mk b/share/mk/dist/check/_.mk
index 7c6267625..d0a3b5df9 100644
--- a/share/mk/dist/check/_.mk
+++ b/share/mk/dist/check/_.mk
@@ -33,8 +33,11 @@ distcheck-%: $(_DISTCHECKSRCDIR) $(MK) | $$(@D)/
.PHONY: distcheck
distcheck: distcheck-diffoscope
distcheck: $(_DISTCHECKSRCDIR) $(MK)
- $(info $(INFO_)MAKE lint build check install dist)
- $(MAKE) $(_MAKE_OPTS) lint build check install dist \
+ $(info $(INFO_)MAKE lint build install dist)
+ $(MAKE) $(_MAKE_OPTS) lint build install dist \
+ 'INFO_= distcheck: '
+ $(info $(INFO_)MAKE check)
+ $(MAKE) $(_MAKE_OPTS) check \
'INFO_= distcheck: '