Lines Matching defs:stp
249 sess_ctty_clear(sess_t *sp, stdata_t *stp)
257 ASSERT(MUTEX_HELD(&stp->sd_lock) && MUTEX_HELD(&pidlock) &&
267 stp->sd_pgidp = NULL;
268 stp->sd_sidp = NULL;
272 sess_ctty_set(proc_t *p, sess_t *sp, stdata_t *stp)
277 ASSERT(MUTEX_HELD(&stp->sd_lock) && MUTEX_HELD(&pidlock) &&
288 sp->s_vp = makectty(stp->sd_vnode);
293 stp->sd_flag |= STRISTTY; /* just to be sure */
294 stp->sd_sidp = sp->s_sidp;
295 stp->sd_pgidp = sp->s_sidp;
299 strctty(stdata_t *stp)
306 * We are going to try to make stp the default ctty for the session
317 mutex_enter(&stp->sd_lock); /* protects sd_pgidp/sd_sidp */
323 if (((stp->sd_flag & (STRHUP|STRDERR|STWRERR|STPLEX)) != 0) ||
324 (stp->sd_sidp != NULL) || /* stp already ctty? */
330 mutex_exit(&stp->sd_lock);
351 mutex_exit(&stp->sd_lock);
363 sess_ctty_set(p, sp, stp);
368 mutex_exit(&stp->sd_lock);
388 stdata_t *stp;
404 stp = sp->s_vp->v_stream;
411 * due to locking order we have to grab stp->sd_lock before
415 * the current ctty (vp) there by making sp or stp invalid.
416 * (a VN_HOLD on vp won't protect stp because that only
425 sp->s_cnt++; /* protect vp and stp */
434 mutex_enter(&stp->sd_lock); /* protects sd_pgidp/sd_sidp */
452 mutex_exit(&stp->sd_lock);
464 ASSERT(stp == sp->s_vp->v_stream);
477 *stpp = stp;
489 freectty_signal(proc_t *p, sess_t *sp, stdata_t *stp, boolean_t at_exit)
492 ASSERT(MUTEX_HELD(&stp->sd_lock) && MUTEX_HELD(&pidlock) &&
504 * don't want sp or stp to be freed. (see the comment in
508 sp->s_cnt++; /* protect vp and stp */
517 pgsignal(stp->sd_pgidp, SIGHUP);
520 if (!(stp->sd_flag & STRHUP))
521 strhup(stp);
523 mutex_exit(&stp->sd_lock);
536 stdata_t *stp;
555 if (!freectty_lock(p, &sp, &vp, &stp, at_exit))
558 if (freectty_signal(p, sp, stp, at_exit)) {
589 mutex_exit(&stp->sd_lock);
626 pgidp = stp->sd_pgidp;
627 sidp = stp->sd_sidp;
630 sess_ctty_clear(sp, stp);
643 mutex_exit(&stp->sd_lock);