pty.c (142709) | pty.c (144389) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/kern/tty_pty.c 142709 2005-02-27 22:02:03Z phk $"); | 33__FBSDID("$FreeBSD: head/sys/kern/tty_pty.c 144389 2005-03-31 12:19:44Z phk $"); |
34 35/* 36 * Pseudo-teletype Driver 37 * (Actually two drivers, requiring two entries in 'cdevsw') 38 */ 39#include "opt_compat.h" 40#include "opt_tty.h" 41#include <sys/param.h> --- 663 unchanged lines hidden (view full) --- 705 if (name[4] >= '0' && name[4] <= '9') 706 u += name[4] - '0'; 707 else if (name[4] >= 'a' && name[4] <= 'v') 708 u += name[4] - 'a' + 10; 709 else 710 return; 711 *dev = make_dev(&ptc_cdevsw, u, 712 UID_ROOT, GID_WHEEL, 0666, "pty%c%r", names[u / 32], u % 32); | 34 35/* 36 * Pseudo-teletype Driver 37 * (Actually two drivers, requiring two entries in 'cdevsw') 38 */ 39#include "opt_compat.h" 40#include "opt_tty.h" 41#include <sys/param.h> --- 663 unchanged lines hidden (view full) --- 705 if (name[4] >= '0' && name[4] <= '9') 706 u += name[4] - '0'; 707 else if (name[4] >= 'a' && name[4] <= 'v') 708 u += name[4] - 'a' + 10; 709 else 710 return; 711 *dev = make_dev(&ptc_cdevsw, u, 712 UID_ROOT, GID_WHEEL, 0666, "pty%c%r", names[u / 32], u % 32); |
713 dev_ref(*dev); |
|
713 (*dev)->si_flags |= SI_CHEAPCLONE; 714 return; 715} 716 717static void 718ptc_drvinit(void *unused) 719{ 720 721 EVENTHANDLER_REGISTER(dev_clone, pty_clone, 0, 1000); 722} 723 724SYSINIT(ptcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,ptc_drvinit,NULL) | 714 (*dev)->si_flags |= SI_CHEAPCLONE; 715 return; 716} 717 718static void 719ptc_drvinit(void *unused) 720{ 721 722 EVENTHANDLER_REGISTER(dev_clone, pty_clone, 0, 1000); 723} 724 725SYSINIT(ptcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,ptc_drvinit,NULL) |