summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCollin Funk <collin.funk1@gmail.com>2025-12-26 17:52:58 -0800
committerCollin Funk <collin.funk1@gmail.com>2025-12-27 17:03:39 -0800
commit7e1b4f76d3f07a11edb8d5babc7a078aefdd2ba0 (patch)
treec68108d02dca4089c0488d229041dd4682fbc9fb /src
parent1902c97d67b59435549f966b8d9886f2454429eb (diff)
downloadcoreutils-7e1b4f76d3f07a11edb8d5babc7a078aefdd2ba0.tar.gz
coreutils-7e1b4f76d3f07a11edb8d5babc7a078aefdd2ba0.zip
getlimits: print SIGRTMIN and SIGRTMAX
* src/getlimits.c (SIGRTMIN): Define to zero if signal.h does not define this constant. (SIGRTMAX): Define to SIGRTMIN - 1 if signal.h does not define this constant. (main): Print SIGRTMIN and SIGRTMAX.
Diffstat (limited to 'src')
-rw-r--r--src/getlimits.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/getlimits.c b/src/getlimits.c
index db44967e7..4177d9ee0 100644
--- a/src/getlimits.c
+++ b/src/getlimits.c
@@ -17,6 +17,7 @@
/* Written by Pádraig Brady */
#include <config.h> /* sets _FILE_OFFSET_BITS=64 etc. */
+#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
#include <float.h>
@@ -54,6 +55,14 @@
# define OFF64_T_MIN TYPE_MINIMUM (off64_t)
#endif
+#ifndef SIGRTMIN
+# define SIGRTMIN 0
+# undef SIGRTMAX
+#endif
+#ifndef SIGRTMAX
+# define SIGRTMAX (SIGRTMIN - 1)
+#endif
+
/* These are not interesting to print.
* Instead of these defines it would be nice to be able to do
* #ifdef (TYPE##_MIN) in function macro below. */
@@ -179,6 +188,8 @@ main (int argc, char **argv)
print_float (LDBL);
/* Other useful constants */
+ printf ("SIGRTMIN=%jd\n", (intmax_t) SIGRTMIN);
+ printf ("SIGRTMAX=%jd\n", (intmax_t) SIGRTMAX);
printf ("IO_BUFSIZE=%ju\n", (uintmax_t) IO_BUFSIZE);
return EXIT_SUCCESS;