2023-12-29 Paul Eggert <eggert@cs.ucla.edu>
+ tests: don’t skip if LONG_MAX < pid
+ * modules/pthread_sigmask-tests, modules/sigprocmask-tests:
+ (Depends-on): Add inttypes.
+ * tests/test-pthread_sigmask1.c, tests/test-sigprocmask.c:
+ Include inttypes.h.
+ (main): Don’t skip test if pid exceeds LONG_MAX.
+
Omit no-longer-needed pragmas
* lib/anytostr.c, lib/poll.c, lib/regex.c:
Omit pragmas that should no longer be needed.
tests/macros.h
Depends-on:
+inttypes
sleep
pthread-thread
tests/macros.h
Depends-on:
+inttypes
sleep
configure.ac:
SIGNATURE_CHECK (pthread_sigmask, int, (int, const sigset_t *, sigset_t *));
#include <errno.h>
-#include <limits.h>
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
main ()
{
sigset_t set;
- pid_t pid = getpid ();
+ intmax_t pid = getpid ();
char command[80];
- if (LONG_MAX < pid)
- {
- fputs ("Skipping test: pid too large\n", stderr);
- return 77;
- }
-
signal (SIGINT, sigint_handler);
sigemptyset (&set);
ASSERT (pthread_sigmask (SIG_BLOCK, &set, NULL) == 0);
/* Request a SIGINT signal from outside. */
- sprintf (command, "sh -c 'sleep 1; kill -INT %ld' &", (long) pid);
+ sprintf (command, "sh -c 'sleep 1; kill -INT %"PRIdMAX"' &", pid);
ASSERT (system (command) == 0);
/* Wait. */
SIGNATURE_CHECK (sigprocmask, int, (int, const sigset_t *, sigset_t *));
#include <errno.h>
-#include <limits.h>
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
main ()
{
sigset_t set;
- pid_t pid = getpid ();
+ intmax_t pid = getpid ();
char command[80];
- if (LONG_MAX < pid)
- {
- fputs ("Skipping test: pid too large\n", stderr);
- return 77;
- }
-
signal (SIGINT, sigint_handler);
sigemptyset (&set);
ASSERT (sigprocmask (SIG_BLOCK, &set, NULL) == 0);
/* Request a SIGINT signal from outside. */
- sprintf (command, "sh -c 'sleep 1; kill -INT %ld' &", (long) pid);
+ sprintf (command, "sh -c 'sleep 1; kill -INT %"PRIdMAX"' &", pid);
ASSERT (system (command) == 0);
/* Wait. */