[PATCH v8 2/8] posix: let the getopt caller set the translation context
Vivien Kraus
vivien@planete-kraus.eu
Sat Jun 21 16:41:36 GMT 2025
Option names are typically one word, so they could be translated
differently in different parts of the program. The use of a context
lets the translator pick the most appropriate translation when used in
the command-line.
Another possibility would be to prepend two dashes to the option name
before translation, such that it would be obvious this is the
command-line option name. However, it would be difficult to mark this
string for translation (to be processed by xgettext).
The context is now mandatory.
pgettext_expr is not available yet, so we use a custom function to
combine the context and the long option name.
This creates a new global variable / reentrant state field, optctxt,
so that the caller can override it.
---
manual/getopt.texi | 14 +++++-
posix/Versions | 3 ++
posix/bits/getopt_ext.h | 7 +++
posix/getopt.c | 27 +++++++-----
posix/getopt1.c | 43 +++++++++++++++++--
posix/getopt_int.h | 6 ++-
posix/tstgetoptl.c | 6 ++-
posix/tstgetoptl.po | 2 +
sysdeps/mach/hurd/i386/libc.abilist | 1 +
sysdeps/mach/hurd/x86_64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 +
sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 +
.../sysv/linux/loongarch/lp64/libc.abilist | 1 +
.../sysv/linux/m68k/coldfire/libc.abilist | 1 +
.../unix/sysv/linux/m68k/m680x0/libc.abilist | 1 +
.../sysv/linux/microblaze/be/libc.abilist | 1 +
.../sysv/linux/microblaze/le/libc.abilist | 1 +
.../unix/sysv/linux/riscv/rv32/libc.abilist | 1 +
.../unix/sysv/linux/riscv/rv64/libc.abilist | 1 +
.../unix/sysv/linux/s390/s390-32/libc.abilist | 1 +
.../unix/sysv/linux/s390/s390-64/libc.abilist | 1 +
sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 +
sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 +
.../sysv/linux/sparc/sparc32/libc.abilist | 1 +
.../sysv/linux/sparc/sparc64/libc.abilist | 1 +
.../unix/sysv/linux/x86_64/64/libc.abilist | 1 +
.../unix/sysv/linux/x86_64/x32/libc.abilist | 1 +
27 files changed, 109 insertions(+), 18 deletions(-)
diff --git a/manual/getopt.texi b/manual/getopt.texi
index da9df5225a..dc5b16b605 100644
--- a/manual/getopt.texi
+++ b/manual/getopt.texi
@@ -53,6 +53,16 @@ This variable is set by @code{getopt} to point at the value of the
option argument, for those options that accept arguments.
@end deftypevar
+@deftypevar {const char *} optctxt
+In order to match translated option names, @code{getopt} looks the
+names in the current textdomain. Since option names may be short words
+instead of long sentences, they may have different translations in
+other places of the program. @xref{Contexts, , Using contexts for
+solving ambiguities, gettext, the GNU Gettext manual}, for more
+information. If this is @code{NULL}, then the translated option names
+will not be processed.
+@end deftypevar
+
@deftypefun int getopt (int @var{argc}, char *const *@var{argv}, const char *@var{options})
@standards{POSIX.2, unistd.h}
@safety{@prelim{}@mtunsafe{@mtasurace{:getopt} @mtsenv{}}@asunsafe{@ascuheap{} @ascuintl{} @asulock{} @asucorrupt{}}@acunsafe{@acsmem{} @aculock{} @acucorrupt{}}}
@@ -224,7 +234,9 @@ The @code{struct option} structure has these fields:
@item const char *name
This field is the name of the option. It is a string. In order for
@command{getopt_long} to accept either the long option name or its
-translated form, you should mark this string for translation.
+translated form, you should mark this string for translation with a
+translation context, and set @code{optctxt} to the translation
+context.
@item int has_arg
This field says whether the option takes an argument. It is an integer,
diff --git a/posix/Versions b/posix/Versions
index 0624d24bcc..76af54306e 100644
--- a/posix/Versions
+++ b/posix/Versions
@@ -159,6 +159,9 @@ libc {
GLIBC_2.35 {
posix_spawn_file_actions_addtcsetpgrp_np;
}
+ GLIBC_2.42 {
+ optctxt;
+ }
GLIBC_PRIVATE {
__libc_fork; __libc_pread; __libc_pwrite;
__nanosleep_nocancel; __pause_nocancel;
diff --git a/posix/bits/getopt_ext.h b/posix/bits/getopt_ext.h
index 42be8ec38e..07d9407b64 100644
--- a/posix/bits/getopt_ext.h
+++ b/posix/bits/getopt_ext.h
@@ -26,6 +26,13 @@
__BEGIN_DECLS
+#ifdef __USE_GNU
+/* Callers store the translation context in which to retrieve option
+ names. If unset, the option names will not be translated. */
+
+extern const char *optctxt;
+#endif
+
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of 'struct option' terminated by an element containing a name which is
diff --git a/posix/getopt.c b/posix/getopt.c
index 9540821e1f..28f0be03f8 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -182,17 +182,19 @@ exchange (char **argv, struct _getopt_data *d)
d->__last_nonopt = d->optind;
}
-/* Return 1 iff a translation for opt_name has been found and it
- matches the substring from argument, length argument_length.
+/* Return 1 iff translation_context is not NULL, a translation for
+ opt_name has been found and it matches the substring from argument,
+ length argument_length.
*/
static const int
-match_translated_option_name (char *(*translate) (const char *msgid),
+match_translated_option_name (char *(*translate) (const char *, const char *),
const char *argument, size_t argument_length,
+ const char *translation_context,
const char *opt_name)
{
const char *translated = opt_name;
if (translate)
- translated = translate (opt_name);
+ translated = translate (translation_context, opt_name);
return (!strncmp (translated, argument, argument_length)
&& argument_length == strlen (translated));
}
@@ -210,7 +212,7 @@ process_long_option (int argc, char **argv, const char *optstring,
const struct option *longopts, int *longind,
int long_only, struct _getopt_data *d,
int print_errors, const char *prefix,
- char *(*translate) (const char *msgid))
+ char *(*translate) (const char *, const char *))
{
char *nameend;
size_t namelen;
@@ -241,7 +243,9 @@ process_long_option (int argc, char **argv, const char *optstring,
/* Didn't find an exact match, try with translated option
names. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (match_translated_option_name (translate, d->__nextchar, namelen, p->name))
+ if (match_translated_option_name (translate,
+ d->__nextchar, namelen,
+ d->optctxt, p->name))
{
/* Exact match found with translation. */
pfound = p;
@@ -365,7 +369,7 @@ process_long_option (int argc, char **argv, const char *optstring,
/* We have found a matching long option. Consume it. */
d->optind++;
d->__nextchar = NULL;
- translated_option_name = translate (pfound->name);
+ translated_option_name = translate (d->optctxt, pfound->name);
if (*nameend)
{
/* Don't test has_arg with >, because some C compilers don't
@@ -531,7 +535,7 @@ int
_getopt_internal_r (int argc, char **argv, const char *optstring,
const struct option *longopts, int *longind,
int long_only, struct _getopt_data *d, int posixly_correct,
- char *(*translate) (const char *msgid))
+ char *(*translate) (const char *, const char *))
{
int print_errors = d->opterr;
@@ -766,12 +770,15 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
int
_getopt_internal (int argc, char **argv, const char *optstring,
const struct option *longopts, int *longind, int long_only,
- int posixly_correct, char *(*translate) (const char *))
+ int posixly_correct,
+ char *(*translate) (const char *, const char *),
+ const char *ctxt)
{
int result;
getopt_data.optind = optind;
getopt_data.opterr = opterr;
+ getopt_data.optctxt = ctxt;
result = _getopt_internal_r (argc, argv, optstring, longopts,
longind, long_only, &getopt_data,
@@ -794,7 +801,7 @@ _getopt_internal (int argc, char **argv, const char *optstring,
{ \
return _getopt_internal (argc, (char **)argv, optstring, \
NULL, NULL, 0, POSIXLY_CORRECT, \
- NULL); \
+ NULL, NULL); \
}
#ifdef _LIBC
diff --git a/posix/getopt1.c b/posix/getopt1.c
index 6bf0087344..28d090019d 100644
--- a/posix/getopt1.c
+++ b/posix/getopt1.c
@@ -26,13 +26,48 @@
#include "getopt.h"
#include "getopt_int.h"
+#include <stdlib.h>
+#include <string.h>
+
+/* Callers store an optional context to enable option name
+ translation. */
+
+const char *optctxt = NULL;
+
+/* FIXME: use pgettext_expr. */
+static char *
+do_translate (const char *context, const char *msgid)
+{
+ char *full_msgid;
+ const char *translated = msgid;
+
+ if (context)
+ {
+ full_msgid = malloc (strlen (context) + 1 /* ^D */ + strlen (msgid) + 1);
+ if (msgid)
+ {
+ strcpy (full_msgid, context);
+ full_msgid[strlen (context)] = '\004';
+ strcpy (full_msgid + strlen (context) + 1, msgid);
+ translated = __dcgettext (NULL, full_msgid, LC_MESSAGES);
+ if (!strcmp (translated, full_msgid))
+ {
+ translated = msgid;
+ }
+ }
+ free (full_msgid);
+ }
+ else
+ translated = msgid;
+ return (char *) translated;
+}
int
getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, (char **) argv, options, long_options,
- opt_index, 0, 0, gettext);
+ opt_index, 0, 0, do_translate, optctxt);
}
int
@@ -41,7 +76,7 @@ _getopt_long_r (int argc, char **argv, const char *options,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
- 0, d, 0, gettext);
+ 0, d, 0, do_translate);
}
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
@@ -55,7 +90,7 @@ getopt_long_only (int argc, char *__getopt_argv_const *argv,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, (char **) argv, options, long_options,
- opt_index, 1, 0, gettext);
+ opt_index, 1, 0, do_translate, optctxt);
}
int
@@ -64,7 +99,7 @@ _getopt_long_only_r (int argc, char **argv, const char *options,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
- 1, d, 0, gettext);
+ 1, d, 0, do_translate);
}
diff --git a/posix/getopt_int.h b/posix/getopt_int.h
index b15b21256a..1d091979c3 100644
--- a/posix/getopt_int.h
+++ b/posix/getopt_int.h
@@ -29,7 +29,8 @@ extern int _getopt_internal (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
int __long_only, int __posixly_correct,
- char *(*translate) (const char *msgid));
+ char *(*translate) (const char *, const char *),
+ const char *__optctxt);
/* Reentrant versions which can handle parsing multiple argument
@@ -71,6 +72,7 @@ struct _getopt_data
int opterr;
int optopt;
char *optarg;
+ const char *optctxt;
/* Internal members. */
@@ -107,7 +109,7 @@ extern int _getopt_internal_r (int ___argc, char **___argv,
const struct option *__longopts, int *__longind,
int __long_only, struct _getopt_data *__data,
int __posixly_correct,
- char *(*translate) (const char *msgid));
+ char *(*translate) (const char *, const char *));
extern int _getopt_long_r (int ___argc, char **___argv,
const char *__shortopts,
diff --git a/posix/tstgetoptl.c b/posix/tstgetoptl.c
index 04b07093e4..bffd56f47d 100644
--- a/posix/tstgetoptl.c
+++ b/posix/tstgetoptl.c
@@ -15,6 +15,8 @@
precedence over translated options, by translated "optional" as
"required". */
+#define TRANSLATION_CONTEXT "command-line option"
+
static int
prepare_localedir (void)
{
@@ -31,7 +33,7 @@ prepare_localedir (void)
return -1;
}
/* Check that the catalog is OK: */
- if (strcmp (gettext ("color"), "colour") != 0)
+ if (strcmp (gettext (TRANSLATION_CONTEXT "\004" "color"), "colour") != 0)
{
fputs ("The mo file does not work.\n", stderr);
return -1;
@@ -42,6 +44,7 @@ prepare_localedir (void)
int
main (int argc, char **argv)
{
+ static const char *translation_context = TRANSLATION_CONTEXT;
static const struct option options[] =
{
{"required", required_argument, NULL, 'r'},
@@ -68,6 +71,7 @@ main (int argc, char **argv)
fputs ("Error while setting up localedir.\n", stderr);
return 1;
}
+ optctxt = translation_context;
while ((c = getopt_long (argc, argv, "abc:", options, NULL)) >= 0)
switch (c)
{
diff --git a/posix/tstgetoptl.po b/posix/tstgetoptl.po
index 25cd595790..e060c0d6e3 100644
--- a/posix/tstgetoptl.po
+++ b/posix/tstgetoptl.po
@@ -16,10 +16,12 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: xxx.c:yy
+msgctxt "command-line option"
msgid "color"
msgstr "colour"
# This is to make sure the translator cannot redirect options.
#: xxx.c:yy
+msgctxt "command-line option"
msgid "optional"
msgstr "required"
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index a0e686afc7..3df40e3b32 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2596,6 +2596,7 @@ GLIBC_2.42 cfgetobaud F
GLIBC_2.42 cfsetbaud F
GLIBC_2.42 cfsetibaud F
GLIBC_2.42 cfsetobaud F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_barrier_destroy F
GLIBC_2.42 pthread_barrier_init F
GLIBC_2.42 pthread_barrier_wait F
diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
index 8f9d6aa842..2a6d706f7f 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -2279,6 +2279,7 @@ GLIBC_2.42 cfgetobaud F
GLIBC_2.42 cfsetbaud F
GLIBC_2.42 cfsetibaud F
GLIBC_2.42 cfsetobaud F
+GLIBC_2.42 optctxt D 0x8
GLIBC_2.42 pthread_barrier_destroy F
GLIBC_2.42 pthread_barrier_init F
GLIBC_2.42 pthread_barrier_wait F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 959e44672f..ef3dcc3b40 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -2815,6 +2815,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index a930d1a52b..3c1aa9ac36 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -2812,6 +2812,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
index a6cab9612a..a97a2f0078 100644
--- a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
@@ -2283,6 +2283,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x8
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 7b7b72aa50..41f754a911 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -2795,6 +2795,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index df398e43c6..e16695e723 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2962,6 +2962,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index ca8df6f4b0..d85379f1e8 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2848,6 +2848,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 9508154847..f92999dd38 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2845,6 +2845,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index 1771a2370c..a4c7176af9 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2526,6 +2526,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 4b48352fd9..6472c7c7ef 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2726,6 +2726,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x8
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index f0decc787b..b6eff3181d 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -3150,6 +3150,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index da8a2bfb74..1bf2c16614 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2943,6 +2943,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x8
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index fb30341894..eff7d65ec3 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2842,6 +2842,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index d716673432..b0da639eed 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2839,6 +2839,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 6deedf216d..7f37de7438 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -3171,6 +3171,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 tcgetattr F
GLIBC_2.42 tcsetattr F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 1ce22bf036..8790e90516 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2807,6 +2807,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x8
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 tcgetattr F
GLIBC_2.42 tcsetattr F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 564877250b..0bb3960c70 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2758,6 +2758,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x8
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 25a39d0943..4aea484908 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2777,6 +2777,7 @@ GLIBC_2.42 cfsetispeed F
GLIBC_2.42 cfsetobaud F
GLIBC_2.42 cfsetospeed F
GLIBC_2.42 cfsetspeed F
+GLIBC_2.42 optctxt D 0x4
GLIBC_2.42 pthread_gettid_np F
GLIBC_2.42 uabs F
GLIBC_2.42 uimaxabs F
--
2.49.0
More information about the Libc-alpha
mailing list