-
Notifications
You must be signed in to change notification settings - Fork 175
csignalライブラリページの追加 #1578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
csignalライブラリページの追加 #1578
Conversation
|
⚡ プレビュー (HTML) (更新時刻: 2026-01-18 23:44:32 JST) 変更記事一覧5件の記事が変更されました。
※ソース (.md) に直接変更のあった記事を列挙しています。グローバル修飾や変換規則の変更による変化は考慮していません。 |
| int main () | ||
| { | ||
| std::signal(SIGINT, signal_handler); | ||
| while(!flag){ | ||
| //処理 | ||
| } | ||
| if (flag){ | ||
| std::cout << "catch SIGINT" << std::endl; | ||
| } | ||
| return 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| int main () | |
| { | |
| std::signal(SIGINT, signal_handler); | |
| while(!flag){ | |
| //処理 | |
| } | |
| if (flag){ | |
| std::cout << "catch SIGINT" << std::endl; | |
| } | |
| return 0; | |
| } | |
| int main () | |
| { | |
| std::signal(SIGINT, signal_handler); | |
| while (!flag) { | |
| // 処理 | |
| } | |
| if (flag) { | |
| std::cout << "caught SIGINT" << std::endl; | |
| } | |
| return 0; | |
| } |
| while(!flag){ | ||
| //処理 | ||
| } | ||
| if(flag) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| while(!flag){ | |
| //処理 | |
| } | |
| if(flag) | |
| { | |
| while (!flag) { | |
| // 処理 | |
| } | |
| if (flag) { |
| } | ||
| if(flag) | ||
| { | ||
| std::cout << "catch SIGINT" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| std::cout << "catch SIGINT" << std::endl; | |
| std::cout << "caught SIGINT" << std::endl; |
| using sig_atomic_t = integer-type; | ||
| } | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| ```cpp | ||
| namespace std{ | ||
| signal-handler* signal(int sig, signal-handler func); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| signal-handler* signal(int sig, signal-handler func); | |
| extern "C" using signal-handler = void(int); // exposition only | |
| signal-handler* signal(int sig, signal-handler* func); |
| namespace std{ | ||
| signal-handler* signal(int sig, signal-handler func); | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ``` | |
| ``` | |
| * signal-handler[italic] |
| ``` | ||
| ## 概要 | ||
| プログラムにシグナルを送信する。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| プログラムにシグナルを送信する。 | |
| 現在のプログラムにシグナルを送信する。 |
| また、以下の処理以外の動作をシグナルハンドラ内で行うとき、その動作は未定義。 | ||
| - `volatile std::sig_atomic_t`への単純な読み書き | ||
| - `_Exit`関数と`abort`関数 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この部分沢山抜けている気がするのですが、C23 7.14.2.1/p5 を参照して書き直せますか。
すみません
レビューお願いします