1 / 5

Sigprocmask

Sigprocmask. Siv & Daisy. int sigprocmask  ( int how, const sigset_t *restrict set, sigset_t *restrict oldset ). How : (how the signal mask is changed) SIG_BLOCK: block the signal in set SIG_UNBLOCK: unblock the signal in set SIG_SETMASK: use set for mask, and ignore the previous one.

truda
Download Presentation

Sigprocmask

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sigprocmask Siv&Daisy

  2. intsigprocmask (int how, constsigset_t *restrict set, sigset_t *restrict oldset) • How:(howthesignalmaskischanged) SIG_BLOCK:blockthesignalinset SIG_UNBLOCK:unblockthesignalinset SIG_SETMASK:usesetformask,andignorethepreviousone

  3. intsigprocmask (int how, constsigset_t *restrict set, sigset_t *restrict oldset) • Set:(thesignalmask) • Null:nochangetothesignalmask(howisignored) • Oldset:(to return information about the old process signal mask ) • Null:ifwanttodonothingaboutit • Non-null: previous valueofsignalmaskisstored • Returnvalue: • 0:success;-1error

  4. Assume that the old blocking list was {SIGSEGV, SIGSUSP} sigset_t x; sigemptyset (&x); sigaddset(&x, SIGUSR1); sigprocmask(SIG_BLOCK,&x, NULL) • EX w/t old_set: blocking list will now be:{SIGSEGV, SIGSUSP, SIGUSR1} sigprocmask(SIG_UNBLOCK, &x, NULL) blocking list will go back : {SIGSEGV, SIGSUSP} sigprocmask(SIG_SETMASK, &x, NULL) blocking list will now be set to {SIGUSR1}

  5. EXwithOld_set sigset_ty; sigprocmask(SIG_BLOCK, &x, &y) Ynowbecomes:{SIGSEGV,SIGSUSP} Blocklist:{SIGSEGV, SIGSUSP, SIGUSR1} sigprocmask(SIG_UNBLOCK, &x, &y) Y nowbecomes:{SIGSEGV, SIGSUSP, SIGUSR1} Blocklist:{SIGSEGV, SIGSUSP} sigprocmask(SIG_SET, &x, &y) Y nowbecomes:{SIGSEGV, SIGSUSP} Blocklist:{SIGUSR1}

More Related