MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ptsdev_close

Function ptsdev_close

freebsd/kern/tty_pts.c:574–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

572}
573
574static int
575ptsdev_close(struct file *fp, struct thread *td)
576{
577 struct tty *tp = fp->f_data;
578
579 /* Deallocate TTY device. */
580 tty_lock(tp);
581 tty_rel_gone(tp);
582
583 /*
584 * Open of /dev/ptmx or /dev/ptyXX changes the type of file
585 * from DTYPE_VNODE to DTYPE_PTS. vn_open() increases vnode
586 * use count, we need to decrement it, and possibly do other
587 * required cleanup.
588 */
589 if (fp->f_vnode != NULL)
590 return (vnops.fo_close(fp, td));
591
592 return (0);
593}
594
595static int
596ptsdev_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)

Callers

nothing calls this directly

Calls 1

tty_rel_goneFunction · 0.85

Tested by

no test coverage detected