* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
+/** @file lib/signame.c
+ * @brief Signal names
+ */
#include "common.h"
#include <signal.h>
#include "table.h"
#include "signame.h"
+/** @brief Mapping between signal names and numbers */
static const struct sigtable {
+ /** @brief Signal number */
int signal;
+
+ /* @brief Signal name ("SIGwhatever") */
const char *name;
} signals[] = {
#define S(sig) { sig, #sig }
#undef S
};
+/** @brief Map a signal name to its number
+ * @param s Signal name e.g. "SIGINT"
+ * @return Signal value or -1 if not found
+ */
int find_signal(const char *s) {
int n;