]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
getlimits: print SIGRTMIN and SIGRTMAX
authorCollin Funk <collin.funk1@gmail.com>
Sat, 27 Dec 2025 01:52:58 +0000 (17:52 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Sun, 28 Dec 2025 01:03:39 +0000 (17:03 -0800)
* 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.

src/getlimits.c

index db44967e765e7d8cdff7467be495e6b061792ffd..4177d9ee0f974043badf55156e4fb324d2534393 100644 (file)
@@ -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>
 # 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;