Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/libbb/u_signal_names.c

    r2725 r3232  
    77 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88 */
     9
     10//config:config FEATURE_RTMINMAX
     11//config:   bool "Support RTMIN[+n] and RTMAX[-n] signal names"
     12//config:   default y
     13//config:   help
     14//config:     Support RTMIN[+n] and RTMAX[-n] signal names
     15//config:     in kill, killall etc. This costs ~250 bytes.
    916
    1017#include "libbb.h"
     
    118125    [SIGSYS   ] = "SYS",
    119126#endif
     127#if ENABLE_FEATURE_RTMINMAX
     128# ifdef __SIGRTMIN
     129    [__SIGRTMIN] = "RTMIN",
     130# endif
     131// This makes array about x2 bigger.
     132// More compact approach is to special-case SIGRTMAX in print_signames()
     133//# ifdef __SIGRTMAX
     134//  [__SIGRTMAX] = "RTMAX",
     135//# endif
     136#endif
    120137};
    121138
     
    135152            return i;
    136153
    137 #if ENABLE_DESKTOP && (defined(SIGIOT) || defined(SIGIO))
     154#if ENABLE_DESKTOP
     155# if defined(SIGIOT) || defined(SIGIO)
    138156    /* SIGIO[T] are aliased to other names,
    139157     * thus cannot be stored in the signals[] array.
    140158     * Need special code to recognize them */
    141159    if ((name[0] | 0x20) == 'i' && (name[1] | 0x20) == 'o') {
    142 #ifdef SIGIO
     160#  ifdef SIGIO
    143161        if (!name[2])
    144162            return SIGIO;
    145 #endif
    146 #ifdef SIGIOT
     163#  endif
     164#  ifdef SIGIOT
    147165        if ((name[2] | 0x20) == 't' && !name[3])
    148166            return SIGIOT;
    149 #endif
    150     }
     167#  endif
     168    }
     169# endif
     170#endif
     171
     172#if ENABLE_FEATURE_RTMINMAX
     173# if defined(SIGRTMIN) && defined(SIGRTMAX)
     174/* libc may use some rt sigs for pthreads and therefore "remap" SIGRTMIN/MAX,
     175 * but we want to use "raw" SIGRTMIN/MAX. Underscored names, if exist, provide
     176 * them. If they don't exist, fall back to non-underscored ones: */
     177#  if !defined(__SIGRTMIN)
     178#   define __SIGRTMIN SIGRTMIN
     179#  endif
     180#  if !defined(__SIGRTMAX)
     181#   define __SIGRTMAX SIGRTMAX
     182#  endif
     183    if (strncasecmp(name, "RTMIN", 5) == 0) {
     184        if (!name[5])
     185            return __SIGRTMIN;
     186        if (name[5] == '+') {
     187            i = bb_strtou(name + 6, NULL, 10);
     188            if (!errno && i <= __SIGRTMAX - __SIGRTMIN)
     189                return __SIGRTMIN + i;
     190        }
     191    }
     192    else if (strncasecmp(name, "RTMAX", 5) == 0) {
     193        if (!name[5])
     194            return __SIGRTMAX;
     195        if (name[5] == '-') {
     196            i = bb_strtou(name + 6, NULL, 10);
     197            if (!errno && i <= __SIGRTMAX - __SIGRTMIN)
     198                return __SIGRTMAX - i;
     199        }
     200    }
     201# endif
    151202#endif
    152203
     
    176227        const char *name = signals[signo];
    177228        if (name[0])
    178             puts(name);
    179     }
     229            printf("%2u) %s\n", signo, name);
     230    }
     231#if ENABLE_FEATURE_RTMINMAX
     232# ifdef __SIGRTMAX
     233    printf("%2u) %s\n", __SIGRTMAX, "RTMAX");
     234# endif
     235#endif
    180236}
Note: See TracChangeset for help on using the changeset viewer.