]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdio-common/psiginfo.c
localedata: add new locales scn_IT
[thirdparty/glibc.git] / stdio-common / psiginfo.c
index 9701fcd8a7ab297fbbac765f66e37facb41337a5..ee38d4e0a11ed01772f43abb070f2f9690121104 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2012 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2024 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,8 +13,9 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
+#include <array_length.h>
 #include <errno.h>
 #include <libintl.h>
 #include <signal.h>
@@ -60,7 +61,7 @@ void
 psiginfo (const siginfo_t *pinfo, const char *s)
 {
   char buf[512];
-  FILE *fp = fmemopen (buf, sizeof (buf), "w");
+  FILE *fp = __fmemopen (buf, sizeof (buf), "w");
   if (fp == NULL)
     {
       const char *colon;
@@ -79,7 +80,7 @@ psiginfo (const siginfo_t *pinfo, const char *s)
 
   const char *desc;
   if (pinfo->si_signo >= 0 && pinfo->si_signo < NSIG
-      && ((desc = _sys_siglist[pinfo->si_signo]) != NULL
+      && ((desc = __sys_siglist[pinfo->si_signo]) != NULL
 #ifdef SIGRTMIN
          || (pinfo->si_signo >= SIGRTMIN && pinfo->si_signo < SIGRTMAX)
 #endif
@@ -116,7 +117,7 @@ psiginfo (const siginfo_t *pinfo, const char *s)
        case sig:                                                             \
          base = C(codestrs_, sig).str;                                       \
          offarr = C (codes_, sig);                                           \
-         offarr_len = sizeof (C (codes_, sig)) / sizeof (C (codes_, sig)[0]);\
+         offarr_len = array_length (C (codes_, sig));                        \
          break
 
          H (SIGILL);
@@ -199,5 +200,5 @@ Signal generated by the completion of an I/O request");
 
   fclose (fp);
 
-  write_not_cancel (STDERR_FILENO, buf, strlen (buf));
+  __write_nocancel (STDERR_FILENO, buf, strlen (buf));
 }