Print this page
onc plus-be-gone


2210         if (tdp != NULL && tdp->sc_sigblock)
2211                 return ((p->p_sig.__sigbits[0] | t->t_sig.__sigbits[0]) &
2212                     CANTMASK0);
2213 #else
2214 #error "fix me: CANTMASK1 and CANTMASK2 are not zero"
2215 #endif
2216 
2217 /* see uts/common/sys/signal.h for why this must be true */
2218 #if ((MAXSIG > (2 * 32)) && (MAXSIG <= (3 * 32)))
2219         return (((p->p_sig.__sigbits[0] | t->t_sig.__sigbits[0]) &
2220             ~t->t_hold.__sigbits[0]) |
2221             ((p->p_sig.__sigbits[1] | t->t_sig.__sigbits[1]) &
2222             ~t->t_hold.__sigbits[1]) |
2223             (((p->p_sig.__sigbits[2] | t->t_sig.__sigbits[2]) &
2224             ~t->t_hold.__sigbits[2]) & FILLSET2));
2225 #else
2226 #error "fix me: MAXSIG out of bounds"
2227 #endif
2228 }
2229 
2230 /* ONC_PLUS EXTRACT START */
2231 void
2232 sigintr(k_sigset_t *smask, int intable)
2233 {
2234         proc_t *p;
2235         int owned;
2236         k_sigset_t lmask;               /* local copy of cantmask */
2237         klwp_t *lwp = ttolwp(curthread);
2238 
2239         /*
2240          * Mask out all signals except SIGHUP, SIGINT, SIGQUIT
2241          *    and SIGTERM. (Preserving the existing masks).
2242          *    This function supports the -intr nfs and ufs mount option.
2243          */
2244 
2245         /*
2246          * don't do kernel threads
2247          */
2248         if (lwp == NULL)
2249                 return;
2250 


2287                 sigdelset(&curthread->t_hold, SIGHUP);
2288         if (!sigismember(smask, SIGINT) && intable)
2289                 sigdelset(&curthread->t_hold, SIGINT);
2290         if (!sigismember(smask, SIGQUIT))
2291                 sigdelset(&curthread->t_hold, SIGQUIT);
2292         if (!sigismember(smask, SIGTERM))
2293                 sigdelset(&curthread->t_hold, SIGTERM);
2294 
2295         /*
2296          * release access to signal mask
2297          */
2298         if (!owned)
2299                 mutex_exit(&p->p_lock);
2300 
2301         /*
2302          * Indicate that this lwp is not to be stopped.
2303          */
2304         lwp->lwp_nostop++;
2305 
2306 }
2307 /* ONC_PLUS EXTRACT END */
2308 
2309 void
2310 sigunintr(k_sigset_t *smask)
2311 {
2312         proc_t *p;
2313         int owned;
2314         klwp_t *lwp = ttolwp(curthread);
2315 
2316         /*
2317          * Reset previous mask (See sigintr() above)
2318          */
2319         if (lwp != NULL) {
2320                 lwp->lwp_nostop--;   /* restore lwp stoppability */
2321                 p = ttoproc(curthread);
2322                 owned = mutex_owned(&p->p_lock); /* this is filthy */
2323                 if (!owned)
2324                         mutex_enter(&p->p_lock);
2325                 curthread->t_hold = *smask;
2326                 /* so unmasked signals will be seen */
2327                 curthread->t_sig_check = 1;




2210         if (tdp != NULL && tdp->sc_sigblock)
2211                 return ((p->p_sig.__sigbits[0] | t->t_sig.__sigbits[0]) &
2212                     CANTMASK0);
2213 #else
2214 #error "fix me: CANTMASK1 and CANTMASK2 are not zero"
2215 #endif
2216 
2217 /* see uts/common/sys/signal.h for why this must be true */
2218 #if ((MAXSIG > (2 * 32)) && (MAXSIG <= (3 * 32)))
2219         return (((p->p_sig.__sigbits[0] | t->t_sig.__sigbits[0]) &
2220             ~t->t_hold.__sigbits[0]) |
2221             ((p->p_sig.__sigbits[1] | t->t_sig.__sigbits[1]) &
2222             ~t->t_hold.__sigbits[1]) |
2223             (((p->p_sig.__sigbits[2] | t->t_sig.__sigbits[2]) &
2224             ~t->t_hold.__sigbits[2]) & FILLSET2));
2225 #else
2226 #error "fix me: MAXSIG out of bounds"
2227 #endif
2228 }
2229 

2230 void
2231 sigintr(k_sigset_t *smask, int intable)
2232 {
2233         proc_t *p;
2234         int owned;
2235         k_sigset_t lmask;               /* local copy of cantmask */
2236         klwp_t *lwp = ttolwp(curthread);
2237 
2238         /*
2239          * Mask out all signals except SIGHUP, SIGINT, SIGQUIT
2240          *    and SIGTERM. (Preserving the existing masks).
2241          *    This function supports the -intr nfs and ufs mount option.
2242          */
2243 
2244         /*
2245          * don't do kernel threads
2246          */
2247         if (lwp == NULL)
2248                 return;
2249 


2286                 sigdelset(&curthread->t_hold, SIGHUP);
2287         if (!sigismember(smask, SIGINT) && intable)
2288                 sigdelset(&curthread->t_hold, SIGINT);
2289         if (!sigismember(smask, SIGQUIT))
2290                 sigdelset(&curthread->t_hold, SIGQUIT);
2291         if (!sigismember(smask, SIGTERM))
2292                 sigdelset(&curthread->t_hold, SIGTERM);
2293 
2294         /*
2295          * release access to signal mask
2296          */
2297         if (!owned)
2298                 mutex_exit(&p->p_lock);
2299 
2300         /*
2301          * Indicate that this lwp is not to be stopped.
2302          */
2303         lwp->lwp_nostop++;
2304 
2305 }

2306 
2307 void
2308 sigunintr(k_sigset_t *smask)
2309 {
2310         proc_t *p;
2311         int owned;
2312         klwp_t *lwp = ttolwp(curthread);
2313 
2314         /*
2315          * Reset previous mask (See sigintr() above)
2316          */
2317         if (lwp != NULL) {
2318                 lwp->lwp_nostop--;   /* restore lwp stoppability */
2319                 p = ttoproc(curthread);
2320                 owned = mutex_owned(&p->p_lock); /* this is filthy */
2321                 if (!owned)
2322                         mutex_enter(&p->p_lock);
2323                 curthread->t_hold = *smask;
2324                 /* so unmasked signals will be seen */
2325                 curthread->t_sig_check = 1;