linux下的SIGINT的作用,linux c sigint等信号不存在,该如何处理

本文解析了Linux下信号处理机制,解答了为何在/usr/include/signal.h中未直接定义SIGINT和SIGOUT等信号的问题,并展示了实际的信号定义列表。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

linux c sigint等信号不存在

在linux下。/usr/include/signal.h

中为什么没有定义SIGINT和SIGOUT这些信号呢?kill -l也显示没有

请问这是咋回事啊?

------解决方案--------------------

/usr/include/signal.h里面有

#include 

/usr/include/bits/signum.h:

/* Signal number definitions.  Linux version.

Copyright (C) 1995,1996,1997,1998,1999,2003 Free Software Foundation, Inc.

This file is part of the GNU C Library.

The GNU C Library is free software; you can redistribute it and/or

modify it under the terms of the GNU Lesser General Public

License as published by the Free Software Foundation; either

version 2.1 of the License, or (at your option) any later version.

The GNU C Library is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public

License along with the GNU C Library; if not, write to the Free

Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA

02111-1307 USA.  */

#ifdef_SIGNAL_H

/* Fake signal functions.  */

#define SIG_ERR((__sighandler_t) -1)/* Error return.  */

#define SIG_DFL((__sighandler_t) 0)/* Default action.  */

#define SIG_IGN((__sighandler_t) 1)/* Ignore signal.  */

#ifdef __USE_UNIX98

# define SIG_HOLD((__sighandler_t) 2)/* Add signal to hold mask.  */

#endif

/* Signals.  */

#defineSIGHUP1/* Hangup (POSIX).  */

#defineSIGINT2/* Interrupt (ANSI).  */

#defineSIGQUIT3/* Quit (POSIX).  */

#defineSIGILL4/* Illegal instruction (ANSI).  */

#defineSIGTRAP5/* Trace trap (POSIX).  */

#defineSIGABRT6/* Abort (ANSI).  */

#defineSIGIOT6/* IOT trap (4.2 BSD).  */

#defineSIGBUS7/* BUS error (4.2 BSD).  */

#defineSIGFPE8/* Floating-point exception (ANSI).  */

#defineSIGKILL9/* Kill, unblockable (POSIX).  */

#defineSIGUSR110/* User-defined signal 1 (POSIX).  */

#defineSIGSEGV11/* Segmentation violation (ANSI).  */

#defineSIGUSR212/* User-defined signal 2 (POSIX).  */

#defineSIGPIPE13/* Broken pipe (POSIX).  */

#defineSIGALRM14/* Alarm clock (POSIX).  */

#defineSIGTERM15/* Termination (ANSI).  */

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值