Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/tty.c
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
#include <sys/tty.h> | #include <sys/tty.h> | ||||
#include <sys/ttycom.h> | #include <sys/ttycom.h> | ||||
#define TTYDEFCHARS | #define TTYDEFCHARS | ||||
#include <sys/ttydefaults.h> | #include <sys/ttydefaults.h> | ||||
#undef TTYDEFCHARS | #undef TTYDEFCHARS | ||||
#include <sys/ucred.h> | #include <sys/ucred.h> | ||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#include <fs/devfs/devfs.h> | |||||
#include <machine/stdarg.h> | #include <machine/stdarg.h> | ||||
static MALLOC_DEFINE(M_TTY, "tty", "tty device"); | static MALLOC_DEFINE(M_TTY, "tty", "tty device"); | ||||
static void tty_rel_free(struct tty *tp); | static void tty_rel_free(struct tty *tp); | ||||
static TAILQ_HEAD(, tty) tty_list = TAILQ_HEAD_INITIALIZER(tty_list); | static TAILQ_HEAD(, tty) tty_list = TAILQ_HEAD_INITIALIZER(tty_list); | ||||
static struct sx tty_list_sx; | static struct sx tty_list_sx; | ||||
▲ Show 20 Lines • Show All 1,173 Lines • ▼ Show 20 Lines | tty_drop_ctty(struct tty *tp, struct proc *p) | ||||
* these at the devfs layer, but we can't necessarily know that we were | * these at the devfs layer, but we can't necessarily know that we were | ||||
* invoked on the vnode referenced in the session (i.e. the vnode we | * invoked on the vnode referenced in the session (i.e. the vnode we | ||||
* hold a reference to). We explicitly don't check VBAD/VIRF_DOOMED here | * hold a reference to). We explicitly don't check VBAD/VIRF_DOOMED here | ||||
* to avoid a vnode leak -- in circumstances elsewhere where we'd hit a | * to avoid a vnode leak -- in circumstances elsewhere where we'd hit a | ||||
* VIRF_DOOMED vnode, release has been deferred until the controlling TTY | * VIRF_DOOMED vnode, release has been deferred until the controlling TTY | ||||
* is either changed or released. | * is either changed or released. | ||||
*/ | */ | ||||
if (vp != NULL) | if (vp != NULL) | ||||
vrele(vp); | devfs_ctty_unref(vp); | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Exposing information about current TTY's through sysctl | * Exposing information about current TTY's through sysctl | ||||
*/ | */ | ||||
static void | static void | ||||
▲ Show 20 Lines • Show All 1,159 Lines • Show Last 20 Lines |