1 diff --git a/NEWS b/NEWS
2 index 485b8ddffa..3030735839 100644
5 @@ -5,6 +5,17 @@ See the end for copying conditions.
6 Please send GNU C library bug reports via <https://sourceware.org/bugzilla/>
7 using `glibc' in the "product" field.
9 +The following bugs are resolved with this release:
11 + [26534] libm.so 2.32 SIGILL in pow() due to FMA4 instruction on non-FMA4
13 + [26555] string: strerrorname_np does not return the documented value
14 + [26636] libc: 32-bit shmctl(IPC_INFO) crashes when shminfo struct is
15 + at the end of a memory mapping
16 + [26637] libc: semctl SEM_STAT_ANY fails to pass the buffer specified
17 + by the caller to the kernel
18 + [26639] libc: msgctl IPC_INFO and MSG_INFO return garbage
23 diff --git a/iconv/Versions b/iconv/Versions
24 index 8a5f4cf780..d51af52fa3 100644
27 @@ -6,7 +6,9 @@ libc {
29 # functions shared with iconv program
30 __gconv_get_alias_db; __gconv_get_cache; __gconv_get_modules_db;
31 - __gconv_open; __gconv_create_spec;
33 + # functions used elsewhere in glibc
34 + __gconv_open; __gconv_create_spec; __gconv_destroy_spec;
36 # function used by the gconv modules
37 __gconv_transliterate;
38 diff --git a/iconv/gconv_charset.c b/iconv/gconv_charset.c
39 index 6ccd0773cc..4ba0aa99f5 100644
40 --- a/iconv/gconv_charset.c
41 +++ b/iconv/gconv_charset.c
42 @@ -216,3 +216,13 @@ out:
45 libc_hidden_def (__gconv_create_spec)
49 +__gconv_destroy_spec (struct gconv_spec *conv_spec)
51 + free (conv_spec->fromcode);
52 + free (conv_spec->tocode);
55 +libc_hidden_def (__gconv_destroy_spec)
56 diff --git a/iconv/gconv_charset.h b/iconv/gconv_charset.h
57 index b39b09aea1..e9c122cf7e 100644
58 --- a/iconv/gconv_charset.h
59 +++ b/iconv/gconv_charset.h
61 #define GCONV_IGNORE_ERRORS_SUFFIX "IGNORE"
64 -/* This function accepts the charset names of the source and destination of the
65 - conversion and populates *conv_spec with an equivalent conversion
66 - specification that may later be used by __gconv_open. The charset names
67 - might contain options in the form of suffixes that alter the conversion,
68 - e.g. "ISO-10646/UTF-8/TRANSLIT". It processes the charset names, ignoring
69 - and truncating any suffix options in fromcode, and processing and truncating
70 - any suffix options in tocode. Supported suffix options ("TRANSLIT" or
71 - "IGNORE") when found in tocode lead to the corresponding flag in *conv_spec
72 - to be set to true. Unrecognized suffix options are silently discarded. If
73 - the function succeeds, it returns conv_spec back to the caller. It returns
74 - NULL upon failure. */
76 -__gconv_create_spec (struct gconv_spec *conv_spec, const char *fromcode,
77 - const char *tocode);
78 -libc_hidden_proto (__gconv_create_spec)
81 -/* This function frees all heap memory allocated by __gconv_create_spec. */
82 -static void __attribute__ ((unused))
83 -gconv_destroy_spec (struct gconv_spec *conv_spec)
85 - free (conv_spec->fromcode);
86 - free (conv_spec->tocode);
91 /* This function copies in-order, characters from the source 's' that are
92 either alpha-numeric or one in one of these: "_-.,:/" - into the destination
93 'wp' while dropping all other characters. In the process, it converts all
94 diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h
95 index e86938dae7..f721ce30ff 100644
96 --- a/iconv/gconv_int.h
97 +++ b/iconv/gconv_int.h
98 @@ -152,6 +152,27 @@ extern int __gconv_open (struct gconv_spec *conv_spec,
99 __gconv_t *handle, int flags);
100 libc_hidden_proto (__gconv_open)
102 +/* This function accepts the charset names of the source and destination of the
103 + conversion and populates *conv_spec with an equivalent conversion
104 + specification that may later be used by __gconv_open. The charset names
105 + might contain options in the form of suffixes that alter the conversion,
106 + e.g. "ISO-10646/UTF-8/TRANSLIT". It processes the charset names, ignoring
107 + and truncating any suffix options in fromcode, and processing and truncating
108 + any suffix options in tocode. Supported suffix options ("TRANSLIT" or
109 + "IGNORE") when found in tocode lead to the corresponding flag in *conv_spec
110 + to be set to true. Unrecognized suffix options are silently discarded. If
111 + the function succeeds, it returns conv_spec back to the caller. It returns
112 + NULL upon failure. */
113 +extern struct gconv_spec *
114 +__gconv_create_spec (struct gconv_spec *conv_spec, const char *fromcode,
115 + const char *tocode);
116 +libc_hidden_proto (__gconv_create_spec)
118 +/* This function frees all heap memory allocated by __gconv_create_spec. */
120 +__gconv_destroy_spec (struct gconv_spec *conv_spec);
121 +libc_hidden_proto (__gconv_destroy_spec)
123 /* Free resources associated with transformation descriptor CD. */
124 extern int __gconv_close (__gconv_t cd)
126 diff --git a/iconv/iconv_open.c b/iconv/iconv_open.c
127 index dd54bc12e0..5b30055c04 100644
128 --- a/iconv/iconv_open.c
129 +++ b/iconv/iconv_open.c
130 @@ -39,7 +39,7 @@ iconv_open (const char *tocode, const char *fromcode)
132 int res = __gconv_open (&conv_spec, &cd, 0);
134 - gconv_destroy_spec (&conv_spec);
135 + __gconv_destroy_spec (&conv_spec);
137 if (__builtin_expect (res, __GCONV_OK) != __GCONV_OK)
139 diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
140 index b4334faa57..d59979759c 100644
141 --- a/iconv/iconv_prog.c
142 +++ b/iconv/iconv_prog.c
143 @@ -184,7 +184,7 @@ main (int argc, char *argv[])
144 /* Let's see whether we have these coded character sets. */
145 res = __gconv_open (&conv_spec, &cd, 0);
147 - gconv_destroy_spec (&conv_spec);
148 + __gconv_destroy_spec (&conv_spec);
150 if (res != __GCONV_OK)
152 diff --git a/intl/dcigettext.c b/intl/dcigettext.c
153 index 2e7c662bc7..bd332e71da 100644
154 --- a/intl/dcigettext.c
155 +++ b/intl/dcigettext.c
156 @@ -1120,15 +1120,18 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
160 - struct gconv_spec conv_spec
161 - = { .fromcode = norm_add_slashes (charset, ""),
162 - .tocode = norm_add_slashes (outcharset, ""),
163 - /* We always want to use transliteration. */
167 + struct gconv_spec conv_spec;
169 + __gconv_create_spec (&conv_spec, charset, outcharset);
171 + /* We always want to use transliteration. */
172 + conv_spec.translit = true;
174 int r = __gconv_open (&conv_spec, &convd->conv,
177 + __gconv_destroy_spec (&conv_spec);
179 if (__builtin_expect (r != __GCONV_OK, 0))
181 /* If the output encoding is the same there is
182 diff --git a/intl/tst-codeset.c b/intl/tst-codeset.c
183 index fd70432eca..e9f6e5e09f 100644
184 --- a/intl/tst-codeset.c
185 +++ b/intl/tst-codeset.c
190 +#include <support/check.h>
198 unsetenv ("LANGUAGE");
199 unsetenv ("OUTPUT_CHARSET");
200 setlocale (LC_ALL, "de_DE.ISO-8859-1");
201 @@ -36,25 +34,21 @@ do_test (void)
202 bindtextdomain ("codeset", OBJPFX "domaindir");
204 /* Here we expect output in ISO-8859-1. */
205 - s = gettext ("cheese");
206 - if (strcmp (s, "K\344se"))
208 - printf ("call 1 returned: %s\n", s);
211 + TEST_COMPARE_STRING (gettext ("cheese"), "K\344se");
213 + /* Here we expect output in UTF-8. */
214 bind_textdomain_codeset ("codeset", "UTF-8");
215 + TEST_COMPARE_STRING (gettext ("cheese"), "K\303\244se");
217 - /* Here we expect output in UTF-8. */
218 - s = gettext ("cheese");
219 - if (strcmp (s, "K\303\244se"))
221 - printf ("call 2 returned: %s\n", s);
226 + /* `a with umlaut' is transliterated to `ae'. */
227 + bind_textdomain_codeset ("codeset", "ASCII//TRANSLIT");
228 + TEST_COMPARE_STRING (gettext ("cheese"), "Kaese");
230 + /* Transliteration also works by default even if not set. */
231 + bind_textdomain_codeset ("codeset", "ASCII");
232 + TEST_COMPARE_STRING (gettext ("cheese"), "Kaese");
237 -#define TEST_FUNCTION do_test ()
238 -#include "../test-skeleton.c"
239 +#include <support/test-driver.c>
240 diff --git a/stdio-common/Makefile b/stdio-common/Makefile
241 index 8475fd1f09..eff0c98d82 100644
242 --- a/stdio-common/Makefile
243 +++ b/stdio-common/Makefile
244 @@ -69,7 +69,8 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
246 tst-vfprintf-width-prec-alloc \
249 + tst-printf-fp-leak \
253 test-srcs = tst-unbputc tst-printf tst-printfsz-islongdouble
254 diff --git a/stdio-common/errlist.c b/stdio-common/errlist.c
255 index d15f13a22a..2ecf121674 100644
256 --- a/stdio-common/errlist.c
257 +++ b/stdio-common/errlist.c
260 #include <array_length.h>
263 +# define ERR_MAP(n) n
266 const char *const _sys_errlist_internal[] =
268 -#define _S(n, str) [n] = str,
269 +#define _S(n, str) [ERR_MAP(n)] = str,
273 @@ -41,20 +45,21 @@ static const union sys_errname_t
275 #define MSGSTRFIELD1(line) str##line
276 #define MSGSTRFIELD(line) MSGSTRFIELD1(line)
277 -#define _S(n, str) char MSGSTRFIELD(__LINE__)[sizeof(str)];
278 +#define _S(n, str) char MSGSTRFIELD(__LINE__)[sizeof(#n)];
285 +#define _S(n, s) #n,
290 static const unsigned short _sys_errnameidx[] =
292 -#define _S(n, s) [n] = offsetof(union sys_errname_t, MSGSTRFIELD(__LINE__)),
294 + [ERR_MAP(n)] = offsetof(union sys_errname_t, MSGSTRFIELD(__LINE__)),
298 diff --git a/stdio-common/test-strerr.c b/stdio-common/test-strerr.c
299 index fded208118..d77b81d507 100644
300 --- a/stdio-common/test-strerr.c
301 +++ b/stdio-common/test-strerr.c
306 -#include <array_length.h>
308 #include <support/support.h>
309 #include <support/check.h>
311 -#define N_(name) name
313 -static const char *const errlist[] =
315 -/* This file is auto-generated from errlist.def. */
316 -#include <errlist.h>
319 -#define MSGSTR_T errname_t
320 -#define MSGSTR errname
321 -#define MSGIDX errnameidx
322 -#include <errlist-name.h>
329 - TEST_VERIFY (strerrordesc_np (-1) == NULL);
330 - TEST_VERIFY (strerrordesc_np (array_length (errlist)) == NULL);
331 - for (size_t i = 0; i < array_length (errlist); i++)
333 - if (errlist[i] == NULL)
335 - TEST_COMPARE_STRING (strerrordesc_np (i), errlist[i]);
337 + TEST_COMPARE_STRING (strerrordesc_np (0), "Success");
338 + TEST_COMPARE_STRING (strerrorname_np (0), "0");
340 - TEST_VERIFY (strerrorname_np (-1) == NULL);
341 - TEST_VERIFY (strerrorname_np (array_length (errlist)) == NULL);
342 - for (size_t i = 0; i < array_length (errlist); i++)
344 - if (errlist[i] == NULL)
346 - TEST_COMPARE_STRING (strerrorname_np (i), errname.str + errnameidx[i]);
349 + TEST_COMPARE_STRING (strerrordesc_np (EPERM), "Operation not permitted");
350 + TEST_COMPARE_STRING (strerrorname_np (EPERM), "EPERM");
353 + TEST_COMPARE_STRING (strerrordesc_np (ENOENT),
354 + "No such file or directory");
355 + TEST_COMPARE_STRING (strerrorname_np (ENOENT), "ENOENT");
358 + TEST_COMPARE_STRING (strerrordesc_np (ESRCH), "No such process");
359 + TEST_COMPARE_STRING (strerrorname_np (ESRCH), "ESRCH");
362 + TEST_COMPARE_STRING (strerrordesc_np (EINTR), "Interrupted system call");
363 + TEST_COMPARE_STRING (strerrorname_np (EINTR), "EINTR");
366 + TEST_COMPARE_STRING (strerrordesc_np (EIO), "Input/output error");
367 + TEST_COMPARE_STRING (strerrorname_np (EIO), "EIO");
370 + TEST_COMPARE_STRING (strerrordesc_np (ENXIO), "No such device or address");
371 + TEST_COMPARE_STRING (strerrorname_np (ENXIO), "ENXIO");
374 + TEST_COMPARE_STRING (strerrordesc_np (E2BIG), "Argument list too long");
375 + TEST_COMPARE_STRING (strerrorname_np (E2BIG), "E2BIG");
378 + TEST_COMPARE_STRING (strerrordesc_np (ENOEXEC), "Exec format error");
379 + TEST_COMPARE_STRING (strerrorname_np (ENOEXEC), "ENOEXEC");
382 + TEST_COMPARE_STRING (strerrordesc_np (EBADF), "Bad file descriptor");
383 + TEST_COMPARE_STRING (strerrorname_np (EBADF), "EBADF");
386 + TEST_COMPARE_STRING (strerrordesc_np (ECHILD), "No child processes");
387 + TEST_COMPARE_STRING (strerrorname_np (ECHILD), "ECHILD");
390 + TEST_COMPARE_STRING (strerrordesc_np (EDEADLK),
391 + "Resource deadlock avoided");
392 + TEST_COMPARE_STRING (strerrorname_np (EDEADLK), "EDEADLK");
395 + TEST_COMPARE_STRING (strerrordesc_np (ENOMEM), "Cannot allocate memory");
396 + TEST_COMPARE_STRING (strerrorname_np (ENOMEM), "ENOMEM");
399 + TEST_COMPARE_STRING (strerrordesc_np (EACCES), "Permission denied");
400 + TEST_COMPARE_STRING (strerrorname_np (EACCES), "EACCES");
403 + TEST_COMPARE_STRING (strerrordesc_np (EFAULT), "Bad address");
404 + TEST_COMPARE_STRING (strerrorname_np (EFAULT), "EFAULT");
407 + TEST_COMPARE_STRING (strerrordesc_np (ENOTBLK), "Block device required");
408 + TEST_COMPARE_STRING (strerrorname_np (ENOTBLK), "ENOTBLK");
411 + TEST_COMPARE_STRING (strerrordesc_np (EBUSY), "Device or resource busy");
412 + TEST_COMPARE_STRING (strerrorname_np (EBUSY), "EBUSY");
415 + TEST_COMPARE_STRING (strerrordesc_np (EEXIST), "File exists");
416 + TEST_COMPARE_STRING (strerrorname_np (EEXIST), "EEXIST");
419 + TEST_COMPARE_STRING (strerrordesc_np (EXDEV), "Invalid cross-device link");
420 + TEST_COMPARE_STRING (strerrorname_np (EXDEV), "EXDEV");
423 + TEST_COMPARE_STRING (strerrordesc_np (ENODEV), "No such device");
424 + TEST_COMPARE_STRING (strerrorname_np (ENODEV), "ENODEV");
427 + TEST_COMPARE_STRING (strerrordesc_np (ENOTDIR), "Not a directory");
428 + TEST_COMPARE_STRING (strerrorname_np (ENOTDIR), "ENOTDIR");
431 + TEST_COMPARE_STRING (strerrordesc_np (EISDIR), "Is a directory");
432 + TEST_COMPARE_STRING (strerrorname_np (EISDIR), "EISDIR");
435 + TEST_COMPARE_STRING (strerrordesc_np (EINVAL), "Invalid argument");
436 + TEST_COMPARE_STRING (strerrorname_np (EINVAL), "EINVAL");
439 + TEST_COMPARE_STRING (strerrordesc_np (EMFILE), "Too many open files");
440 + TEST_COMPARE_STRING (strerrorname_np (EMFILE), "EMFILE");
443 + TEST_COMPARE_STRING (strerrordesc_np (ENFILE),
444 + "Too many open files in system");
445 + TEST_COMPARE_STRING (strerrorname_np (ENFILE), "ENFILE");
448 + TEST_COMPARE_STRING (strerrordesc_np (ENOTTY),
449 + "Inappropriate ioctl for device");
450 + TEST_COMPARE_STRING (strerrorname_np (ENOTTY), "ENOTTY");
453 + TEST_COMPARE_STRING (strerrordesc_np (ETXTBSY), "Text file busy");
454 + TEST_COMPARE_STRING (strerrorname_np (ETXTBSY), "ETXTBSY");
457 + TEST_COMPARE_STRING (strerrordesc_np (EFBIG), "File too large");
458 + TEST_COMPARE_STRING (strerrorname_np (EFBIG), "EFBIG");
461 + TEST_COMPARE_STRING (strerrordesc_np (ENOSPC), "No space left on device");
462 + TEST_COMPARE_STRING (strerrorname_np (ENOSPC), "ENOSPC");
465 + TEST_COMPARE_STRING (strerrordesc_np (ESPIPE), "Illegal seek");
466 + TEST_COMPARE_STRING (strerrorname_np (ESPIPE), "ESPIPE");
469 + TEST_COMPARE_STRING (strerrordesc_np (EROFS), "Read-only file system");
470 + TEST_COMPARE_STRING (strerrorname_np (EROFS), "EROFS");
473 + TEST_COMPARE_STRING (strerrordesc_np (EMLINK), "Too many links");
474 + TEST_COMPARE_STRING (strerrorname_np (EMLINK), "EMLINK");
477 + TEST_COMPARE_STRING (strerrordesc_np (EPIPE), "Broken pipe");
478 + TEST_COMPARE_STRING (strerrorname_np (EPIPE), "EPIPE");
481 + TEST_COMPARE_STRING (strerrordesc_np (EDOM),
482 + "Numerical argument out of domain");
483 + TEST_COMPARE_STRING (strerrorname_np (EDOM), "EDOM");
486 + TEST_COMPARE_STRING (strerrordesc_np (ERANGE),
487 + "Numerical result out of range");
488 + TEST_COMPARE_STRING (strerrorname_np (ERANGE), "ERANGE");
491 + TEST_COMPARE_STRING (strerrordesc_np (EAGAIN),
492 + "Resource temporarily unavailable");
493 + TEST_COMPARE_STRING (strerrorname_np (EAGAIN), "EAGAIN");
496 + TEST_COMPARE_STRING (strerrordesc_np (EINPROGRESS),
497 + "Operation now in progress");
498 + TEST_COMPARE_STRING (strerrorname_np (EINPROGRESS), "EINPROGRESS");
501 + TEST_COMPARE_STRING (strerrordesc_np (EALREADY),
502 + "Operation already in progress");
503 + TEST_COMPARE_STRING (strerrorname_np (EALREADY), "EALREADY");
506 + TEST_COMPARE_STRING (strerrordesc_np (ENOTSOCK),
507 + "Socket operation on non-socket");
508 + TEST_COMPARE_STRING (strerrorname_np (ENOTSOCK), "ENOTSOCK");
511 + TEST_COMPARE_STRING (strerrordesc_np (EMSGSIZE), "Message too long");
512 + TEST_COMPARE_STRING (strerrorname_np (EMSGSIZE), "EMSGSIZE");
515 + TEST_COMPARE_STRING (strerrordesc_np (EPROTOTYPE),
516 + "Protocol wrong type for socket");
517 + TEST_COMPARE_STRING (strerrorname_np (EPROTOTYPE), "EPROTOTYPE");
520 + TEST_COMPARE_STRING (strerrordesc_np (ENOPROTOOPT),
521 + "Protocol not available");
522 + TEST_COMPARE_STRING (strerrorname_np (ENOPROTOOPT), "ENOPROTOOPT");
524 +#ifdef EPROTONOSUPPORT
525 + TEST_COMPARE_STRING (strerrordesc_np (EPROTONOSUPPORT),
526 + "Protocol not supported");
527 + TEST_COMPARE_STRING (strerrorname_np (EPROTONOSUPPORT), "EPROTONOSUPPORT");
529 +#ifdef ESOCKTNOSUPPORT
530 + TEST_COMPARE_STRING (strerrordesc_np (ESOCKTNOSUPPORT),
531 + "Socket type not supported");
532 + TEST_COMPARE_STRING (strerrorname_np (ESOCKTNOSUPPORT), "ESOCKTNOSUPPORT");
535 + TEST_COMPARE_STRING (strerrordesc_np (EOPNOTSUPP),
536 + "Operation not supported");
537 + TEST_COMPARE_STRING (strerrorname_np (EOPNOTSUPP), "EOPNOTSUPP");
540 + TEST_COMPARE_STRING (strerrordesc_np (EPFNOSUPPORT),
541 + "Protocol family not supported");
542 + TEST_COMPARE_STRING (strerrorname_np (EPFNOSUPPORT), "EPFNOSUPPORT");
545 + TEST_COMPARE_STRING (strerrordesc_np (EAFNOSUPPORT),
546 + "Address family not supported by protocol");
547 + TEST_COMPARE_STRING (strerrorname_np (EAFNOSUPPORT), "EAFNOSUPPORT");
550 + TEST_COMPARE_STRING (strerrordesc_np (EADDRINUSE),
551 + "Address already in use");
552 + TEST_COMPARE_STRING (strerrorname_np (EADDRINUSE), "EADDRINUSE");
554 +#ifdef EADDRNOTAVAIL
555 + TEST_COMPARE_STRING (strerrordesc_np (EADDRNOTAVAIL),
556 + "Cannot assign requested address");
557 + TEST_COMPARE_STRING (strerrorname_np (EADDRNOTAVAIL), "EADDRNOTAVAIL");
560 + TEST_COMPARE_STRING (strerrordesc_np (ENETDOWN), "Network is down");
561 + TEST_COMPARE_STRING (strerrorname_np (ENETDOWN), "ENETDOWN");
564 + TEST_COMPARE_STRING (strerrordesc_np (ENETUNREACH),
565 + "Network is unreachable");
566 + TEST_COMPARE_STRING (strerrorname_np (ENETUNREACH), "ENETUNREACH");
569 + TEST_COMPARE_STRING (strerrordesc_np (ENETRESET),
570 + "Network dropped connection on reset");
571 + TEST_COMPARE_STRING (strerrorname_np (ENETRESET), "ENETRESET");
574 + TEST_COMPARE_STRING (strerrordesc_np (ECONNABORTED),
575 + "Software caused connection abort");
576 + TEST_COMPARE_STRING (strerrorname_np (ECONNABORTED), "ECONNABORTED");
579 + TEST_COMPARE_STRING (strerrordesc_np (ECONNRESET),
580 + "Connection reset by peer");
581 + TEST_COMPARE_STRING (strerrorname_np (ECONNRESET), "ECONNRESET");
584 + TEST_COMPARE_STRING (strerrordesc_np (ENOBUFS),
585 + "No buffer space available");
586 + TEST_COMPARE_STRING (strerrorname_np (ENOBUFS), "ENOBUFS");
589 + TEST_COMPARE_STRING (strerrordesc_np (EISCONN),
590 + "Transport endpoint is already connected");
591 + TEST_COMPARE_STRING (strerrorname_np (EISCONN), "EISCONN");
594 + TEST_COMPARE_STRING (strerrordesc_np (ENOTCONN),
595 + "Transport endpoint is not connected");
596 + TEST_COMPARE_STRING (strerrorname_np (ENOTCONN), "ENOTCONN");
599 + TEST_COMPARE_STRING (strerrordesc_np (EDESTADDRREQ),
600 + "Destination address required");
601 + TEST_COMPARE_STRING (strerrorname_np (EDESTADDRREQ), "EDESTADDRREQ");
604 + TEST_COMPARE_STRING (strerrordesc_np (ESHUTDOWN),
605 + "Cannot send after transport endpoint shutdown");
606 + TEST_COMPARE_STRING (strerrorname_np (ESHUTDOWN), "ESHUTDOWN");
609 + TEST_COMPARE_STRING (strerrordesc_np (ETOOMANYREFS),
610 + "Too many references: cannot splice");
611 + TEST_COMPARE_STRING (strerrorname_np (ETOOMANYREFS), "ETOOMANYREFS");
614 + TEST_COMPARE_STRING (strerrordesc_np (ETIMEDOUT), "Connection timed out");
615 + TEST_COMPARE_STRING (strerrorname_np (ETIMEDOUT), "ETIMEDOUT");
618 + TEST_COMPARE_STRING (strerrordesc_np (ECONNREFUSED), "Connection refused");
619 + TEST_COMPARE_STRING (strerrorname_np (ECONNREFUSED), "ECONNREFUSED");
622 + TEST_COMPARE_STRING (strerrordesc_np (ELOOP),
623 + "Too many levels of symbolic links");
624 + TEST_COMPARE_STRING (strerrorname_np (ELOOP), "ELOOP");
627 + TEST_COMPARE_STRING (strerrordesc_np (ENAMETOOLONG), "File name too long");
628 + TEST_COMPARE_STRING (strerrorname_np (ENAMETOOLONG), "ENAMETOOLONG");
631 + TEST_COMPARE_STRING (strerrordesc_np (EHOSTDOWN), "Host is down");
632 + TEST_COMPARE_STRING (strerrorname_np (EHOSTDOWN), "EHOSTDOWN");
635 + TEST_COMPARE_STRING (strerrordesc_np (EHOSTUNREACH), "No route to host");
636 + TEST_COMPARE_STRING (strerrorname_np (EHOSTUNREACH), "EHOSTUNREACH");
639 + TEST_COMPARE_STRING (strerrordesc_np (ENOTEMPTY), "Directory not empty");
640 + TEST_COMPARE_STRING (strerrorname_np (ENOTEMPTY), "ENOTEMPTY");
643 + TEST_COMPARE_STRING (strerrordesc_np (EUSERS), "Too many users");
644 + TEST_COMPARE_STRING (strerrorname_np (EUSERS), "EUSERS");
647 + TEST_COMPARE_STRING (strerrordesc_np (EDQUOT), "Disk quota exceeded");
648 + TEST_COMPARE_STRING (strerrorname_np (EDQUOT), "EDQUOT");
651 + TEST_COMPARE_STRING (strerrordesc_np (ESTALE), "Stale file handle");
652 + TEST_COMPARE_STRING (strerrorname_np (ESTALE), "ESTALE");
655 + TEST_COMPARE_STRING (strerrordesc_np (EREMOTE), "Object is remote");
656 + TEST_COMPARE_STRING (strerrorname_np (EREMOTE), "EREMOTE");
659 + TEST_COMPARE_STRING (strerrordesc_np (ENOLCK), "No locks available");
660 + TEST_COMPARE_STRING (strerrorname_np (ENOLCK), "ENOLCK");
663 + TEST_COMPARE_STRING (strerrordesc_np (ENOSYS), "Function not implemented");
664 + TEST_COMPARE_STRING (strerrorname_np (ENOSYS), "ENOSYS");
667 + TEST_COMPARE_STRING (strerrordesc_np (EILSEQ),
668 + "Invalid or incomplete multibyte or wide character");
669 + TEST_COMPARE_STRING (strerrorname_np (EILSEQ), "EILSEQ");
672 + TEST_COMPARE_STRING (strerrordesc_np (EBADMSG), "Bad message");
673 + TEST_COMPARE_STRING (strerrorname_np (EBADMSG), "EBADMSG");
676 + TEST_COMPARE_STRING (strerrordesc_np (EIDRM), "Identifier removed");
677 + TEST_COMPARE_STRING (strerrorname_np (EIDRM), "EIDRM");
680 + TEST_COMPARE_STRING (strerrordesc_np (EMULTIHOP), "Multihop attempted");
681 + TEST_COMPARE_STRING (strerrorname_np (EMULTIHOP), "EMULTIHOP");
684 + TEST_COMPARE_STRING (strerrordesc_np (ENODATA), "No data available");
685 + TEST_COMPARE_STRING (strerrorname_np (ENODATA), "ENODATA");
688 + TEST_COMPARE_STRING (strerrordesc_np (ENOLINK), "Link has been severed");
689 + TEST_COMPARE_STRING (strerrorname_np (ENOLINK), "ENOLINK");
692 + TEST_COMPARE_STRING (strerrordesc_np (ENOMSG),
693 + "No message of desired type");
694 + TEST_COMPARE_STRING (strerrorname_np (ENOMSG), "ENOMSG");
697 + TEST_COMPARE_STRING (strerrordesc_np (ENOSR), "Out of streams resources");
698 + TEST_COMPARE_STRING (strerrorname_np (ENOSR), "ENOSR");
701 + TEST_COMPARE_STRING (strerrordesc_np (ENOSTR), "Device not a stream");
702 + TEST_COMPARE_STRING (strerrorname_np (ENOSTR), "ENOSTR");
705 + TEST_COMPARE_STRING (strerrordesc_np (EOVERFLOW),
706 + "Value too large for defined data type");
707 + TEST_COMPARE_STRING (strerrorname_np (EOVERFLOW), "EOVERFLOW");
710 + TEST_COMPARE_STRING (strerrordesc_np (EPROTO), "Protocol error");
711 + TEST_COMPARE_STRING (strerrorname_np (EPROTO), "EPROTO");
714 + TEST_COMPARE_STRING (strerrordesc_np (ETIME), "Timer expired");
715 + TEST_COMPARE_STRING (strerrorname_np (ETIME), "ETIME");
718 + TEST_COMPARE_STRING (strerrordesc_np (ECANCELED), "Operation canceled");
719 + TEST_COMPARE_STRING (strerrorname_np (ECANCELED), "ECANCELED");
722 + TEST_COMPARE_STRING (strerrordesc_np (EOWNERDEAD), "Owner died");
723 + TEST_COMPARE_STRING (strerrorname_np (EOWNERDEAD), "EOWNERDEAD");
725 +#ifdef ENOTRECOVERABLE
726 + TEST_COMPARE_STRING (strerrordesc_np (ENOTRECOVERABLE),
727 + "State not recoverable");
728 + TEST_COMPARE_STRING (strerrorname_np (ENOTRECOVERABLE), "ENOTRECOVERABLE");
731 + TEST_COMPARE_STRING (strerrordesc_np (ERESTART),
732 + "Interrupted system call should be restarted");
733 + TEST_COMPARE_STRING (strerrorname_np (ERESTART), "ERESTART");
736 + TEST_COMPARE_STRING (strerrordesc_np (ECHRNG),
737 + "Channel number out of range");
738 + TEST_COMPARE_STRING (strerrorname_np (ECHRNG), "ECHRNG");
741 + TEST_COMPARE_STRING (strerrordesc_np (EL2NSYNC),
742 + "Level 2 not synchronized");
743 + TEST_COMPARE_STRING (strerrorname_np (EL2NSYNC), "EL2NSYNC");
746 + TEST_COMPARE_STRING (strerrordesc_np (EL3HLT), "Level 3 halted");
747 + TEST_COMPARE_STRING (strerrorname_np (EL3HLT), "EL3HLT");
750 + TEST_COMPARE_STRING (strerrordesc_np (EL3RST), "Level 3 reset");
751 + TEST_COMPARE_STRING (strerrorname_np (EL3RST), "EL3RST");
754 + TEST_COMPARE_STRING (strerrordesc_np (ELNRNG), "Link number out of range");
755 + TEST_COMPARE_STRING (strerrorname_np (ELNRNG), "ELNRNG");
758 + TEST_COMPARE_STRING (strerrordesc_np (EUNATCH),
759 + "Protocol driver not attached");
760 + TEST_COMPARE_STRING (strerrorname_np (EUNATCH), "EUNATCH");
763 + TEST_COMPARE_STRING (strerrordesc_np (ENOCSI),
764 + "No CSI structure available");
765 + TEST_COMPARE_STRING (strerrorname_np (ENOCSI), "ENOCSI");
768 + TEST_COMPARE_STRING (strerrordesc_np (EL2HLT), "Level 2 halted");
769 + TEST_COMPARE_STRING (strerrorname_np (EL2HLT), "EL2HLT");
772 + TEST_COMPARE_STRING (strerrordesc_np (EBADE), "Invalid exchange");
773 + TEST_COMPARE_STRING (strerrorname_np (EBADE), "EBADE");
776 + TEST_COMPARE_STRING (strerrordesc_np (EBADR),
777 + "Invalid request descriptor");
778 + TEST_COMPARE_STRING (strerrorname_np (EBADR), "EBADR");
781 + TEST_COMPARE_STRING (strerrordesc_np (EXFULL), "Exchange full");
782 + TEST_COMPARE_STRING (strerrorname_np (EXFULL), "EXFULL");
785 + TEST_COMPARE_STRING (strerrordesc_np (ENOANO), "No anode");
786 + TEST_COMPARE_STRING (strerrorname_np (ENOANO), "ENOANO");
789 + TEST_COMPARE_STRING (strerrordesc_np (EBADRQC), "Invalid request code");
790 + TEST_COMPARE_STRING (strerrorname_np (EBADRQC), "EBADRQC");
793 + TEST_COMPARE_STRING (strerrordesc_np (EBADSLT), "Invalid slot");
794 + TEST_COMPARE_STRING (strerrorname_np (EBADSLT), "EBADSLT");
797 + TEST_COMPARE_STRING (strerrordesc_np (EBFONT), "Bad font file format");
798 + TEST_COMPARE_STRING (strerrorname_np (EBFONT), "EBFONT");
801 + TEST_COMPARE_STRING (strerrordesc_np (ENONET),
802 + "Machine is not on the network");
803 + TEST_COMPARE_STRING (strerrorname_np (ENONET), "ENONET");
806 + TEST_COMPARE_STRING (strerrordesc_np (ENOPKG), "Package not installed");
807 + TEST_COMPARE_STRING (strerrorname_np (ENOPKG), "ENOPKG");
810 + TEST_COMPARE_STRING (strerrordesc_np (EADV), "Advertise error");
811 + TEST_COMPARE_STRING (strerrorname_np (EADV), "EADV");
814 + TEST_COMPARE_STRING (strerrordesc_np (ESRMNT), "Srmount error");
815 + TEST_COMPARE_STRING (strerrorname_np (ESRMNT), "ESRMNT");
818 + TEST_COMPARE_STRING (strerrordesc_np (ECOMM),
819 + "Communication error on send");
820 + TEST_COMPARE_STRING (strerrorname_np (ECOMM), "ECOMM");
823 + TEST_COMPARE_STRING (strerrordesc_np (EDOTDOT), "RFS specific error");
824 + TEST_COMPARE_STRING (strerrorname_np (EDOTDOT), "EDOTDOT");
827 + TEST_COMPARE_STRING (strerrordesc_np (ENOTUNIQ),
828 + "Name not unique on network");
829 + TEST_COMPARE_STRING (strerrorname_np (ENOTUNIQ), "ENOTUNIQ");
832 + TEST_COMPARE_STRING (strerrordesc_np (EBADFD),
833 + "File descriptor in bad state");
834 + TEST_COMPARE_STRING (strerrorname_np (EBADFD), "EBADFD");
837 + TEST_COMPARE_STRING (strerrordesc_np (EREMCHG), "Remote address changed");
838 + TEST_COMPARE_STRING (strerrorname_np (EREMCHG), "EREMCHG");
841 + TEST_COMPARE_STRING (strerrordesc_np (ELIBACC),
842 + "Can not access a needed shared library");
843 + TEST_COMPARE_STRING (strerrorname_np (ELIBACC), "ELIBACC");
846 + TEST_COMPARE_STRING (strerrordesc_np (ELIBBAD),
847 + "Accessing a corrupted shared library");
848 + TEST_COMPARE_STRING (strerrorname_np (ELIBBAD), "ELIBBAD");
851 + TEST_COMPARE_STRING (strerrordesc_np (ELIBSCN),
852 + ".lib section in a.out corrupted");
853 + TEST_COMPARE_STRING (strerrorname_np (ELIBSCN), "ELIBSCN");
856 + TEST_COMPARE_STRING (strerrordesc_np (ELIBMAX),
857 + "Attempting to link in too many shared libraries");
858 + TEST_COMPARE_STRING (strerrorname_np (ELIBMAX), "ELIBMAX");
861 + TEST_COMPARE_STRING (strerrordesc_np (ELIBEXEC),
862 + "Cannot exec a shared library directly");
863 + TEST_COMPARE_STRING (strerrorname_np (ELIBEXEC), "ELIBEXEC");
866 + TEST_COMPARE_STRING (strerrordesc_np (ESTRPIPE), "Streams pipe error");
867 + TEST_COMPARE_STRING (strerrorname_np (ESTRPIPE), "ESTRPIPE");
870 + TEST_COMPARE_STRING (strerrordesc_np (EUCLEAN),
871 + "Structure needs cleaning");
872 + TEST_COMPARE_STRING (strerrorname_np (EUCLEAN), "EUCLEAN");
875 + TEST_COMPARE_STRING (strerrordesc_np (ENOTNAM),
876 + "Not a XENIX named type file");
877 + TEST_COMPARE_STRING (strerrorname_np (ENOTNAM), "ENOTNAM");
880 + TEST_COMPARE_STRING (strerrordesc_np (ENAVAIL),
881 + "No XENIX semaphores available");
882 + TEST_COMPARE_STRING (strerrorname_np (ENAVAIL), "ENAVAIL");
885 + TEST_COMPARE_STRING (strerrordesc_np (EISNAM), "Is a named type file");
886 + TEST_COMPARE_STRING (strerrorname_np (EISNAM), "EISNAM");
889 + TEST_COMPARE_STRING (strerrordesc_np (EREMOTEIO), "Remote I/O error");
890 + TEST_COMPARE_STRING (strerrorname_np (EREMOTEIO), "EREMOTEIO");
893 + TEST_COMPARE_STRING (strerrordesc_np (ENOMEDIUM), "No medium found");
894 + TEST_COMPARE_STRING (strerrorname_np (ENOMEDIUM), "ENOMEDIUM");
897 + TEST_COMPARE_STRING (strerrordesc_np (EMEDIUMTYPE), "Wrong medium type");
898 + TEST_COMPARE_STRING (strerrorname_np (EMEDIUMTYPE), "EMEDIUMTYPE");
901 + TEST_COMPARE_STRING (strerrordesc_np (ENOKEY),
902 + "Required key not available");
903 + TEST_COMPARE_STRING (strerrorname_np (ENOKEY), "ENOKEY");
906 + TEST_COMPARE_STRING (strerrordesc_np (EKEYEXPIRED), "Key has expired");
907 + TEST_COMPARE_STRING (strerrorname_np (EKEYEXPIRED), "EKEYEXPIRED");
910 + TEST_COMPARE_STRING (strerrordesc_np (EKEYREVOKED),
911 + "Key has been revoked");
912 + TEST_COMPARE_STRING (strerrorname_np (EKEYREVOKED), "EKEYREVOKED");
915 + TEST_COMPARE_STRING (strerrordesc_np (EKEYREJECTED),
916 + "Key was rejected by service");
917 + TEST_COMPARE_STRING (strerrorname_np (EKEYREJECTED), "EKEYREJECTED");
920 + TEST_COMPARE_STRING (strerrordesc_np (ERFKILL),
921 + "Operation not possible due to RF-kill");
922 + TEST_COMPARE_STRING (strerrorname_np (ERFKILL), "ERFKILL");
925 + TEST_COMPARE_STRING (strerrordesc_np (EHWPOISON),
926 + "Memory page has hardware error");
927 + TEST_COMPARE_STRING (strerrorname_np (EHWPOISON), "EHWPOISON");
930 + TEST_COMPARE_STRING (strerrordesc_np (EBADRPC), "RPC struct is bad");
931 + TEST_COMPARE_STRING (strerrorname_np (EBADRPC), "EBADRPC");
934 + TEST_COMPARE_STRING (strerrordesc_np (EFTYPE),
935 + "Inappropriate file type or format");
936 + TEST_COMPARE_STRING (strerrorname_np (EFTYPE), "EFTYPE");
939 + TEST_COMPARE_STRING (strerrordesc_np (EPROCUNAVAIL),
940 + "RPC bad procedure for program");
941 + TEST_COMPARE_STRING (strerrorname_np (EPROCUNAVAIL), "EPROCUNAVAIL");
944 + TEST_COMPARE_STRING (strerrordesc_np (EAUTH), "Authentication error");
945 + TEST_COMPARE_STRING (strerrorname_np (EAUTH), "EAUTH");
948 + TEST_COMPARE_STRING (strerrordesc_np (EDIED), "Translator died");
949 + TEST_COMPARE_STRING (strerrorname_np (EDIED), "EDIED");
952 + TEST_COMPARE_STRING (strerrordesc_np (ERPCMISMATCH), "RPC version wrong");
953 + TEST_COMPARE_STRING (strerrorname_np (ERPCMISMATCH), "ERPCMISMATCH");
956 + TEST_COMPARE_STRING (strerrordesc_np (EGREGIOUS),
957 + "You really blew it this time");
958 + TEST_COMPARE_STRING (strerrorname_np (EGREGIOUS), "EGREGIOUS");
961 + TEST_COMPARE_STRING (strerrordesc_np (EPROCLIM), "Too many processes");
962 + TEST_COMPARE_STRING (strerrorname_np (EPROCLIM), "EPROCLIM");
965 + TEST_COMPARE_STRING (strerrordesc_np (EGRATUITOUS), "Gratuitous error");
966 + TEST_COMPARE_STRING (strerrorname_np (EGRATUITOUS), "EGRATUITOUS");
968 +#if defined (ENOTSUP) && ENOTSUP != EOPNOTSUPP
969 + TEST_COMPARE_STRING (strerrordesc_np (ENOTSUP), "Not supported");
970 + TEST_COMPARE_STRING (strerrorname_np (ENOTSUP), "ENOTSUP");
972 +#ifdef EPROGMISMATCH
973 + TEST_COMPARE_STRING (strerrordesc_np (EPROGMISMATCH),
974 + "RPC program version wrong");
975 + TEST_COMPARE_STRING (strerrorname_np (EPROGMISMATCH), "EPROGMISMATCH");
978 + TEST_COMPARE_STRING (strerrordesc_np (EBACKGROUND),
979 + "Inappropriate operation for background process");
980 + TEST_COMPARE_STRING (strerrorname_np (EBACKGROUND), "EBACKGROUND");
983 + TEST_COMPARE_STRING (strerrordesc_np (EIEIO), "Computer bought the farm");
984 + TEST_COMPARE_STRING (strerrorname_np (EIEIO), "EIEIO");
986 +#if defined (EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
987 + TEST_COMPARE_STRING (strerrordesc_np (EWOULDBLOCK),
988 + "Operation would block");
989 + TEST_COMPARE_STRING (strerrorname_np (EWOULDBLOCK), "EWOULDBLOCK");
992 + TEST_COMPARE_STRING (strerrordesc_np (ENEEDAUTH), "Need authenticator");
993 + TEST_COMPARE_STRING (strerrorname_np (ENEEDAUTH), "ENEEDAUTH");
996 + TEST_COMPARE_STRING (strerrordesc_np (ED), "?");
997 + TEST_COMPARE_STRING (strerrorname_np (ED), "ED");
1000 + TEST_COMPARE_STRING (strerrordesc_np (EPROGUNAVAIL),
1001 + "RPC program not available");
1002 + TEST_COMPARE_STRING (strerrorname_np (EPROGUNAVAIL), "EPROGUNAVAIL");
1007 diff --git a/sysdeps/aarch64/multiarch/memcpy.c b/sysdeps/aarch64/multiarch/memcpy.c
1008 index 7cf5f033e8..799d60c98c 100644
1009 --- a/sysdeps/aarch64/multiarch/memcpy.c
1010 +++ b/sysdeps/aarch64/multiarch/memcpy.c
1011 @@ -41,7 +41,8 @@ libc_ifunc (__libc_memcpy,
1013 : (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr)
1014 ? __memcpy_thunderx2
1015 - : (IS_NEOVERSE_N1 (midr)
1016 + : (IS_NEOVERSE_N1 (midr) || IS_NEOVERSE_N2 (midr)
1017 + || IS_NEOVERSE_V1 (midr)
1019 : __memcpy_generic)))));
1021 diff --git a/sysdeps/aarch64/multiarch/memcpy_advsimd.S b/sysdeps/aarch64/multiarch/memcpy_advsimd.S
1022 index d4ba747777..48bb6d7ca4 100644
1023 --- a/sysdeps/aarch64/multiarch/memcpy_advsimd.S
1024 +++ b/sysdeps/aarch64/multiarch/memcpy_advsimd.S
1025 @@ -223,12 +223,13 @@ L(copy_long_backwards):
1026 b.ls L(copy64_from_start)
1028 L(loop64_backwards):
1029 - stp A_q, B_q, [dstend, -32]
1030 + str B_q, [dstend, -16]
1031 + str A_q, [dstend, -32]
1032 ldp A_q, B_q, [srcend, -96]
1033 - stp C_q, D_q, [dstend, -64]
1034 + str D_q, [dstend, -48]
1035 + str C_q, [dstend, -64]!
1036 ldp C_q, D_q, [srcend, -128]
1037 sub srcend, srcend, 64
1038 - sub dstend, dstend, 64
1039 subs count, count, 64
1040 b.hi L(loop64_backwards)
1042 diff --git a/sysdeps/aarch64/multiarch/memmove.c b/sysdeps/aarch64/multiarch/memmove.c
1043 index ad10aa8ac6..46a4cb3a54 100644
1044 --- a/sysdeps/aarch64/multiarch/memmove.c
1045 +++ b/sysdeps/aarch64/multiarch/memmove.c
1046 @@ -41,7 +41,8 @@ libc_ifunc (__libc_memmove,
1048 : (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr)
1049 ? __memmove_thunderx2
1050 - : (IS_NEOVERSE_N1 (midr)
1051 + : (IS_NEOVERSE_N1 (midr) || IS_NEOVERSE_N2 (midr)
1052 + || IS_NEOVERSE_V1 (midr)
1054 : __memmove_generic)))));
1056 diff --git a/sysdeps/gnu/errlist.h b/sysdeps/gnu/errlist.h
1057 index 5d11ed723d..6329e5f393 100644
1058 --- a/sysdeps/gnu/errlist.h
1059 +++ b/sysdeps/gnu/errlist.h
1062 -#define ERR_MAP(value) value
1064 -_S(ERR_MAP(0), N_("Success"))
1065 +_S(0, N_("Success"))
1068 TRANS Only the owner of the file (or other resource)
1069 TRANS or processes with special privileges can perform the operation. */
1070 -_S(ERR_MAP(EPERM), N_("Operation not permitted"))
1071 +_S(EPERM, N_("Operation not permitted"))
1075 TRANS This is a ``file doesn't exist'' error
1076 TRANS for ordinary files that are referenced in contexts where they are
1077 TRANS expected to already exist. */
1078 -_S(ERR_MAP(ENOENT), N_("No such file or directory"))
1079 +_S(ENOENT, N_("No such file or directory"))
1083 TRANS No process matches the specified process ID. */
1084 -_S(ERR_MAP(ESRCH), N_("No such process"))
1085 +_S(ESRCH, N_("No such process"))
1089 @@ -29,12 +26,12 @@ TRANS
1090 TRANS You can choose to have functions resume after a signal that is handled,
1091 TRANS rather than failing with @code{EINTR}; see @ref{Interrupted
1092 TRANS Primitives}. */
1093 -_S(ERR_MAP(EINTR), N_("Interrupted system call"))
1094 +_S(EINTR, N_("Interrupted system call"))
1098 TRANS Usually used for physical read or write errors. */
1099 -_S(ERR_MAP(EIO), N_("Input/output error"))
1100 +_S(EIO, N_("Input/output error"))
1104 @@ -43,7 +40,7 @@ TRANS represented by a file you specified, and it couldn't find the device.
1105 TRANS This can mean that the device file was installed incorrectly, or that
1106 TRANS the physical device is missing or not correctly attached to the
1108 -_S(ERR_MAP(ENXIO), N_("No such device or address"))
1109 +_S(ENXIO, N_("No such device or address"))
1113 @@ -51,27 +48,27 @@ TRANS Used when the arguments passed to a new program
1114 TRANS being executed with one of the @code{exec} functions (@pxref{Executing a
1115 TRANS File}) occupy too much memory space. This condition never arises on
1116 TRANS @gnuhurdsystems{}. */
1117 -_S(ERR_MAP(E2BIG), N_("Argument list too long"))
1118 +_S(E2BIG, N_("Argument list too long"))
1122 TRANS Invalid executable file format. This condition is detected by the
1123 TRANS @code{exec} functions; see @ref{Executing a File}. */
1124 -_S(ERR_MAP(ENOEXEC), N_("Exec format error"))
1125 +_S(ENOEXEC, N_("Exec format error"))
1129 TRANS For example, I/O on a descriptor that has been
1130 TRANS closed or reading from a descriptor open only for writing (or vice
1132 -_S(ERR_MAP(EBADF), N_("Bad file descriptor"))
1133 +_S(EBADF, N_("Bad file descriptor"))
1137 TRANS This error happens on operations that are
1138 TRANS supposed to manipulate child processes, when there aren't any processes
1139 TRANS to manipulate. */
1140 -_S(ERR_MAP(ECHILD), N_("No child processes"))
1141 +_S(ECHILD, N_("No child processes"))
1145 @@ -79,74 +76,74 @@ TRANS Allocating a system resource would have resulted in a
1146 TRANS deadlock situation. The system does not guarantee that it will notice
1147 TRANS all such situations. This error means you got lucky and the system
1148 TRANS noticed; it might just hang. @xref{File Locks}, for an example. */
1149 -_S(ERR_MAP(EDEADLK), N_("Resource deadlock avoided"))
1150 +_S(EDEADLK, N_("Resource deadlock avoided"))
1154 TRANS The system cannot allocate more virtual memory
1155 TRANS because its capacity is full. */
1156 -_S(ERR_MAP(ENOMEM), N_("Cannot allocate memory"))
1157 +_S(ENOMEM, N_("Cannot allocate memory"))
1161 TRANS The file permissions do not allow the attempted operation. */
1162 -_S(ERR_MAP(EACCES), N_("Permission denied"))
1163 +_S(EACCES, N_("Permission denied"))
1167 TRANS An invalid pointer was detected.
1168 TRANS On @gnuhurdsystems{}, this error never happens; you get a signal instead. */
1169 -_S(ERR_MAP(EFAULT), N_("Bad address"))
1170 +_S(EFAULT, N_("Bad address"))
1174 TRANS A file that isn't a block special file was given in a situation that
1175 TRANS requires one. For example, trying to mount an ordinary file as a file
1176 TRANS system in Unix gives this error. */
1177 -_S(ERR_MAP(ENOTBLK), N_("Block device required"))
1178 +_S(ENOTBLK, N_("Block device required"))
1182 TRANS A system resource that can't be shared is already in use.
1183 TRANS For example, if you try to delete a file that is the root of a currently
1184 TRANS mounted filesystem, you get this error. */
1185 -_S(ERR_MAP(EBUSY), N_("Device or resource busy"))
1186 +_S(EBUSY, N_("Device or resource busy"))
1190 TRANS An existing file was specified in a context where it only
1191 TRANS makes sense to specify a new file. */
1192 -_S(ERR_MAP(EEXIST), N_("File exists"))
1193 +_S(EEXIST, N_("File exists"))
1197 TRANS An attempt to make an improper link across file systems was detected.
1198 TRANS This happens not only when you use @code{link} (@pxref{Hard Links}) but
1199 TRANS also when you rename a file with @code{rename} (@pxref{Renaming Files}). */
1200 -_S(ERR_MAP(EXDEV), N_("Invalid cross-device link"))
1201 +_S(EXDEV, N_("Invalid cross-device link"))
1205 TRANS The wrong type of device was given to a function that expects a
1206 TRANS particular sort of device. */
1207 -_S(ERR_MAP(ENODEV), N_("No such device"))
1208 +_S(ENODEV, N_("No such device"))
1212 TRANS A file that isn't a directory was specified when a directory is required. */
1213 -_S(ERR_MAP(ENOTDIR), N_("Not a directory"))
1214 +_S(ENOTDIR, N_("Not a directory"))
1218 TRANS You cannot open a directory for writing,
1219 TRANS or create or remove hard links to it. */
1220 -_S(ERR_MAP(EISDIR), N_("Is a directory"))
1221 +_S(EISDIR, N_("Is a directory"))
1225 TRANS This is used to indicate various kinds of problems
1226 TRANS with passing the wrong argument to a library function. */
1227 -_S(ERR_MAP(EINVAL), N_("Invalid argument"))
1228 +_S(EINVAL, N_("Invalid argument"))
1232 @@ -157,20 +154,20 @@ TRANS In BSD and GNU, the number of open files is controlled by a resource
1233 TRANS limit that can usually be increased. If you get this error, you might
1234 TRANS want to increase the @code{RLIMIT_NOFILE} limit or make it unlimited;
1235 TRANS @pxref{Limits on Resources}. */
1236 -_S(ERR_MAP(EMFILE), N_("Too many open files"))
1237 +_S(EMFILE, N_("Too many open files"))
1241 TRANS There are too many distinct file openings in the entire system. Note
1242 TRANS that any number of linked channels count as just one file opening; see
1243 TRANS @ref{Linked Channels}. This error never occurs on @gnuhurdsystems{}. */
1244 -_S(ERR_MAP(ENFILE), N_("Too many open files in system"))
1245 +_S(ENFILE, N_("Too many open files in system"))
1249 TRANS Inappropriate I/O control operation, such as trying to set terminal
1250 TRANS modes on an ordinary file. */
1251 -_S(ERR_MAP(ENOTTY), N_("Inappropriate ioctl for device"))
1252 +_S(ENOTTY, N_("Inappropriate ioctl for device"))
1256 @@ -179,35 +176,35 @@ TRANS write to a file that is currently being executed. Often using a
1257 TRANS debugger to run a program is considered having it open for writing and
1258 TRANS will cause this error. (The name stands for ``text file busy''.) This
1259 TRANS is not an error on @gnuhurdsystems{}; the text is copied as necessary. */
1260 -_S(ERR_MAP(ETXTBSY), N_("Text file busy"))
1261 +_S(ETXTBSY, N_("Text file busy"))
1265 TRANS The size of a file would be larger than allowed by the system. */
1266 -_S(ERR_MAP(EFBIG), N_("File too large"))
1267 +_S(EFBIG, N_("File too large"))
1271 TRANS Write operation on a file failed because the
1272 TRANS disk is full. */
1273 -_S(ERR_MAP(ENOSPC), N_("No space left on device"))
1274 +_S(ENOSPC, N_("No space left on device"))
1278 TRANS Invalid seek operation (such as on a pipe). */
1279 -_S(ERR_MAP(ESPIPE), N_("Illegal seek"))
1280 +_S(ESPIPE, N_("Illegal seek"))
1284 TRANS An attempt was made to modify something on a read-only file system. */
1285 -_S(ERR_MAP(EROFS), N_("Read-only file system"))
1286 +_S(EROFS, N_("Read-only file system"))
1290 TRANS The link count of a single file would become too large.
1291 TRANS @code{rename} can cause this error if the file being renamed already has
1292 TRANS as many links as it can take (@pxref{Renaming Files}). */
1293 -_S(ERR_MAP(EMLINK), N_("Too many links"))
1294 +_S(EMLINK, N_("Too many links"))
1298 @@ -216,19 +213,19 @@ TRANS Every library function that returns this error code also generates a
1299 TRANS @code{SIGPIPE} signal; this signal terminates the program if not handled
1300 TRANS or blocked. Thus, your program will never actually see @code{EPIPE}
1301 TRANS unless it has handled or blocked @code{SIGPIPE}. */
1302 -_S(ERR_MAP(EPIPE), N_("Broken pipe"))
1303 +_S(EPIPE, N_("Broken pipe"))
1307 TRANS Used by mathematical functions when an argument value does
1308 TRANS not fall into the domain over which the function is defined. */
1309 -_S(ERR_MAP(EDOM), N_("Numerical argument out of domain"))
1310 +_S(EDOM, N_("Numerical argument out of domain"))
1314 TRANS Used by mathematical functions when the result value is
1315 TRANS not representable because of overflow or underflow. */
1316 -_S(ERR_MAP(ERANGE), N_("Numerical result out of range"))
1317 +_S(ERANGE, N_("Numerical result out of range"))
1321 @@ -261,7 +258,7 @@ TRANS Such shortages are usually fairly serious and affect the whole system,
1322 TRANS so usually an interactive program should report the error to the user
1323 TRANS and return to its command loop.
1324 TRANS @end itemize */
1325 -_S(ERR_MAP(EAGAIN), N_("Resource temporarily unavailable"))
1326 +_S(EAGAIN, N_("Resource temporarily unavailable"))
1330 @@ -273,47 +270,47 @@ TRANS the operation has begun and will take some time. Attempts to manipulate
1331 TRANS the object before the call completes return @code{EALREADY}. You can
1332 TRANS use the @code{select} function to find out when the pending operation
1333 TRANS has completed; @pxref{Waiting for I/O}. */
1334 -_S(ERR_MAP(EINPROGRESS), N_("Operation now in progress"))
1335 +_S(EINPROGRESS, N_("Operation now in progress"))
1339 TRANS An operation is already in progress on an object that has non-blocking
1340 TRANS mode selected. */
1341 -_S(ERR_MAP(EALREADY), N_("Operation already in progress"))
1342 +_S(EALREADY, N_("Operation already in progress"))
1346 TRANS A file that isn't a socket was specified when a socket is required. */
1347 -_S(ERR_MAP(ENOTSOCK), N_("Socket operation on non-socket"))
1348 +_S(ENOTSOCK, N_("Socket operation on non-socket"))
1352 TRANS The size of a message sent on a socket was larger than the supported
1353 TRANS maximum size. */
1354 -_S(ERR_MAP(EMSGSIZE), N_("Message too long"))
1355 +_S(EMSGSIZE, N_("Message too long"))
1359 TRANS The socket type does not support the requested communications protocol. */
1360 -_S(ERR_MAP(EPROTOTYPE), N_("Protocol wrong type for socket"))
1361 +_S(EPROTOTYPE, N_("Protocol wrong type for socket"))
1365 TRANS You specified a socket option that doesn't make sense for the
1366 TRANS particular protocol being used by the socket. @xref{Socket Options}. */
1367 -_S(ERR_MAP(ENOPROTOOPT), N_("Protocol not available"))
1368 +_S(ENOPROTOOPT, N_("Protocol not available"))
1370 #ifdef EPROTONOSUPPORT
1372 TRANS The socket domain does not support the requested communications protocol
1373 TRANS (perhaps because the requested protocol is completely invalid).
1374 TRANS @xref{Creating a Socket}. */
1375 -_S(ERR_MAP(EPROTONOSUPPORT), N_("Protocol not supported"))
1376 +_S(EPROTONOSUPPORT, N_("Protocol not supported"))
1378 #ifdef ESOCKTNOSUPPORT
1380 TRANS The socket type is not supported. */
1381 -_S(ERR_MAP(ESOCKTNOSUPPORT), N_("Socket type not supported"))
1382 +_S(ESOCKTNOSUPPORT, N_("Socket type not supported"))
1386 @@ -323,71 +320,71 @@ TRANS implemented for all communications protocols. On @gnuhurdsystems{}, this
1387 TRANS error can happen for many calls when the object does not support the
1388 TRANS particular operation; it is a generic indication that the server knows
1389 TRANS nothing to do for that call. */
1390 -_S(ERR_MAP(EOPNOTSUPP), N_("Operation not supported"))
1391 +_S(EOPNOTSUPP, N_("Operation not supported"))
1395 TRANS The socket communications protocol family you requested is not supported. */
1396 -_S(ERR_MAP(EPFNOSUPPORT), N_("Protocol family not supported"))
1397 +_S(EPFNOSUPPORT, N_("Protocol family not supported"))
1401 TRANS The address family specified for a socket is not supported; it is
1402 TRANS inconsistent with the protocol being used on the socket. @xref{Sockets}. */
1403 -_S(ERR_MAP(EAFNOSUPPORT), N_("Address family not supported by protocol"))
1404 +_S(EAFNOSUPPORT, N_("Address family not supported by protocol"))
1408 TRANS The requested socket address is already in use. @xref{Socket Addresses}. */
1409 -_S(ERR_MAP(EADDRINUSE), N_("Address already in use"))
1410 +_S(EADDRINUSE, N_("Address already in use"))
1412 #ifdef EADDRNOTAVAIL
1414 TRANS The requested socket address is not available; for example, you tried
1415 TRANS to give a socket a name that doesn't match the local host name.
1416 TRANS @xref{Socket Addresses}. */
1417 -_S(ERR_MAP(EADDRNOTAVAIL), N_("Cannot assign requested address"))
1418 +_S(EADDRNOTAVAIL, N_("Cannot assign requested address"))
1422 TRANS A socket operation failed because the network was down. */
1423 -_S(ERR_MAP(ENETDOWN), N_("Network is down"))
1424 +_S(ENETDOWN, N_("Network is down"))
1428 TRANS A socket operation failed because the subnet containing the remote host
1429 TRANS was unreachable. */
1430 -_S(ERR_MAP(ENETUNREACH), N_("Network is unreachable"))
1431 +_S(ENETUNREACH, N_("Network is unreachable"))
1435 TRANS A network connection was reset because the remote host crashed. */
1436 -_S(ERR_MAP(ENETRESET), N_("Network dropped connection on reset"))
1437 +_S(ENETRESET, N_("Network dropped connection on reset"))
1441 TRANS A network connection was aborted locally. */
1442 -_S(ERR_MAP(ECONNABORTED), N_("Software caused connection abort"))
1443 +_S(ECONNABORTED, N_("Software caused connection abort"))
1447 TRANS A network connection was closed for reasons outside the control of the
1448 TRANS local host, such as by the remote machine rebooting or an unrecoverable
1449 TRANS protocol violation. */
1450 -_S(ERR_MAP(ECONNRESET), N_("Connection reset by peer"))
1451 +_S(ECONNRESET, N_("Connection reset by peer"))
1455 TRANS The kernel's buffers for I/O operations are all in use. In GNU, this
1456 TRANS error is always synonymous with @code{ENOMEM}; you may get one or the
1457 TRANS other from network operations. */
1458 -_S(ERR_MAP(ENOBUFS), N_("No buffer space available"))
1459 +_S(ENOBUFS, N_("No buffer space available"))
1463 TRANS You tried to connect a socket that is already connected.
1464 TRANS @xref{Connecting}. */
1465 -_S(ERR_MAP(EISCONN), N_("Transport endpoint is already connected"))
1466 +_S(EISCONN, N_("Transport endpoint is already connected"))
1470 @@ -395,74 +392,74 @@ TRANS The socket is not connected to anything. You get this error when you
1471 TRANS try to transmit data over a socket, without first specifying a
1472 TRANS destination for the data. For a connectionless socket (for datagram
1473 TRANS protocols, such as UDP), you get @code{EDESTADDRREQ} instead. */
1474 -_S(ERR_MAP(ENOTCONN), N_("Transport endpoint is not connected"))
1475 +_S(ENOTCONN, N_("Transport endpoint is not connected"))
1479 TRANS No default destination address was set for the socket. You get this
1480 TRANS error when you try to transmit data over a connectionless socket,
1481 TRANS without first specifying a destination for the data with @code{connect}. */
1482 -_S(ERR_MAP(EDESTADDRREQ), N_("Destination address required"))
1483 +_S(EDESTADDRREQ, N_("Destination address required"))
1487 TRANS The socket has already been shut down. */
1488 -_S(ERR_MAP(ESHUTDOWN), N_("Cannot send after transport endpoint shutdown"))
1489 +_S(ESHUTDOWN, N_("Cannot send after transport endpoint shutdown"))
1492 -_S(ERR_MAP(ETOOMANYREFS), N_("Too many references: cannot splice"))
1493 +_S(ETOOMANYREFS, N_("Too many references: cannot splice"))
1497 TRANS A socket operation with a specified timeout received no response during
1498 TRANS the timeout period. */
1499 -_S(ERR_MAP(ETIMEDOUT), N_("Connection timed out"))
1500 +_S(ETIMEDOUT, N_("Connection timed out"))
1504 TRANS A remote host refused to allow the network connection (typically because
1505 TRANS it is not running the requested service). */
1506 -_S(ERR_MAP(ECONNREFUSED), N_("Connection refused"))
1507 +_S(ECONNREFUSED, N_("Connection refused"))
1511 TRANS Too many levels of symbolic links were encountered in looking up a file name.
1512 TRANS This often indicates a cycle of symbolic links. */
1513 -_S(ERR_MAP(ELOOP), N_("Too many levels of symbolic links"))
1514 +_S(ELOOP, N_("Too many levels of symbolic links"))
1518 TRANS Filename too long (longer than @code{PATH_MAX}; @pxref{Limits for
1519 TRANS Files}) or host name too long (in @code{gethostname} or
1520 TRANS @code{sethostname}; @pxref{Host Identification}). */
1521 -_S(ERR_MAP(ENAMETOOLONG), N_("File name too long"))
1522 +_S(ENAMETOOLONG, N_("File name too long"))
1526 TRANS The remote host for a requested network connection is down. */
1527 -_S(ERR_MAP(EHOSTDOWN), N_("Host is down"))
1528 +_S(EHOSTDOWN, N_("Host is down"))
1531 TRANS The remote host for a requested network connection is not reachable. */
1533 -_S(ERR_MAP(EHOSTUNREACH), N_("No route to host"))
1534 +_S(EHOSTUNREACH, N_("No route to host"))
1538 TRANS Directory not empty, where an empty directory was expected. Typically,
1539 TRANS this error occurs when you are trying to delete a directory. */
1540 -_S(ERR_MAP(ENOTEMPTY), N_("Directory not empty"))
1541 +_S(ENOTEMPTY, N_("Directory not empty"))
1545 TRANS The file quota system is confused because there are too many users.
1546 TRANS @c This can probably happen in a GNU system when using NFS. */
1547 -_S(ERR_MAP(EUSERS), N_("Too many users"))
1548 +_S(EUSERS, N_("Too many users"))
1552 TRANS The user's disk quota was exceeded. */
1553 -_S(ERR_MAP(EDQUOT), N_("Disk quota exceeded"))
1554 +_S(EDQUOT, N_("Disk quota exceeded"))
1558 @@ -471,7 +468,7 @@ TRANS file system which is due to file system rearrangements on the server host
1559 TRANS for NFS file systems or corruption in other file systems.
1560 TRANS Repairing this condition usually requires unmounting, possibly repairing
1561 TRANS and remounting the file system. */
1562 -_S(ERR_MAP(ESTALE), N_("Stale file handle"))
1563 +_S(ESTALE, N_("Stale file handle"))
1567 @@ -479,7 +476,7 @@ TRANS An attempt was made to NFS-mount a remote file system with a file name tha
1568 TRANS already specifies an NFS-mounted file.
1569 TRANS (This is an error on some operating systems, but we expect it to work
1570 TRANS properly on @gnuhurdsystems{}, making this error code impossible.) */
1571 -_S(ERR_MAP(EREMOTE), N_("Object is remote"))
1572 +_S(EREMOTE, N_("Object is remote"))
1576 @@ -487,7 +484,7 @@ TRANS This is used by the file locking facilities; see
1577 TRANS @ref{File Locks}. This error is never generated by @gnuhurdsystems{}, but
1578 TRANS it can result from an operation to an NFS server running another
1579 TRANS operating system. */
1580 -_S(ERR_MAP(ENOLCK), N_("No locks available"))
1581 +_S(ENOLCK, N_("No locks available"))
1585 @@ -496,46 +493,46 @@ TRANS not implemented at all, either in the C library itself or in the
1586 TRANS operating system. When you get this error, you can be sure that this
1587 TRANS particular function will always fail with @code{ENOSYS} unless you
1588 TRANS install a new version of the C library or the operating system. */
1589 -_S(ERR_MAP(ENOSYS), N_("Function not implemented"))
1590 +_S(ENOSYS, N_("Function not implemented"))
1594 TRANS While decoding a multibyte character the function came along an invalid
1595 TRANS or an incomplete sequence of bytes or the given wide character is invalid. */
1596 -_S(ERR_MAP(EILSEQ), N_("Invalid or incomplete multibyte or wide character"))
1597 +_S(EILSEQ, N_("Invalid or incomplete multibyte or wide character"))
1600 -_S(ERR_MAP(EBADMSG), N_("Bad message"))
1601 +_S(EBADMSG, N_("Bad message"))
1604 -_S(ERR_MAP(EIDRM), N_("Identifier removed"))
1605 +_S(EIDRM, N_("Identifier removed"))
1608 -_S(ERR_MAP(EMULTIHOP), N_("Multihop attempted"))
1609 +_S(EMULTIHOP, N_("Multihop attempted"))
1612 -_S(ERR_MAP(ENODATA), N_("No data available"))
1613 +_S(ENODATA, N_("No data available"))
1616 -_S(ERR_MAP(ENOLINK), N_("Link has been severed"))
1617 +_S(ENOLINK, N_("Link has been severed"))
1620 -_S(ERR_MAP(ENOMSG), N_("No message of desired type"))
1621 +_S(ENOMSG, N_("No message of desired type"))
1624 -_S(ERR_MAP(ENOSR), N_("Out of streams resources"))
1625 +_S(ENOSR, N_("Out of streams resources"))
1628 -_S(ERR_MAP(ENOSTR), N_("Device not a stream"))
1629 +_S(ENOSTR, N_("Device not a stream"))
1632 -_S(ERR_MAP(EOVERFLOW), N_("Value too large for defined data type"))
1633 +_S(EOVERFLOW, N_("Value too large for defined data type"))
1636 -_S(ERR_MAP(EPROTO), N_("Protocol error"))
1637 +_S(EPROTO, N_("Protocol error"))
1640 -_S(ERR_MAP(ETIME), N_("Timer expired"))
1641 +_S(ETIME, N_("Timer expired"))
1645 @@ -543,148 +540,148 @@ TRANS An asynchronous operation was canceled before it
1646 TRANS completed. @xref{Asynchronous I/O}. When you call @code{aio_cancel},
1647 TRANS the normal result is for the operations affected to complete with this
1648 TRANS error; @pxref{Cancel AIO Operations}. */
1649 -_S(ERR_MAP(ECANCELED), N_("Operation canceled"))
1650 +_S(ECANCELED, N_("Operation canceled"))
1653 -_S(ERR_MAP(EOWNERDEAD), N_("Owner died"))
1654 +_S(EOWNERDEAD, N_("Owner died"))
1656 #ifdef ENOTRECOVERABLE
1657 -_S(ERR_MAP(ENOTRECOVERABLE), N_("State not recoverable"))
1658 +_S(ENOTRECOVERABLE, N_("State not recoverable"))
1661 -_S(ERR_MAP(ERESTART), N_("Interrupted system call should be restarted"))
1662 +_S(ERESTART, N_("Interrupted system call should be restarted"))
1665 -_S(ERR_MAP(ECHRNG), N_("Channel number out of range"))
1666 +_S(ECHRNG, N_("Channel number out of range"))
1669 -_S(ERR_MAP(EL2NSYNC), N_("Level 2 not synchronized"))
1670 +_S(EL2NSYNC, N_("Level 2 not synchronized"))
1673 -_S(ERR_MAP(EL3HLT), N_("Level 3 halted"))
1674 +_S(EL3HLT, N_("Level 3 halted"))
1677 -_S(ERR_MAP(EL3RST), N_("Level 3 reset"))
1678 +_S(EL3RST, N_("Level 3 reset"))
1681 -_S(ERR_MAP(ELNRNG), N_("Link number out of range"))
1682 +_S(ELNRNG, N_("Link number out of range"))
1685 -_S(ERR_MAP(EUNATCH), N_("Protocol driver not attached"))
1686 +_S(EUNATCH, N_("Protocol driver not attached"))
1689 -_S(ERR_MAP(ENOCSI), N_("No CSI structure available"))
1690 +_S(ENOCSI, N_("No CSI structure available"))
1693 -_S(ERR_MAP(EL2HLT), N_("Level 2 halted"))
1694 +_S(EL2HLT, N_("Level 2 halted"))
1697 -_S(ERR_MAP(EBADE), N_("Invalid exchange"))
1698 +_S(EBADE, N_("Invalid exchange"))
1701 -_S(ERR_MAP(EBADR), N_("Invalid request descriptor"))
1702 +_S(EBADR, N_("Invalid request descriptor"))
1705 -_S(ERR_MAP(EXFULL), N_("Exchange full"))
1706 +_S(EXFULL, N_("Exchange full"))
1709 -_S(ERR_MAP(ENOANO), N_("No anode"))
1710 +_S(ENOANO, N_("No anode"))
1713 -_S(ERR_MAP(EBADRQC), N_("Invalid request code"))
1714 +_S(EBADRQC, N_("Invalid request code"))
1717 -_S(ERR_MAP(EBADSLT), N_("Invalid slot"))
1718 +_S(EBADSLT, N_("Invalid slot"))
1721 -_S(ERR_MAP(EBFONT), N_("Bad font file format"))
1722 +_S(EBFONT, N_("Bad font file format"))
1725 -_S(ERR_MAP(ENONET), N_("Machine is not on the network"))
1726 +_S(ENONET, N_("Machine is not on the network"))
1729 -_S(ERR_MAP(ENOPKG), N_("Package not installed"))
1730 +_S(ENOPKG, N_("Package not installed"))
1733 -_S(ERR_MAP(EADV), N_("Advertise error"))
1734 +_S(EADV, N_("Advertise error"))
1737 -_S(ERR_MAP(ESRMNT), N_("Srmount error"))
1738 +_S(ESRMNT, N_("Srmount error"))
1741 -_S(ERR_MAP(ECOMM), N_("Communication error on send"))
1742 +_S(ECOMM, N_("Communication error on send"))
1745 -_S(ERR_MAP(EDOTDOT), N_("RFS specific error"))
1746 +_S(EDOTDOT, N_("RFS specific error"))
1749 -_S(ERR_MAP(ENOTUNIQ), N_("Name not unique on network"))
1750 +_S(ENOTUNIQ, N_("Name not unique on network"))
1753 -_S(ERR_MAP(EBADFD), N_("File descriptor in bad state"))
1754 +_S(EBADFD, N_("File descriptor in bad state"))
1757 -_S(ERR_MAP(EREMCHG), N_("Remote address changed"))
1758 +_S(EREMCHG, N_("Remote address changed"))
1761 -_S(ERR_MAP(ELIBACC), N_("Can not access a needed shared library"))
1762 +_S(ELIBACC, N_("Can not access a needed shared library"))
1765 -_S(ERR_MAP(ELIBBAD), N_("Accessing a corrupted shared library"))
1766 +_S(ELIBBAD, N_("Accessing a corrupted shared library"))
1769 -_S(ERR_MAP(ELIBSCN), N_(".lib section in a.out corrupted"))
1770 +_S(ELIBSCN, N_(".lib section in a.out corrupted"))
1773 -_S(ERR_MAP(ELIBMAX), N_("Attempting to link in too many shared libraries"))
1774 +_S(ELIBMAX, N_("Attempting to link in too many shared libraries"))
1777 -_S(ERR_MAP(ELIBEXEC), N_("Cannot exec a shared library directly"))
1778 +_S(ELIBEXEC, N_("Cannot exec a shared library directly"))
1781 -_S(ERR_MAP(ESTRPIPE), N_("Streams pipe error"))
1782 +_S(ESTRPIPE, N_("Streams pipe error"))
1785 -_S(ERR_MAP(EUCLEAN), N_("Structure needs cleaning"))
1786 +_S(EUCLEAN, N_("Structure needs cleaning"))
1789 -_S(ERR_MAP(ENOTNAM), N_("Not a XENIX named type file"))
1790 +_S(ENOTNAM, N_("Not a XENIX named type file"))
1793 -_S(ERR_MAP(ENAVAIL), N_("No XENIX semaphores available"))
1794 +_S(ENAVAIL, N_("No XENIX semaphores available"))
1797 -_S(ERR_MAP(EISNAM), N_("Is a named type file"))
1798 +_S(EISNAM, N_("Is a named type file"))
1801 -_S(ERR_MAP(EREMOTEIO), N_("Remote I/O error"))
1802 +_S(EREMOTEIO, N_("Remote I/O error"))
1805 -_S(ERR_MAP(ENOMEDIUM), N_("No medium found"))
1806 +_S(ENOMEDIUM, N_("No medium found"))
1809 -_S(ERR_MAP(EMEDIUMTYPE), N_("Wrong medium type"))
1810 +_S(EMEDIUMTYPE, N_("Wrong medium type"))
1813 -_S(ERR_MAP(ENOKEY), N_("Required key not available"))
1814 +_S(ENOKEY, N_("Required key not available"))
1817 -_S(ERR_MAP(EKEYEXPIRED), N_("Key has expired"))
1818 +_S(EKEYEXPIRED, N_("Key has expired"))
1821 -_S(ERR_MAP(EKEYREVOKED), N_("Key has been revoked"))
1822 +_S(EKEYREVOKED, N_("Key has been revoked"))
1825 -_S(ERR_MAP(EKEYREJECTED), N_("Key was rejected by service"))
1826 +_S(EKEYREJECTED, N_("Key was rejected by service"))
1829 -_S(ERR_MAP(ERFKILL), N_("Operation not possible due to RF-kill"))
1830 +_S(ERFKILL, N_("Operation not possible due to RF-kill"))
1833 -_S(ERR_MAP(EHWPOISON), N_("Memory page has hardware error"))
1834 +_S(EHWPOISON, N_("Memory page has hardware error"))
1837 -_S(ERR_MAP(EBADRPC), N_("RPC struct is bad"))
1838 +_S(EBADRPC, N_("RPC struct is bad"))
1842 @@ -693,40 +690,40 @@ TRANS operation, or a data file had the wrong format.
1844 TRANS On some systems @code{chmod} returns this error if you try to set the
1845 TRANS sticky bit on a non-directory file; @pxref{Setting Permissions}. */
1846 -_S(ERR_MAP(EFTYPE), N_("Inappropriate file type or format"))
1847 +_S(EFTYPE, N_("Inappropriate file type or format"))
1850 -_S(ERR_MAP(EPROCUNAVAIL), N_("RPC bad procedure for program"))
1851 +_S(EPROCUNAVAIL, N_("RPC bad procedure for program"))
1854 -_S(ERR_MAP(EAUTH), N_("Authentication error"))
1855 +_S(EAUTH, N_("Authentication error"))
1859 TRANS On @gnuhurdsystems{}, opening a file returns this error when the file is
1860 TRANS translated by a program and the translator program dies while starting
1861 TRANS up, before it has connected to the file. */
1862 -_S(ERR_MAP(EDIED), N_("Translator died"))
1863 +_S(EDIED, N_("Translator died"))
1866 -_S(ERR_MAP(ERPCMISMATCH), N_("RPC version wrong"))
1867 +_S(ERPCMISMATCH, N_("RPC version wrong"))
1871 TRANS You did @strong{what}? */
1872 -_S(ERR_MAP(EGREGIOUS), N_("You really blew it this time"))
1873 +_S(EGREGIOUS, N_("You really blew it this time"))
1877 TRANS This means that the per-user limit on new process would be exceeded by
1878 TRANS an attempted @code{fork}. @xref{Limits on Resources}, for details on
1879 TRANS the @code{RLIMIT_NPROC} limit. */
1880 -_S(ERR_MAP(EPROCLIM), N_("Too many processes"))
1881 +_S(EPROCLIM, N_("Too many processes"))
1885 TRANS This error code has no purpose. */
1886 -_S(ERR_MAP(EGRATUITOUS), N_("Gratuitous error"))
1887 +_S(EGRATUITOUS, N_("Gratuitous error"))
1889 #if defined (ENOTSUP) && ENOTSUP != EOPNOTSUPP
1891 @@ -742,10 +739,10 @@ TRANS values.
1893 TRANS If the entire function is not available at all in the implementation,
1894 TRANS it returns @code{ENOSYS} instead. */
1895 -_S(ERR_MAP(ENOTSUP), N_("Not supported"))
1896 +_S(ENOTSUP, N_("Not supported"))
1898 #ifdef EPROGMISMATCH
1899 -_S(ERR_MAP(EPROGMISMATCH), N_("RPC program version wrong"))
1900 +_S(EPROGMISMATCH, N_("RPC program version wrong"))
1904 @@ -755,7 +752,7 @@ TRANS foreground process group of the terminal. Users do not usually see this
1905 TRANS error because functions such as @code{read} and @code{write} translate
1906 TRANS it into a @code{SIGTTIN} or @code{SIGTTOU} signal. @xref{Job Control},
1907 TRANS for information on process groups and these signals. */
1908 -_S(ERR_MAP(EBACKGROUND), N_("Inappropriate operation for background process"))
1909 +_S(EBACKGROUND, N_("Inappropriate operation for background process"))
1913 @@ -773,7 +770,7 @@ TRANS @c "bought the farm" means "died". -jtobey
1915 TRANS @c Translators, please do not translate this litteraly, translate it into
1916 TRANS @c an idiomatic funny way of saying that the computer died. */
1917 -_S(ERR_MAP(EIEIO), N_("Computer bought the farm"))
1918 +_S(EIEIO, N_("Computer bought the farm"))
1920 #if defined (EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
1922 @@ -782,18 +779,18 @@ TRANS The values are always the same, on every operating system.
1924 TRANS C libraries in many older Unix systems have @code{EWOULDBLOCK} as a
1925 TRANS separate error code. */
1926 -_S(ERR_MAP(EWOULDBLOCK), N_("Operation would block"))
1927 +_S(EWOULDBLOCK, N_("Operation would block"))
1930 -_S(ERR_MAP(ENEEDAUTH), N_("Need authenticator"))
1931 +_S(ENEEDAUTH, N_("Need authenticator"))
1935 TRANS The experienced user will know what is wrong.
1936 TRANS @c This error code is a joke. Its perror text is part of the joke.
1937 TRANS @c Don't change it. */
1938 -_S(ERR_MAP(ED), N_("?"))
1942 -_S(ERR_MAP(EPROGUNAVAIL), N_("RPC program not available"))
1943 +_S(EPROGUNAVAIL, N_("RPC program not available"))
1945 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
1946 index 9b2a253032..34748ffcd1 100644
1947 --- a/sysdeps/unix/sysv/linux/Makefile
1948 +++ b/sysdeps/unix/sysv/linux/Makefile
1949 @@ -100,7 +100,7 @@ tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
1950 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
1951 test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
1952 tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
1954 + tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux
1955 tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
1957 CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
1958 diff --git a/sysdeps/unix/sysv/linux/aarch64/configure b/sysdeps/unix/sysv/linux/aarch64/configure
1959 index 27d50e1d3c..290670a67a 100644
1960 --- a/sysdeps/unix/sysv/linux/aarch64/configure
1961 +++ b/sysdeps/unix/sysv/linux/aarch64/configure
1962 @@ -6,10 +6,10 @@ arch_minimum_kernel=3.7.0
1963 test -n "$libc_cv_slibdir" ||
1966 - libc_cv_slibdir='/lib64'
1967 + libc_cv_slibdir='/lib'
1968 libc_cv_rtlddir='/lib'
1969 if test "$libdir" = '${exec_prefix}/lib'; then
1970 - libdir='${exec_prefix}/lib64';
1971 + libdir='${exec_prefix}/lib';
1972 # Locale data can be shared between 32-bit and 64-bit libraries.
1973 libc_cv_complocaledir='${exec_prefix}/lib/locale'
1975 diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
1976 index fc688450ee..00a4d0c8e7 100644
1977 --- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
1978 +++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
1980 && MIDR_PARTNUM(midr) == 0x000)
1981 #define IS_NEOVERSE_N1(midr) (MIDR_IMPLEMENTOR(midr) == 'A' \
1982 && MIDR_PARTNUM(midr) == 0xd0c)
1983 +#define IS_NEOVERSE_N2(midr) (MIDR_IMPLEMENTOR(midr) == 'A' \
1984 + && MIDR_PARTNUM(midr) == 0xd49)
1985 +#define IS_NEOVERSE_V1(midr) (MIDR_IMPLEMENTOR(midr) == 'A' \
1986 + && MIDR_PARTNUM(midr) == 0xd40)
1988 #define IS_EMAG(midr) (MIDR_IMPLEMENTOR(midr) == 'P' \
1989 && MIDR_PARTNUM(midr) == 0x000)
1990 diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c
1991 index 0776472d5e..a1f24ab242 100644
1992 --- a/sysdeps/unix/sysv/linux/msgctl.c
1993 +++ b/sysdeps/unix/sysv/linux/msgctl.c
1994 @@ -90,8 +90,15 @@ __msgctl64 (int msqid, int cmd, struct __msqid64_ds *buf)
1995 struct kernel_msqid64_ds ksemid, *arg = NULL;
1998 - msqid64_to_kmsqid64 (buf, &ksemid);
2000 + /* This is a Linux extension where kernel returns a 'struct msginfo'
2002 + if (cmd == IPC_INFO || cmd == MSG_INFO)
2003 + arg = (struct kernel_msqid64_ds *) buf;
2006 + msqid64_to_kmsqid64 (buf, &ksemid);
2010 # ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
2012 @@ -169,8 +176,15 @@ __msgctl (int msqid, int cmd, struct msqid_ds *buf)
2013 struct __msqid64_ds msqid64, *buf64 = NULL;
2016 - msqid_to_msqid64 (&msqid64, buf);
2018 + /* This is a Linux extension where kernel returns a 'struct msginfo'
2020 + if (cmd == IPC_INFO || cmd == MSG_INFO)
2021 + buf64 = (struct __msqid64_ds *) buf;
2024 + msqid_to_msqid64 (&msqid64, buf);
2029 int ret = __msgctl64 (msqid, cmd, buf64);
2030 diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c
2031 index f131a26fc7..1cdabde8f2 100644
2032 --- a/sysdeps/unix/sysv/linux/semctl.c
2033 +++ b/sysdeps/unix/sysv/linux/semctl.c
2034 @@ -102,6 +102,7 @@ semun64_to_ksemun64 (int cmd, union semun64 semun64,
2035 r.array = semun64.array;
2038 + case SEM_STAT_ANY:
2042 @@ -150,6 +151,7 @@ __semctl64 (int semid, int semnum, int cmd, ...)
2043 case IPC_STAT: /* arg.buf */
2046 + case SEM_STAT_ANY:
2047 case IPC_INFO: /* arg.__buf */
2050 @@ -238,6 +240,7 @@ semun_to_semun64 (int cmd, union semun semun, struct __semid64_ds *semid64)
2051 r.array = semun.array;
2054 + case SEM_STAT_ANY:
2058 @@ -267,6 +270,7 @@ __semctl (int semid, int semnum, int cmd, ...)
2059 case IPC_STAT: /* arg.buf */
2062 + case SEM_STAT_ANY:
2063 case IPC_INFO: /* arg.__buf */
2066 @@ -321,6 +325,7 @@ __semctl_mode16 (int semid, int semnum, int cmd, ...)
2067 case IPC_STAT: /* arg.buf */
2070 + case SEM_STAT_ANY:
2071 case IPC_INFO: /* arg.__buf */
2074 @@ -354,6 +359,7 @@ __old_semctl (int semid, int semnum, int cmd, ...)
2075 case IPC_STAT: /* arg.buf */
2078 + case SEM_STAT_ANY:
2079 case IPC_INFO: /* arg.__buf */
2082 diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c
2083 index 76d88441f1..1d19a798b1 100644
2084 --- a/sysdeps/unix/sysv/linux/shmctl.c
2085 +++ b/sysdeps/unix/sysv/linux/shmctl.c
2086 @@ -90,8 +90,15 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
2087 struct kernel_shmid64_ds kshmid, *arg = NULL;
2090 - shmid64_to_kshmid64 (buf, &kshmid);
2092 + /* This is a Linux extension where kernel expects either a
2093 + 'struct shminfo' (IPC_INFO) or 'struct shm_info' (SHM_INFO). */
2094 + if (cmd == IPC_INFO || cmd == SHM_INFO)
2095 + arg = (struct kernel_shmid64_ds *) buf;
2098 + shmid64_to_kshmid64 (buf, &kshmid);
2102 # ifdef __ASSUME_SYSVIPC_BROKEN_MODE_T
2104 @@ -107,7 +114,6 @@ __shmctl64 (int shmid, int cmd, struct __shmid64_ds *buf)
2112 @@ -168,8 +174,15 @@ __shmctl (int shmid, int cmd, struct shmid_ds *buf)
2113 struct __shmid64_ds shmid64, *buf64 = NULL;
2116 - shmid_to_shmid64 (&shmid64, buf);
2118 + /* This is a Linux extension where kernel expects either a
2119 + 'struct shminfo' (IPC_INFO) or 'struct shm_info' (SHM_INFO). */
2120 + if (cmd == IPC_INFO || cmd == SHM_INFO)
2121 + buf64 = (struct __shmid64_ds *) buf;
2124 + shmid_to_shmid64 (&shmid64, buf);
2129 int ret = __shmctl64 (shmid, cmd, buf64);
2130 @@ -178,7 +191,6 @@ __shmctl (int shmid, int cmd, struct shmid_ds *buf)
2138 diff --git a/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c b/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c
2139 new file mode 100644
2140 index 0000000000..630f4f792c
2142 +++ b/sysdeps/unix/sysv/linux/tst-sysvmsg-linux.c
2144 +/* Basic tests for Linux SYSV message queue extensions.
2145 + Copyright (C) 2020 Free Software Foundation, Inc.
2146 + This file is part of the GNU C Library.
2148 + The GNU C Library is free software; you can redistribute it and/or
2149 + modify it under the terms of the GNU Lesser General Public
2150 + License as published by the Free Software Foundation; either
2151 + version 2.1 of the License, or (at your option) any later version.
2153 + The GNU C Library is distributed in the hope that it will be useful,
2154 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2155 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2156 + Lesser General Public License for more details.
2158 + You should have received a copy of the GNU Lesser General Public
2159 + License along with the GNU C Library; if not, see
2160 + <https://www.gnu.org/licenses/>. */
2162 +#include <sys/ipc.h>
2163 +#include <sys/msg.h>
2165 +#include <stdlib.h>
2166 +#include <stdbool.h>
2169 +#include <support/check.h>
2170 +#include <support/temp_file.h>
2172 +#define MSGQ_MODE 0644
2174 +/* These are for the temporary file we generate. */
2181 + /* Enforce message queue removal in case of early test failure.
2182 + Ignore error since the msg may already have being removed. */
2183 + msgctl (msqid, IPC_RMID, NULL);
2187 +do_prepare (int argc, char *argv[])
2189 + TEST_VERIFY_EXIT (create_temp_file ("tst-sysvmsg.", &name) != -1);
2192 +#define PREPARE do_prepare
2194 +struct test_msginfo
2201 +/* It tries to obtain some system-wide SysV messsage queue information from
2202 + /proc to check against IPC_INFO/MSG_INFO. The /proc only returns the
2203 + tunables value of MSGMAX, MSGMNB, and MSGMNI.
2205 + The kernel also returns constant value for MSGSSZ, MSGSEG and also MSGMAP,
2206 + MSGPOOL, and MSGTQL (for IPC_INFO). The issue to check them is they might
2207 + change over kernel releases. */
2210 +read_proc_file (const char *file)
2212 + FILE *f = fopen (file, "r");
2214 + FAIL_UNSUPPORTED ("/proc is not mounted or %s is not available", file);
2217 + int r = fscanf (f, "%d", & v);
2218 + TEST_VERIFY_EXIT (r == 1);
2225 +/* Check if the message queue with IDX (index into the kernel's internal
2226 + array) matches the one with KEY. The CMD is either MSG_STAT or
2230 +check_msginfo (int idx, key_t key, int cmd)
2232 + struct msqid_ds msginfo;
2233 + int mid = msgctl (idx, cmd, &msginfo);
2234 + /* Ignore unused array slot returned by the kernel or information from
2235 + unknown message queue. */
2236 + if ((mid == -1 && errno == EINVAL) || mid != msqid)
2240 + FAIL_EXIT1 ("msgctl with %s failed: %m",
2241 + cmd == MSG_STAT ? "MSG_STAT" : "MSG_STAT_ANY");
2243 + TEST_COMPARE (msginfo.msg_perm.__key, key);
2244 + TEST_COMPARE (msginfo.msg_perm.mode, MSGQ_MODE);
2245 + TEST_COMPARE (msginfo.msg_qnum, 0);
2253 + atexit (remove_msq);
2255 + key_t key = ftok (name, 'G');
2257 + FAIL_EXIT1 ("ftok failed: %m");
2259 + msqid = msgget (key, MSGQ_MODE | IPC_CREAT);
2261 + FAIL_EXIT1 ("msgget failed: %m");
2263 + struct test_msginfo tipcinfo;
2264 + tipcinfo.msgmax = read_proc_file ("/proc/sys/kernel/msgmax");
2265 + tipcinfo.msgmnb = read_proc_file ("/proc/sys/kernel/msgmnb");
2266 + tipcinfo.msgmni = read_proc_file ("/proc/sys/kernel/msgmni");
2271 + struct msginfo ipcinfo;
2272 + msqidx = msgctl (msqid, IPC_INFO, (struct msqid_ds *) &ipcinfo);
2274 + FAIL_EXIT1 ("msgctl with IPC_INFO failed: %m");
2276 + TEST_COMPARE (ipcinfo.msgmax, tipcinfo.msgmax);
2277 + TEST_COMPARE (ipcinfo.msgmnb, tipcinfo.msgmnb);
2278 + TEST_COMPARE (ipcinfo.msgmni, tipcinfo.msgmni);
2281 + /* Same as before but with MSG_INFO. */
2283 + struct msginfo ipcinfo;
2284 + msqidx = msgctl (msqid, MSG_INFO, (struct msqid_ds *) &ipcinfo);
2286 + FAIL_EXIT1 ("msgctl with IPC_INFO failed: %m");
2288 + TEST_COMPARE (ipcinfo.msgmax, tipcinfo.msgmax);
2289 + TEST_COMPARE (ipcinfo.msgmnb, tipcinfo.msgmnb);
2290 + TEST_COMPARE (ipcinfo.msgmni, tipcinfo.msgmni);
2293 + /* We check if the created message queue shows in global list. */
2294 + bool found = false;
2295 + for (int i = 0; i <= msqidx; i++)
2297 + /* We can't tell apart if MSG_STAT_ANY is not supported (kernel older
2298 + than 4.17) or if the index used is invalid. So it just check if the
2299 + value returned from a valid call matches the created message
2301 + check_msginfo (i, key, MSG_STAT_ANY);
2303 + if (check_msginfo (i, key, MSG_STAT))
2311 + FAIL_EXIT1 ("msgctl with MSG_STAT/MSG_STAT_ANY could not find the "
2312 + "created message queue");
2314 + if (msgctl (msqid, IPC_RMID, NULL) == -1)
2315 + FAIL_EXIT1 ("msgctl failed");
2320 +#include <support/test-driver.c>
2321 diff --git a/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c b/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c
2322 new file mode 100644
2323 index 0000000000..45f19e2d37
2325 +++ b/sysdeps/unix/sysv/linux/tst-sysvsem-linux.c
2327 +/* Basic tests for Linux SYSV semaphore extensions.
2328 + Copyright (C) 2020 Free Software Foundation, Inc.
2329 + This file is part of the GNU C Library.
2331 + The GNU C Library is free software; you can redistribute it and/or
2332 + modify it under the terms of the GNU Lesser General Public
2333 + License as published by the Free Software Foundation; either
2334 + version 2.1 of the License, or (at your option) any later version.
2336 + The GNU C Library is distributed in the hope that it will be useful,
2337 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2338 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2339 + Lesser General Public License for more details.
2341 + You should have received a copy of the GNU Lesser General Public
2342 + License along with the GNU C Library; if not, see
2343 + <https://www.gnu.org/licenses/>. */
2345 +#include <sys/ipc.h>
2346 +#include <sys/sem.h>
2348 +#include <stdlib.h>
2349 +#include <stdbool.h>
2352 +#include <support/check.h>
2353 +#include <support/temp_file.h>
2355 +/* These are for the temporary file we generate. */
2362 + /* Enforce message queue removal in case of early test failure.
2363 + Ignore error since the sem may already have being removed. */
2364 + semctl (semid, 0, IPC_RMID, 0);
2368 +do_prepare (int argc, char *argv[])
2370 + TEST_VERIFY_EXIT (create_temp_file ("tst-sysvsem.", &name) != -1);
2373 +#define PREPARE do_prepare
2375 +#define SEM_MODE 0644
2380 + struct semid_ds *buf;
2381 + unsigned short *array;
2382 + struct seminfo *__buf;
2385 +struct test_seminfo
2393 +/* It tries to obtain some system-wide SysV semaphore information from /proc
2394 + to check against IPC_INFO/SEM_INFO. The /proc only returns the tunables
2395 + value of SEMMSL, SEMMNS, SEMOPM, and SEMMNI.
2397 + The kernel also returns constant value for SEMVMX, SEMMNU, SEMMAP, SEMUME,
2398 + and also SEMUSZ and SEMAEM (for IPC_INFO). The issue to check them is they
2399 + might change over kernel releases. */
2402 +read_sem_stat (struct test_seminfo *tseminfo)
2404 + FILE *f = fopen ("/proc/sys/kernel/sem", "r");
2406 + FAIL_UNSUPPORTED ("/proc is not mounted or /proc/sys/kernel/sem is not "
2409 + int r = fscanf (f, "%d %d %d %d",
2410 + &tseminfo->semmsl, &tseminfo->semmns, &tseminfo->semopm,
2411 + &tseminfo->semmni);
2412 + TEST_VERIFY_EXIT (r == 4);
2418 +/* Check if the semaphore with IDX (index into the kernel's internal array)
2419 + matches the one with KEY. The CMD is either SEM_STAT or SEM_STAT_ANY. */
2422 +check_seminfo (int idx, key_t key, int cmd)
2424 + struct semid_ds seminfo;
2425 + int sid = semctl (idx, 0, cmd, (union semun) { .buf = &seminfo });
2426 + /* Ignore unused array slot returned by the kernel or information from
2427 + unknown semaphores. */
2428 + if ((sid == -1 && errno == EINVAL) || sid != semid)
2432 + FAIL_EXIT1 ("semctl with SEM_STAT failed (errno=%d)", errno);
2434 + TEST_COMPARE (seminfo.sem_perm.__key, key);
2435 + TEST_COMPARE (seminfo.sem_perm.mode, SEM_MODE);
2436 + TEST_COMPARE (seminfo.sem_nsems, 1);
2444 + atexit (remove_sem);
2446 + key_t key = ftok (name, 'G');
2448 + FAIL_EXIT1 ("ftok failed: %m");
2450 + semid = semget (key, 1, IPC_CREAT | IPC_EXCL | SEM_MODE);
2452 + FAIL_EXIT1 ("semget failed: %m");
2454 + struct test_seminfo tipcinfo;
2455 + read_sem_stat (&tipcinfo);
2460 + struct seminfo ipcinfo;
2461 + semidx = semctl (semid, 0, IPC_INFO, (union semun) { .__buf = &ipcinfo });
2463 + FAIL_EXIT1 ("semctl with IPC_INFO failed: %m");
2465 + TEST_COMPARE (ipcinfo.semmsl, tipcinfo.semmsl);
2466 + TEST_COMPARE (ipcinfo.semmns, tipcinfo.semmns);
2467 + TEST_COMPARE (ipcinfo.semopm, tipcinfo.semopm);
2468 + TEST_COMPARE (ipcinfo.semmni, tipcinfo.semmni);
2471 + /* Same as before but with SEM_INFO. */
2473 + struct seminfo ipcinfo;
2474 + semidx = semctl (semid, 0, SEM_INFO, (union semun) { .__buf = &ipcinfo });
2476 + FAIL_EXIT1 ("semctl with IPC_INFO failed: %m");
2478 + TEST_COMPARE (ipcinfo.semmsl, tipcinfo.semmsl);
2479 + TEST_COMPARE (ipcinfo.semmns, tipcinfo.semmns);
2480 + TEST_COMPARE (ipcinfo.semopm, tipcinfo.semopm);
2481 + TEST_COMPARE (ipcinfo.semmni, tipcinfo.semmni);
2484 + /* We check if the created semaphore shows in the system-wide status. */
2485 + bool found = false;
2486 + for (int i = 0; i <= semidx; i++)
2488 + /* We can't tell apart if SEM_STAT_ANY is not supported (kernel older
2489 + than 4.17) or if the index used is invalid. So it just check if
2490 + value returned from a valid call matches the created semaphore. */
2491 + check_seminfo (i, key, SEM_STAT_ANY);
2493 + if (check_seminfo (i, key, SEM_STAT))
2501 + FAIL_EXIT1 ("semctl with SEM_STAT/SEM_STAT_ANY could not find the "
2502 + "created semaphore");
2504 + if (semctl (semid, 0, IPC_RMID, 0) == -1)
2505 + FAIL_EXIT1 ("semctl failed: %m");
2510 +#include <support/test-driver.c>
2511 diff --git a/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c b/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c
2512 new file mode 100644
2513 index 0000000000..7128ae2e14
2515 +++ b/sysdeps/unix/sysv/linux/tst-sysvshm-linux.c
2517 +/* Basic tests for Linux SYSV shared memory extensions.
2518 + Copyright (C) 2020 Free Software Foundation, Inc.
2519 + This file is part of the GNU C Library.
2521 + The GNU C Library is free software; you can redistribute it and/or
2522 + modify it under the terms of the GNU Lesser General Public
2523 + License as published by the Free Software Foundation; either
2524 + version 2.1 of the License, or (at your option) any later version.
2526 + The GNU C Library is distributed in the hope that it will be useful,
2527 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2528 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2529 + Lesser General Public License for more details.
2531 + You should have received a copy of the GNU Lesser General Public
2532 + License along with the GNU C Library; if not, see
2533 + <https://www.gnu.org/licenses/>. */
2535 +#include <sys/ipc.h>
2536 +#include <sys/shm.h>
2538 +#include <stdlib.h>
2539 +#include <stdbool.h>
2541 +#include <unistd.h>
2542 +#include <inttypes.h>
2543 +#include <limits.h>
2545 +#include <support/check.h>
2546 +#include <support/temp_file.h>
2548 +#define SHM_MODE 0644
2550 +/* These are for the temporary file we generate. */
2553 +static long int pgsz;
2558 + /* Enforce message queue removal in case of early test failure.
2559 + Ignore error since the shm may already have being removed. */
2560 + shmctl (shmid, IPC_RMID, NULL);
2564 +do_prepare (int argc, char *argv[])
2566 + TEST_VERIFY_EXIT (create_temp_file ("tst-sysvshm.", &name) != -1);
2569 +#define PREPARE do_prepare
2571 +struct test_shminfo
2573 + unsigned long int shmall;
2574 + unsigned long int shmmax;
2575 + unsigned long int shmmni;
2578 +/* It tries to obtain some system-wide SysV shared memory information from
2579 + /proc to check against IPC_INFO/SHM_INFO. The /proc only returns the
2580 + tunables value of SHMALL, SHMMAX, and SHMMNI. */
2583 +read_proc_file (const char *file)
2585 + FILE *f = fopen (file, "r");
2587 + FAIL_UNSUPPORTED ("/proc is not mounted or %s is not available", file);
2589 + /* Handle 32-bit binaries running on 64-bit kernels. */
2591 + int r = fscanf (f, "%" SCNu64, &v);
2592 + TEST_VERIFY_EXIT (r == 1);
2599 +/* Check if the message queue with IDX (index into the kernel's internal
2600 + array) matches the one with KEY. The CMD is either SHM_STAT or
2604 +check_shminfo (int idx, key_t key, int cmd)
2606 + struct shmid_ds shminfo;
2607 + int sid = shmctl (idx, cmd, &shminfo);
2608 + /* Ignore unused array slot returned by the kernel or information from
2609 + unknown message queue. */
2610 + if ((sid == -1 && errno == EINVAL) || sid != shmid)
2614 + FAIL_EXIT1 ("shmctl with %s failed: %m",
2615 + cmd == SHM_STAT ? "SHM_STAT" : "SHM_STAT_ANY");
2617 + TEST_COMPARE (shminfo.shm_perm.__key, key);
2618 + TEST_COMPARE (shminfo.shm_perm.mode, SHM_MODE);
2619 + TEST_COMPARE (shminfo.shm_segsz, pgsz);
2627 + atexit (remove_shm);
2629 + pgsz = sysconf (_SC_PAGESIZE);
2631 + FAIL_EXIT1 ("sysconf (_SC_PAGESIZE) failed: %m");
2633 + key_t key = ftok (name, 'G');
2635 + FAIL_EXIT1 ("ftok failed: %m");
2637 + shmid = shmget (key, pgsz, IPC_CREAT | IPC_EXCL | SHM_MODE);
2639 + FAIL_EXIT1 ("shmget failed: %m");
2641 + struct test_shminfo tipcinfo;
2643 + uint64_t v = read_proc_file ("/proc/sys/kernel/shmmax");
2644 +#if LONG_MAX == INT_MAX
2645 + /* Kernel explicit clamp the value for shmmax on compat symbol (32-bit
2646 + binaries running on 64-bit kernels). */
2650 + tipcinfo.shmmax = v;
2652 + tipcinfo.shmall = read_proc_file ("/proc/sys/kernel/shmall");
2653 + tipcinfo.shmmni = read_proc_file ("/proc/sys/kernel/shmmni");
2657 + /* Note: SHM_INFO does not return a shminfo, but rather a 'struct shm_info'.
2658 + It is tricky to verify its values since the syscall returns system wide
2659 + resources consumed by shared memory. The shmctl implementation handles
2660 + SHM_INFO as IPC_INFO, so the IPC_INFO test should validate SHM_INFO as
2664 + struct shminfo ipcinfo;
2665 + shmidx = shmctl (shmid, IPC_INFO, (struct shmid_ds *) &ipcinfo);
2667 + FAIL_EXIT1 ("shmctl with IPC_INFO failed: %m");
2669 + TEST_COMPARE (ipcinfo.shmall, tipcinfo.shmall);
2670 + TEST_COMPARE (ipcinfo.shmmax, tipcinfo.shmmax);
2671 + TEST_COMPARE (ipcinfo.shmmni, tipcinfo.shmmni);
2674 + /* We check if the created shared memory shows in the global list. */
2675 + bool found = false;
2676 + for (int i = 0; i <= shmidx; i++)
2678 + /* We can't tell apart if SHM_STAT_ANY is not supported (kernel older
2679 + than 4.17) or if the index used is invalid. So it just check if
2680 + value returned from a valid call matches the created message
2682 + check_shminfo (i, key, SHM_STAT_ANY);
2684 + if (check_shminfo (i, key, SHM_STAT))
2692 + FAIL_EXIT1 ("shmctl with SHM_STAT/SHM_STAT_ANY could not find the "
2693 + "created shared memory");
2695 + if (shmctl (shmid, IPC_RMID, NULL) == -1)
2696 + FAIL_EXIT1 ("shmctl failed");
2701 +#include <support/test-driver.c>
2702 diff --git a/sysdeps/unix/sysv/linux/x86_64/64/configure b/sysdeps/unix/sysv/linux/x86_64/64/configure
2703 index 9d298faba7..cef1ec842c 100644
2704 --- a/sysdeps/unix/sysv/linux/x86_64/64/configure
2705 +++ b/sysdeps/unix/sysv/linux/x86_64/64/configure
2707 test -n "$libc_cv_slibdir" ||
2710 - libc_cv_slibdir='/lib64'
2711 - libc_cv_rtlddir='/lib64'
2712 + libc_cv_slibdir='/lib'
2713 + libc_cv_rtlddir='/lib'
2714 if test "$libdir" = '${exec_prefix}/lib'; then
2715 - libdir='${exec_prefix}/lib64';
2716 + libdir='${exec_prefix}/lib';
2717 # Locale data can be shared between 32-bit and 64-bit libraries.
2718 libc_cv_complocaledir='${exec_prefix}/lib/locale'
2720 diff --git a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
2721 index 062c04689d..7783757726 100644
2722 --- a/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
2723 +++ b/sysdeps/unix/sysv/linux/x86_64/ldconfig.h
2725 #include <sysdeps/generic/ldconfig.h>
2727 #define SYSDEP_KNOWN_INTERPRETER_NAMES \
2728 - { "/lib/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
2729 + { "/lib32/ld-linux.so.2", FLAG_ELF_LIBC6 }, \
2730 { "/libx32/ld-linux-x32.so.2", FLAG_ELF_LIBC6 }, \
2731 - { "/lib64/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
2732 + { "/lib/ld-linux-x86-64.so.2", FLAG_ELF_LIBC6 },
2733 #define SYSDEP_KNOWN_LIBRARY_NAMES \
2734 { "libc.so.6", FLAG_ELF_LIBC6 }, \
2735 { "libm.so.6", FLAG_ELF_LIBC6 },
2736 diff --git a/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed b/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
2737 index 44d76e8aa1..7d6cb1e20b 100644
2738 --- a/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
2739 +++ b/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
2741 /LD_TRACE_LOADED_OBJECTS=1/a\
2742 add_env="$add_env LD_LIBRARY_VERSION=\\$verify_out"
2743 -s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ ]*$_\1"\2\4\6 \264\4-x86-64\6 \2x32\4-x32\6"_
2744 +s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ ]*$_\1"\232\4\6 \2\4-x86-64\6 \2x32\4-x32\6"_
2745 diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
2746 index 7659758972..e5fd5ac9cb 100644
2747 --- a/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
2748 +++ b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h
2749 @@ -32,7 +32,7 @@ IFUNC_SELECTOR (void)
2750 && CPU_FEATURE_USABLE_P (cpu_features, AVX2))
2751 return OPTIMIZE (fma);
2753 - if (CPU_FEATURE_USABLE_P (cpu_features, FMA))
2754 + if (CPU_FEATURE_USABLE_P (cpu_features, FMA4))
2755 return OPTIMIZE (fma4);
2757 return OPTIMIZE (sse2);
2758 diff --git a/sysvipc/test-sysvsem.c b/sysvipc/test-sysvsem.c
2759 index 01dbff343a..b7284e0b48 100644
2760 --- a/sysvipc/test-sysvsem.c
2761 +++ b/sysvipc/test-sysvsem.c
2766 +#include <stdbool.h>
2767 #include <sys/types.h>
2768 #include <sys/ipc.h>
2769 #include <sys/sem.h>
2770 diff --git a/version.h b/version.h
2771 index 83cd196798..e6ca7a8857 100644
2775 /* This file just defines the current version number of libc. */
2777 -#define RELEASE "release"
2778 +#define RELEASE "stable"
2779 #define VERSION "2.32"