sigprocmask
Download
Skip this Video
Download Presentation
Sigprocmask

Loading in 2 Seconds...

play fullscreen
1 / 5

Sigprocmask - PowerPoint PPT Presentation


  • 163 Views
  • Uploaded on

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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Sigprocmask' - truda


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
sigprocmask

Sigprocmask

Siv&Daisy

int sigprocmask int how const sigset t restrict set sigset t restrict oldset
intsigprocmask (int how, constsigset_t *restrict set, sigset_t *restrict oldset)
  • How:(howthesignalmaskischanged)

SIG_BLOCK:blockthesignalinset

SIG_UNBLOCK:unblockthesignalinset

SIG_SETMASK:usesetformask,andignorethepreviousone

int sigprocmask int how const sigset t restrict set sigset t restrict oldset1
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
slide4

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}

slide5

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}

ad