gsignalのヘルプ・マニュアル
日本語 英語
gsignal --help
man gsignal
GSIGNAL(3) Linux Programmer’s Manual GSIGNAL(3)
名前
gsignal, ssignal - ソフトウェア・シグナル機能
書式
#include
typedef void (*sighandler_t)(int);
int gsignal(int signum);
sighandler_t ssignal(int signum, sighandler_t action);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
gsignal(), ssignal(): _SVID_SOURCE
説明
Linux ではこれらの関数を使用しないこと。過去に間違いがあり、Linux では
gsignal() と ssignal() はそれぞれ raise(3) と signal(2) の別名になっ て
いる。
一 方 、System V 風のシステムでは、これらの関数で、従来の signal(2) や
kill(2) の関数群とは完全に独立な、ソフトウェア・シグナリングを実現し て
い る 。 ssignal() 関数は、番号 signum のソフトウェア・シグナルが gsig-
nal() 関数を使って発生された時にとるべきアクションを定義す る 。 gsig-
nal() の返り値は、一つ前に指定されていたアクション、もしくは SIG_DFL で
ある。 gsignal() は以下のような動作を行う: signum に対してアクション が
指定されていないか、アクション SIG_DFL が指定されていた場合、何もせずに
0 を返す。 signum に対して アクション SIG_IGN が指定されていた場合、 何
も せずに 1 を返す。それ以外の場合、アクションを SIG_DFL にリセットし、
引き数に signum を指定してアクション関数を呼び出して、アクション関数 の
返 り値を返す。 signum がとり得る値の範囲は実装により異なる (多くの場合
1〜15 か 1〜17 である)。
準拠
これらの関数は、AIX, DG/UX, HP-UX, SCO, Solaris, Tru64 で使用可能である
。 こ れ ら のシステムのほとんどで廃止されたことになっており、 Linux の
libc および glibc では正しく実装されていない。 gsignal_r() と ssig-
nal_r() が実装されているシステムもある。
関連項目
kill(2), signal(2), raise(3)
2007-07-26 GSIGNAL(3)
GSIGNAL(3) Linux Programmer’s Manual GSIGNAL(3)
NAME
gsignal, ssignal - software signal facility
SYNOPSIS
#include
typedef void (*sighandler_t)(int);
int gsignal(intsignum);
sighandler_t ssignal(int signum, sighandler_t action);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
gsignal(), ssignal(): _SVID_SOURCE
DESCRIPTION
Don’t use these functions under Linux. Due to a historical mistake,
under Linux these functions are aliases for raise(3) and signal(2),
respectively.
Elsewhere, on System V-like systems, these functions implement software
signaling, entirely independent of the classical signal(2) and kill(2)
functions. The function ssignal() defines the action to take when the
software signal with number signum is raised using the function gsig-
nal(), and returns the previous such action or SIG_DFL. The function
gsignal() does the following: if no action (or the action SIG_DFL) was
specified for signum, then it does nothing and returns 0. If the
action SIG_IGN was specified for signum, then it does nothing and
returns 1. Otherwise, it resets the action to SIG_DFL and calls the
action function with argument signum, and returns the value returned by
that function. The range of possible values signum varies (often 1-15
or 1-17).
CONFORMING TO
These functions are available under AIX, DG/UX, HP-UX, SCO, Solaris,
Tru64. They are called obsolete under most of these systems, and are
broken under Linux libc and glibc. Some systems also have gsignal_r()
and ssignal_r().
SEE ALSO
kill(2), signal(2), raise(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2007-07-26 GSIGNAL(3)