Skip to content
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

Readline signal handling #4

Open
1 of 3 tasks
moromin opened this issue Sep 13, 2021 · 2 comments
Open
1 of 3 tasks

Readline signal handling #4

moromin opened this issue Sep 13, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@moromin
Copy link
Collaborator

moromin commented Sep 13, 2021

目的

以下のシグナルハンドリングを実装する。

  • Crtl - C (SIGINT)
  • Crtl - D (EOF)
  • Crtl - \ (SIGQUIT) → signal(SIGQUIT, &SIG_IGN) == SIG_ERR

参考サイト

@moromin moromin added the enhancement New feature or request label Sep 13, 2021
@moromin
Copy link
Collaborator Author

moromin commented Oct 18, 2021

Ctrl-C(SIGINT)が入力された際には、終了ステータスがEXIT_FAILUREになる。

$ # <- Input Ctrl-C
$ echo $?
1

@moromin
Copy link
Collaborator Author

moromin commented Oct 21, 2021

こんな感じで行けるか?
環境変数更新のタイミングは要検証

while(1)
{
    if (g_signal == SIGINT)
        register_env_var_from_literal();
   ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants