thr_sigprocmask.c (13546) | thr_sigprocmask.c (22315) |
---|---|
1/* 2 * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 40 unchanged lines hidden (view full) --- 49 } 50 /* Check if a new signal set was provided by the caller: */ 51 if (set != NULL) { 52 /* Block signals while the signal mask is changed: */ 53 _thread_kern_sig_block(&status); 54 55 /* Process according to what to do: */ 56 switch (how) { | 1/* 2 * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 40 unchanged lines hidden (view full) --- 49 } 50 /* Check if a new signal set was provided by the caller: */ 51 if (set != NULL) { 52 /* Block signals while the signal mask is changed: */ 53 _thread_kern_sig_block(&status); 54 55 /* Process according to what to do: */ 56 switch (how) { |
57 /* Block signals: */ | 57 /* Block signals: */ |
58 case SIG_BLOCK: 59 /* Add signals to the existing mask: */ 60 _thread_run->sigmask |= *set; 61 break; 62 | 58 case SIG_BLOCK: 59 /* Add signals to the existing mask: */ 60 _thread_run->sigmask |= *set; 61 break; 62 |
63 /* Unblock signals: */ | 63 /* Unblock signals: */ |
64 case SIG_UNBLOCK: 65 /* Clear signals from the existing mask: */ 66 _thread_run->sigmask &= ~(*set); 67 break; 68 | 64 case SIG_UNBLOCK: 65 /* Clear signals from the existing mask: */ 66 _thread_run->sigmask &= ~(*set); 67 break; 68 |
69 /* Set the signal process mask: */ | 69 /* Set the signal process mask: */ |
70 case SIG_SETMASK: 71 /* Set the new mask: */ 72 _thread_run->sigmask = *set; 73 break; 74 | 70 case SIG_SETMASK: 71 /* Set the new mask: */ 72 _thread_run->sigmask = *set; 73 break; 74 |
75 /* Trap invalid actions: */ | 75 /* Trap invalid actions: */ |
76 default: 77 /* Return an invalid argument: */ | 76 default: 77 /* Return an invalid argument: */ |
78 _thread_seterrno(_thread_run, EINVAL); | 78 errno = EINVAL; |
79 ret = -1; 80 break; 81 } 82 83 /* 84 * Schedule the next thread in case there are signals that 85 * now need to be acted on: 86 */ 87 _thread_kern_sched(NULL); 88 } 89 /* Return the completion status: */ 90 return (ret); 91} 92#endif | 79 ret = -1; 80 break; 81 } 82 83 /* 84 * Schedule the next thread in case there are signals that 85 * now need to be acted on: 86 */ 87 _thread_kern_sched(NULL); 88 } 89 /* Return the completion status: */ 90 return (ret); 91} 92#endif |