FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/lock.h>
#include <sys/condvar.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/filio.h>
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/malloc.h>
#include <sys/poll.h>
#include <sys/proc.h>
#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/serial.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/systm.h>
#include <sys/tty.h>
#include <sys/ttycom.h>
#include <machine/stdarg.h>
Go to the source code of this file.
Data Structures | |
struct | pts_softc |
Macros | |
#define | PTS_COMPAT |
#define | PTS_EXTERNAL |
#define | PTS_LINUX |
#define | PTS_PKT 0x1 /* Packet mode. */ |
#define | PTS_FINISHED 0x2 /* Return errors on read()/write(). */ |
Functions | |
__FBSDID ("$BSDSUniX$") | |
static | MALLOC_DEFINE (M_PTS,"pts","pseudo tty device") |
static int | ptsdev_read (struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) |
static int | ptsdev_write (struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) |
static int | ptsdev_truncate (struct file *fp, off_t length, struct ucred *active_cred, struct thread *td) |
static int | ptsdev_ioctl (struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) |
static int | ptsdev_poll (struct file *fp, int events, struct ucred *active_cred, struct thread *td) |
static void | pts_kqops_read_detach (struct knote *kn) |
static int | pts_kqops_read_event (struct knote *kn, long hint) |
static void | pts_kqops_write_detach (struct knote *kn) |
static int | pts_kqops_write_event (struct knote *kn, long hint) |
static int | ptsdev_kqfilter (struct file *fp, struct knote *kn) |
static int | ptsdev_stat (struct file *fp, struct stat *sb, struct ucred *active_cred, struct thread *td) |
static int | ptsdev_close (struct file *fp, struct thread *td) |
static void | ptsdrv_outwakeup (struct tty *tp) |
static void | ptsdrv_inwakeup (struct tty *tp) |
static int | ptsdrv_open (struct tty *tp) |
static void | ptsdrv_close (struct tty *tp) |
static void | ptsdrv_pktnotify (struct tty *tp, char event) |
static void | ptsdrv_free (void *softc) |
int | pts_alloc (int fflags, struct thread *td, struct file *fp) |
int | pts_alloc_external (int fflags, struct thread *td, struct file *fp, struct cdev *dev, const char *name) |
int | sys_posix_openpt (struct thread *td, struct posix_openpt_args *uap) |
static void | pts_init (void *unused) |
SYSINIT (pts, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, pts_init, NULL) | |
Variables | |
static struct unrhdr * | pts_pool |
static struct filterops | pts_kqops_read |
static struct filterops | pts_kqops_write |
static struct fileops | ptsdev_ops |
static struct ttydevsw | pts_class |
#define PTS_FINISHED 0x2 /* Return errors on read()/write(). */ |
Definition at line 89 of file tty_pts.c.
Referenced by pts_kqops_read_event(), pts_kqops_write_event(), ptsdev_ioctl(), ptsdev_poll(), ptsdev_read(), ptsdev_write(), ptsdrv_close(), and ptsdrv_open().
#define PTS_PKT 0x1 /* Packet mode. */ |
Definition at line 88 of file tty_pts.c.
Referenced by ptsdev_ioctl(), ptsdev_poll(), and ptsdev_read().
__FBSDID | ( | "$BSDSUniX$" | ) |
|
static |
int pts_alloc | ( | int | fflags, |
struct thread * | td, | ||
struct file * | fp | ||
) |
Definition at line 719 of file tty_pts.c.
References alloc_unr(), chgptscnt(), crhold(), cv_init(), finit(), knlist_init_mtx(), lim_cur(), malloc(), pts_class, pts_softc::pts_cred, pts_softc::pts_inpoll, pts_softc::pts_inwait, pts_softc::pts_outpoll, pts_softc::pts_outwait, pts_softc::pts_unit, ptsdev_ops, racct_add(), racct_sub(), tty_alloc(), and tty_makedev().
Referenced by sys_posix_openpt().
int pts_alloc_external | ( | int | fflags, |
struct thread * | td, | ||
struct file * | fp, | ||
struct cdev * | dev, | ||
const char * | name | ||
) |
Definition at line 772 of file tty_pts.c.
References chgptscnt(), crhold(), cv_init(), finit(), knlist_init_mtx(), lim_cur(), malloc(), pts_softc::pts_cdev, pts_class, pts_softc::pts_cred, pts_softc::pts_inpoll, pts_softc::pts_inwait, pts_softc::pts_outpoll, pts_softc::pts_outwait, pts_softc::pts_unit, ptsdev_ops, racct_add(), racct_sub(), tty_alloc(), and tty_makedev().
|
static |
Definition at line 851 of file tty_pts.c.
References new_unrhdr().
|
static |
Definition at line 444 of file tty_pts.c.
References knlist_remove(), and pts_softc::pts_outpoll.
|
static |
Definition at line 454 of file tty_pts.c.
References PTS_FINISHED, pts_softc::pts_flags, and ttydisc_getc_poll().
|
static |
Definition at line 470 of file tty_pts.c.
References knlist_remove(), and pts_softc::pts_inpoll.
|
static |
Definition at line 480 of file tty_pts.c.
References PTS_FINISHED, pts_softc::pts_flags, and ttydisc_rint_poll().
|
static |
Definition at line 571 of file tty_pts.c.
References tty_rel_gone(), and vnops.
|
static |
Definition at line 264 of file tty_pts.c.
References PTS_FINISHED, pts_softc::pts_flags, PTS_PKT, pts_softc::pts_unit, tty_ioctl(), tty_signal_pgrp(), and ttydisc_getc_poll().
|
static |
Definition at line 507 of file tty_pts.c.
References knlist_add(), pts_softc::pts_inpoll, pts_kqops_read, pts_kqops_write, and pts_softc::pts_outpoll.
|
static |
Definition at line 389 of file tty_pts.c.
References PTS_FINISHED, pts_softc::pts_flags, pts_softc::pts_inpoll, pts_softc::pts_outpoll, PTS_PKT, pts_softc::pts_pkt, selrecord(), ttydisc_getc_poll(), and ttydisc_rint_poll().
|
static |
Definition at line 109 of file tty_pts.c.
References PTS_FINISHED, pts_softc::pts_flags, pts_softc::pts_outwait, PTS_PKT, pts_softc::pts_pkt, ttydisc_getc_poll(), ttydisc_getc_uio(), and ureadc().
|
static |
Definition at line 534 of file tty_pts.c.
References pts_softc::pts_cdev, and tty_udev().
|
static |
|
static |
Definition at line 183 of file tty_pts.c.
References PTS_FINISHED, pts_softc::pts_flags, pts_softc::pts_inwait, ttydisc_rint_done(), ttydisc_rint_simple(), and uiomove().
|
static |
Definition at line 640 of file tty_pts.c.
References PTS_FINISHED, pts_softc::pts_flags, ptsdrv_inwakeup(), and ptsdrv_outwakeup().
|
static |
Definition at line 679 of file tty_pts.c.
References chgptscnt(), crfree(), destroy_dev_sched(), free(), free_unr(), knlist_destroy(), pts_softc::pts_cdev, pts_softc::pts_cred, pts_softc::pts_inpoll, pts_softc::pts_outpoll, pts_softc::pts_unit, racct_sub_cred(), and seldrain().
|
static |
Definition at line 620 of file tty_pts.c.
References pts_softc::pts_inpoll, pts_softc::pts_inwait, and selwakeup().
Referenced by ptsdrv_close().
|
static |
Definition at line 630 of file tty_pts.c.
References PTS_FINISHED, and pts_softc::pts_flags.
|
static |
Definition at line 610 of file tty_pts.c.
References pts_softc::pts_outpoll, pts_softc::pts_outwait, and selwakeup().
Referenced by ptsdrv_close(), and ptsdrv_pktnotify().
|
static |
Definition at line 651 of file tty_pts.c.
References pts_softc::pts_pkt, and ptsdrv_outwakeup().
int sys_posix_openpt | ( | struct thread * | td, |
struct posix_openpt_args * | uap | ||
) |
SYSINIT | ( | pts | , |
SI_SUB_DRIVERS | , | ||
SI_ORDER_MIDDLE | , | ||
pts_init | , | ||
NULL | |||
) |
|
static |
Definition at line 705 of file tty_pts.c.
Referenced by pts_alloc(), and pts_alloc_external().
|
static |
Definition at line 495 of file tty_pts.c.
Referenced by ptsdev_kqfilter().
|
static |
Definition at line 500 of file tty_pts.c.
Referenced by ptsdev_kqfilter().
|
static |
Definition at line 591 of file tty_pts.c.
Referenced by pts_alloc(), and pts_alloc_external().