diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2026-02-17 20:46:09 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2026-02-18 07:54:01 +0000 |
| commit | a03f285afafae243396c9bc7892cbe717a3ac37d (patch) | |
| tree | b6623e2612bb756b30dc9b127ee81ba619b9776f | |
| parent | 935cf3284f520c90a63baaadb762caaa30084f5c (diff) | |
libc: add man page for uexterr_gettext(3)
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D55336
| -rw-r--r-- | lib/libc/gen/Makefile.inc | 1 | ||||
| -rw-r--r-- | lib/libc/gen/uexterr_gettext.3 | 71 | ||||
| -rw-r--r-- | share/man/man9/exterror.9 | 3 |
3 files changed, 74 insertions, 1 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 3e68f8400c5c..28e55f58ccf3 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -323,6 +323,7 @@ MAN+= alarm.3 \ ttyname.3 \ ualarm.3 \ ucontext.3 \ + uexterr_gettext.3 \ ulimit.3 \ uname.3 \ unvis.3 \ diff --git a/lib/libc/gen/uexterr_gettext.3 b/lib/libc/gen/uexterr_gettext.3 new file mode 100644 index 000000000000..576fe49d0c37 --- /dev/null +++ b/lib/libc/gen/uexterr_gettext.3 @@ -0,0 +1,71 @@ +.\" Copyright 2026 The FreeBSD Foundation +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" This documentation was written by +.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship +.\" from the FreeBSD Foundation. +.\" +.Dd Feburary 17, 2026 +.Dt UEXTERR_GETTEXT +.Os +.Sh NAME +.Nm uexterr_gettext +.Nd "get string representation of the current extended error" +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In exterr.h +.Ft int +.Fo uexterr_gettext +.Fa "char *buffer" +.Fa "size_t buffer_size" +.Fc +.Sh DESCRIPTION +The +.Nm +function fills the buffer pointed to by the +.Fa buffer +pointer with the formatted extended null-terminated +error string, as reported by the +last error from a system call, which returned an extended error. +The capacity of the passed buffer is +.Va buffer_size +bytes. +.Pp +Normally, applications should use the +.Xr err 3 +family of functions to display errors from system calls. +If this is not convenient or even not possible, +for instance for applications with an advanced user interface, the +.Nm +function can be used to fetch the string with the extended error. +.Pp +Note that most parts of the extended errors are directly provided by +the kernel, and as such cannot be localized. +.Pp +See +.Xr exterror 9 +for the description of the extended error facilities. +.Sh RETURN VALUES +The +.Fn +function returns zero. +There are currently no errors defined for the function, +which might change in future. +.Pp +If any error condition is added, it will be reported by returning \-1 +and setting +.Va errno +to the corresponding value. +.Sh SEE ALSO +.Xr errno 3 , +.Xr err 3 , +.Xr exterror 9 +.Sh STANDARDS +The +.Nm +is a +.Fx +extension that first appeared in +.Fx 15.0 . diff --git a/share/man/man9/exterror.9 b/share/man/man9/exterror.9 index a7c7a11d1315..47ffda065d43 100644 --- a/share/man/man9/exterror.9 +++ b/share/man/man9/exterror.9 @@ -221,7 +221,8 @@ They pass from the failed request back to the thread that create the request. .Sh SEE ALSO .Xr errno 3 , -.Xr err 3 +.Xr err 3 , +.Xr uexterr_gettext 3 .Sh HISTORY The .Nm |
