Sigprocmask
This presentation is the property of its rightful owner.
Sponsored Links
1 / 5

Sigprocmask PowerPoint PPT Presentation


  • 131 Views
  • Uploaded on
  • Presentation posted in: General

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.

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.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


  • Sigprocmask

    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}


    Sigprocmask

    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}


  • Login