Lines Matching defs:sess
904 struct session *sess;
906 for (sess = SESSHASH(sessid)->lh_first; sess != 0; sess = sess->s_hash.le_next)
907 if (sess->s_sid == sessid)
908 return (sess);
1004 struct session *sess;
1009 MALLOC_ZONE(sess, struct session *,
1011 if (sess == NULL)
1013 sess->s_leader = p;
1014 sess->s_sid = p->p_pid;
1015 sess->s_count = 1;
1016 sess->s_ttyvp = NULL;
1017 sess->s_ttyp = NULL;
1018 sess->s_flags = 0;
1019 sess->s_listflags = 0;
1020 sess->s_ttypgrpid = NO_PID;
1021 lck_mtx_init(&sess->s_mlock, proc_lck_grp, proc_lck_attr);
1022 bcopy(procsp->s_login, sess->s_login,
1023 sizeof(sess->s_login));
1026 LIST_INSERT_HEAD(SESSHASH(sess->s_sid), sess, s_hash);
1028 pgrp->pg_session = sess;
2299 session_lock(struct session * sess)
2301 lck_mtx_lock(&sess->s_mlock);
2306 session_unlock(struct session * sess)
2308 lck_mtx_unlock(&sess->s_mlock);
2360 struct session * sess = SESSION_NULL;
2373 if ((p->p_pgrp != PGRP_NULL) && ((sess = p->p_pgrp->pg_session) != SESSION_NULL)) {
2374 if ((sess->s_listflags & (S_LIST_TERM | S_LIST_DEAD)) != 0)
2376 sess->s_count++;
2379 return(sess);
2383 session_rele(struct session *sess)
2386 if (--sess->s_count == 0) {
2387 if ((sess->s_listflags & (S_LIST_TERM | S_LIST_DEAD)) != 0)
2389 sess->s_listflags |= S_LIST_TERM;
2390 LIST_REMOVE(sess, s_hash);
2391 sess->s_listflags |= S_LIST_DEAD;
2392 if (sess->s_count != 0)
2395 lck_mtx_destroy(&sess->s_mlock, proc_lck_grp);
2396 FREE_ZONE(sess, sizeof(struct session), M_SESSION);