[PATCH v19 02/11] posix: let the getopt caller set the translation context

Vivien Kraus vivien@planete-kraus.eu
Sat Dec 6 13:19:09 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).

This patch creates a new global variable / reentrant state field,
optctxt, a pointer, so that the caller can override it.  If it is not
set, or set to NULL, then no translated option name will be
recognized.

pgettext_expr is not available yet, so we use a custom function to
combine the context and the long option name, and discard the context
if no translation was performed.
---
 manual/getopt.texi                            | 14 +++++-
 posix/Versions                                |  3 ++
 posix/bits/getopt_ext.h                       |  7 +++
 posix/getopt.c                                | 44 ++++++++++++-----
 posix/getopt1.c                               | 47 +++++++++++++++++--
 posix/getopt_int.h                            |  8 +++-
 posix/tstgetoptl.c                            | 37 +++++++++++----
 posix/tstgetoptl.po                           |  3 ++
 sysdeps/mach/hurd/i386/libc.abilist           |  1 +
 sysdeps/mach/hurd/x86_64/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist      |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/i386/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 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  1 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  1 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  1 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/or1k/libc.abilist     |  1 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  1 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  1 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |  1 +
 .../linux/powerpc/powerpc64/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 +
 42 files changed, 168 insertions(+), 29 deletions(-)

diff --git a/manual/getopt.texi b/manual/getopt.texi
index 5ae22a1595..4276c9b5e8 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 for 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..5873e8ec56 100644
--- a/posix/Versions
+++ b/posix/Versions
@@ -159,6 +159,9 @@ libc {
   GLIBC_2.35 {
     posix_spawn_file_actions_addtcsetpgrp_np;
   }
+  GLIBC_2.43 {
+    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..fa72124cad 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 ebcf4d5ae3..205a97b91b 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -182,19 +182,26 @@ 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 *,
+						  char **),
 			      const char *argument, size_t argument_length,
+			      const char *translation_context,
 			      const char *opt_name)
 {
   const char *translated = opt_name;
+  char *translation_buffer = NULL;
+  int matches = 0;
   if (translate != NULL)
-    translated = translate (opt_name);
-  return (!strncmp (translated, argument, argument_length)
-	  && argument_length == strlen (translated));
+    translated = translate (translation_context, opt_name, &translation_buffer);
+  matches = (!strncmp (translated, argument, argument_length)
+	     && argument_length == strlen (translated));
+  free (translation_buffer);
+  return matches;
 }
 
 /* Process the argument starting with d->__nextchar as a long option.
@@ -210,7 +217,8 @@ 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 **))
 {
   char *nameend;
   size_t namelen;
@@ -219,6 +227,7 @@ process_long_option (int argc, char **argv, const char *optstring,
   int n_options;
   int option_index;
   const char *translated_option_name;
+  char *translation_buffer = NULL;
 
   for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
     /* Do nothing.  */ ;
@@ -241,7 +250,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;
@@ -375,7 +386,8 @@ process_long_option (int argc, char **argv, const char *optstring,
 	{
 	  if (print_errors)
 	    {
-	      translated_option_name = translate (pfound->name);
+	      translated_option_name = translate (d->optctxt, pfound->name,
+						  &translation_buffer);
 	      if (strcmp (translated_option_name, pfound->name) != 0)
 		/* Print both names of the option.  */
 		fprintf (stderr,
@@ -387,6 +399,7 @@ process_long_option (int argc, char **argv, const char *optstring,
 		fprintf (stderr,
 			 _("%s: option '%s%s' doesn't allow an argument\n"),
 			 argv[0], prefix, pfound->name);
+	      free (translation_buffer);
 	    }
 	  d->optopt = pfound->val;
 	  return '?';
@@ -402,7 +415,8 @@ process_long_option (int argc, char **argv, const char *optstring,
 	    {
 	      /* Same dichotomy as when the option does not allow an
 		 argument.  */
-	      translated_option_name = translate (pfound->name);
+	      translated_option_name = translate (d->optctxt, pfound->name,
+						  &translation_buffer);
 	      if (strcmp (translated_option_name, pfound->name) != 0)
 		fprintf (stderr,
 			 _("%s: option '%s%s' / '%s%s' requires an argument\n"),
@@ -411,6 +425,7 @@ process_long_option (int argc, char **argv, const char *optstring,
 		fprintf (stderr,
 			 _("%s: option '%s%s' requires an argument\n"),
 			 argv[0], prefix, pfound->name);
+	      free (translation_buffer);
 	    }
 
 	  d->optopt = pfound->val;
@@ -524,7 +539,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 *, char **))
 {
   int print_errors = d->opterr;
 
@@ -759,12 +774,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 *, 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,
@@ -787,7 +805,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..5ce2409197 100644
--- a/posix/getopt1.c
+++ b/posix/getopt1.c
@@ -26,13 +26,52 @@
 
 #include "getopt.h"
 #include "getopt_int.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.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 **allocated)
+{
+  char *full_msgid;
+  const char *translated = msgid;
+  int output_length = 0;
+
+  *allocated = NULL;
+  if (context != NULL)
+    {
+      output_length = __asprintf (&full_msgid, "%s\004%s", context, msgid);
+      *allocated = full_msgid;
+      if (output_length >= 0)
+	{
+	  translated = __dcgettext (NULL, full_msgid, LC_MESSAGES);
+	  if (strcmp (translated, full_msgid) == 0)
+	    {
+	      /* No translation for this context and message, so drop
+		 the context + ^D prefix.  */
+	      translated = msgid;
+	    }
+	}
+      /* Otherwise, if memory allocation failed, then we won’t accept
+	 translations.  translated remains an alias to 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 +80,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 +94,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 +103,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 5d125b1cad..3d4c3fbb2d 100644
--- a/posix/getopt_int.h
+++ b/posix/getopt_int.h
@@ -29,7 +29,9 @@ 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 *,
+						 char **),
+			     const char *__optctxt);
 
 

 /* Reentrant versions which can handle parsing multiple argument
@@ -71,6 +73,7 @@ struct _getopt_data
   int opterr;
   int optopt;
   char *optarg;
+  const char *optctxt;
 
   /* Internal members.  */
 
@@ -107,7 +110,8 @@ 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 *,
+						   char **));
 
 extern int _getopt_long_r (int ___argc, char **___argv,
 			   const char *__shortopts,
diff --git a/posix/tstgetoptl.c b/posix/tstgetoptl.c
index a1d7b5befa..1dcb6ad793 100644
--- a/posix/tstgetoptl.c
+++ b/posix/tstgetoptl.c
@@ -39,6 +39,8 @@
    known translation of flavor) without the program recognizing a
    --flavor option.  */
 
+#define TRANSLATION_CONTEXT "command-line option"
+
 static void
 prepare_localedir (void)
 {
@@ -47,8 +49,8 @@ prepare_localedir (void)
   TEST_VERIFY_EXIT (bindtextdomain ("tstgetoptl", OBJPFX "domaindir") != NULL);
   TEST_VERIFY_EXIT (textdomain ("tstgetoptl") != NULL);
   /* Check that the catalog is OK: */
-  TEST_COMPARE_STRING (gettext ("color"), "colour");
-  TEST_COMPARE_STRING (gettext ("flavor"), "flavour");
+  TEST_COMPARE_STRING (gettext (TRANSLATION_CONTEXT "\004" "color"), "colour");
+  TEST_COMPARE_STRING (gettext (TRANSLATION_CONTEXT "\004" "flavor"), "flavour");
 }
 
 static char **
@@ -65,8 +67,9 @@ prepare_argv (int *argc)
 }
 
 static void
-do_my_test (void)
+do_my_test (int with_optctxt)
 {
+  static const char *translation_context = TRANSLATION_CONTEXT;
   int argc;
   char **argv = prepare_argv (&argc);
   static const struct option options[] =
@@ -87,8 +90,14 @@ do_my_test (void)
   int c;
   int found_flavor = 0;
 
+  if (with_optctxt)
+    optctxt = translation_context;
+  else
+    optctxt = NULL;
   optind = 0;
   fputs ("Reminder that --flavor is not an option of the program.\n", stderr);
+  if (!with_optctxt)
+    fputs ("No optctxt set, so --colour should not be recognized.\n", stderr);
   while ((c = getopt_long (argc, argv, "", options, NULL)) >= 0)
     switch (c)
       {
@@ -96,9 +105,14 @@ do_my_test (void)
 	++Cflag;
 	break;
       case '?':
-        TEST_VERIFY (!found_flavor);
-        found_flavor = 1;
-        break;
+	if (with_optctxt)
+	  {
+	    TEST_VERIFY (!found_flavor);
+	    found_flavor = 1;
+	  }
+	/* Otherwise, this is OK; --colour should not exist if we did not set
+	   optctxt.  */
+	break;
       default:
 	/* This should not happen.  */
 	support_record_failure_reset ();
@@ -115,11 +129,15 @@ do_my_test (void)
 	break;
       }
 
-  TEST_VERIFY (found_flavor);
+  if (with_optctxt)
+    TEST_VERIFY (found_flavor);
 
   printf ("Cflags = %d\n", Cflag);
 
-  TEST_COMPARE (Cflag, 3);
+  if (with_optctxt)
+    TEST_COMPARE (Cflag, 3);
+  else
+    TEST_COMPARE (Cflag, 2);
 
   for (index = optind; index < argc; index++)
     printf ("Non-option argument %s\n", argv[index]);
@@ -131,7 +149,8 @@ int
 do_test (void)
 {
   prepare_localedir ();
-  do_my_test ();
+  do_my_test (0);
+  do_my_test (1);
   return 0;
 }
 
diff --git a/posix/tstgetoptl.po b/posix/tstgetoptl.po
index 5d88d418b3..68be89cfdf 100644
--- a/posix/tstgetoptl.po
+++ b/posix/tstgetoptl.po
@@ -16,14 +16,17 @@ msgstr ""
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
 #: xxx.c:yy
+msgctxt "command-line option"
 msgid "color"
 msgstr "colour"
 
 #: xxx.c:yy
+msgctxt "command-line option"
 msgid "flavor"
 msgstr "flavour"
 
 # 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 08dcd85cd9..68c4385301 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2715,6 +2715,7 @@ GLIBC_2.43 mtx_lock F
 GLIBC_2.43 mtx_timedlock F
 GLIBC_2.43 mtx_trylock F
 GLIBC_2.43 mtx_unlock F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 pthread_cancel F
 GLIBC_2.43 pthread_clockjoin_np F
 GLIBC_2.43 pthread_create F
diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
index c17d5399e4..d5fdb20fe1 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -2392,6 +2392,7 @@ GLIBC_2.43 mtx_lock F
 GLIBC_2.43 mtx_timedlock F
 GLIBC_2.43 mtx_trylock F
 GLIBC_2.43 mtx_unlock F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 pthread_cancel F
 GLIBC_2.43 pthread_clockjoin_np F
 GLIBC_2.43 pthread_create F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index d161d268d9..b5eaa54c18 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2773,4 +2773,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 62879b6a08..9d38721287 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -3120,6 +3120,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index bd5fa65e93..3d4a038e25 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2534,4 +2534,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 7d975dafab..5a231c61bc 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -2826,6 +2826,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index c95bbfe6df..75105c3e38 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -2823,6 +2823,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 6fc91899ff..8bb4ed2926 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2810,4 +2810,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 8a83722bf5..e88a350c36 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2847,6 +2847,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 3b96177e1d..9233d17385 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -3030,6 +3030,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
index bc39d18d6d..35ed82fb7c 100644
--- a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
@@ -2294,4 +2294,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index b42b4fe920..8bcba20577 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -2806,6 +2806,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 854bf3c149..fea62ef3ac 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2973,6 +2973,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index ab3d67bd60..792d82a8cd 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2859,4 +2859,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index 510b3a24d0..f56268954d 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2856,4 +2856,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index dd2baab3c9..ce6fdb0368 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2936,6 +2936,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 88fa8b9a97..45676efa7b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2934,6 +2934,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 00993fef2b..b2557cf712 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2942,6 +2942,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index 136da09f71..3c51ddb219 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2844,6 +2844,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/or1k/libc.abilist b/sysdeps/unix/sysv/linux/or1k/libc.abilist
index 1a2a3673c7..6fdbaf4335 100644
--- a/sysdeps/unix/sysv/linux/or1k/libc.abilist
+++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist
@@ -2284,4 +2284,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index f00901f956..6ce0ec58a3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -3163,6 +3163,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index de23059026..7979c7e481 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -3208,6 +3208,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index 1ae78ec7ef..9a9caec7ac 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2917,6 +2917,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index 53cb317a09..4091a4b381 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2993,4 +2993,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index e6fd213d5c..c87b4b6743 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2537,4 +2537,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index 905323b889..1c16f324db 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2737,4 +2737,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index c35e099d2c..dfd6b1fb98 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -3161,6 +3161,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 9f34c5fab3..62d732eb52 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2954,6 +2954,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index f26980c57c..2515068b65 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2853,6 +2853,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index e8ee581fa7..adb5760390 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2850,6 +2850,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 3d0665d197..fd9acd46a0 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -3184,6 +3184,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 0b7644d8fe..ae03fe7b28 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2820,6 +2820,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index 85533e9c07..54fef75839 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2769,6 +2769,7 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x8
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index 2b2a351150..339bf09fd9 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2788,4 +2788,5 @@ GLIBC_2.43 free_sized F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
 GLIBC_2.43 mseal F
+GLIBC_2.43 optctxt D 0x4
 GLIBC_2.43 umaxabs F
-- 
2.34.1



More information about the Libc-alpha mailing list