首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

linux c sigint等信号不存在,该如何处理

2013-01-06 
linux c sigint等信号不存在在linux下。/usr/include/signal.h中为什么没有定义SIGINT和SIGOUT这些信号呢?k

linux c sigint等信号不存在
在linux下。/usr/include/signal.h
中为什么没有定义SIGINT和SIGOUT这些信号呢?kill -l也显示没有
请问这是咋回事啊?
[解决办法]
/usr/include/signal.h里面有
#include <bits/signum.h>
/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).  */


#defineSIGSTKFLT16/* Stack fault.  */
#defineSIGCLDSIGCHLD/* Same as SIGCHLD (System V).  */
#defineSIGCHLD17/* Child status has changed (POSIX).  */
#defineSIGCONT18/* Continue (POSIX).  */
#defineSIGSTOP19/* Stop, unblockable (POSIX).  */
#defineSIGTSTP20/* Keyboard stop (POSIX).  */
#defineSIGTTIN21/* Background read from tty (POSIX).  */
#defineSIGTTOU22/* Background write to tty (POSIX).  */
#defineSIGURG23/* Urgent condition on socket (4.2 BSD).  */
#defineSIGXCPU24/* CPU limit exceeded (4.2 BSD).  */
#defineSIGXFSZ25/* File size limit exceeded (4.2 BSD).  */
#defineSIGVTALRM26/* Virtual alarm clock (4.2 BSD).  */
#defineSIGPROF27/* Profiling alarm clock (4.2 BSD).  */
#defineSIGWINCH28/* Window size change (4.3 BSD, Sun).  */
#defineSIGPOLLSIGIO/* Pollable event occurred (System V).  */
#defineSIGIO29/* I/O now possible (4.2 BSD).  */
#defineSIGPWR30/* Power failure restart (System V).  */
#define SIGSYS31/* Bad system call.  */
#define SIGUNUSED31

#define_NSIG65/* Biggest signal number + 1
   (including real-time signals).  */

#define SIGRTMIN        (__libc_current_sigrtmin ())
#define SIGRTMAX        (__libc_current_sigrtmax ())

/* These are the hard limits of the kernel.  These values should not be
   used directly at user level.  */
#define __SIGRTMIN32
#define __SIGRTMAX(_NSIG - 1)

#endif/* <signal.h> included.  */



[解决办法]
kill -l
 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL10) SIGUSR1
11) SIGSEGV12) SIGUSR213) SIGPIPE14) SIGALRM15) SIGTERM
16) SIGSTKFLT17) SIGCHLD18) SIGCONT19) SIGSTOP20) SIGTSTP
21) SIGTTIN22) SIGTTOU23) SIGURG24) SIGXCPU25) SIGXFSZ
26) SIGVTALRM27) SIGPROF28) SIGWINCH29) SIGIO30) SIGPWR
31) SIGSYS34) SIGRTMIN35) SIGRTMIN+136) SIGRTMIN+237) SIGRTMIN+3
38) SIGRTMIN+439) SIGRTMIN+540) SIGRTMIN+641) SIGRTMIN+742) SIGRTMIN+8
43) SIGRTMIN+944) SIGRTMIN+1045) SIGRTMIN+1146) SIGRTMIN+1247) SIGRTMIN+13
48) SIGRTMIN+1449) SIGRTMIN+1550) SIGRTMAX-1451) SIGRTMAX-1352) SIGRTMAX-12
53) SIGRTMAX-1154) SIGRTMAX-1055) SIGRTMAX-956) SIGRTMAX-857) SIGRTMAX-7
58) SIGRTMAX-659) SIGRTMAX-560) SIGRTMAX-461) SIGRTMAX-362) SIGRTMAX-2
63) SIGRTMAX-164) SIGRTMAX

热点排行