Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/libbb/u_signal_names.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/libbb/u_signal_names.c
r2725 r3232 7 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 8 */ 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. 9 16 10 17 #include "libbb.h" … … 118 125 [SIGSYS ] = "SYS", 119 126 #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 120 137 }; 121 138 … … 135 152 return i; 136 153 137 #if ENABLE_DESKTOP && (defined(SIGIOT) || defined(SIGIO)) 154 #if ENABLE_DESKTOP 155 # if defined(SIGIOT) || defined(SIGIO) 138 156 /* SIGIO[T] are aliased to other names, 139 157 * thus cannot be stored in the signals[] array. 140 158 * Need special code to recognize them */ 141 159 if ((name[0] | 0x20) == 'i' && (name[1] | 0x20) == 'o') { 142 # ifdef SIGIO160 # ifdef SIGIO 143 161 if (!name[2]) 144 162 return SIGIO; 145 # endif146 # ifdef SIGIOT163 # endif 164 # ifdef SIGIOT 147 165 if ((name[2] | 0x20) == 't' && !name[3]) 148 166 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 151 202 #endif 152 203 … … 176 227 const char *name = signals[signo]; 177 228 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 180 236 }
Note:
See TracChangeset
for help on using the changeset viewer.