Deleted Added
full compact
tty_pts.c (191484) tty_pts.c (193018)
1/*-
2 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Portions of this software were developed under sponsorship from Snow
6 * B.V., the Netherlands.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Portions of this software were developed under sponsorship from Snow
6 * B.V., the Netherlands.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/kern/tty_pts.c 191484 2009-04-25 10:05:55Z ed $");
31__FBSDID("$FreeBSD: head/sys/kern/tty_pts.c 193018 2009-05-29 06:41:23Z ed $");
32
33#include "opt_tty.h"
34
35/* Add compatibility bits for FreeBSD. */
36#define PTS_COMPAT
37#ifdef DEV_PTY
38/* Add /dev/ptyXX compat bits. */
39#define PTS_EXTERNAL

--- 696 unchanged lines hidden (view full) ---

736 psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO);
737 cv_init(&psc->pts_inwait, "pts inwait");
738 cv_init(&psc->pts_outwait, "pts outwait");
739
740 psc->pts_unit = unit;
741 psc->pts_uidinfo = uid;
742 uihold(uid);
743
32
33#include "opt_tty.h"
34
35/* Add compatibility bits for FreeBSD. */
36#define PTS_COMPAT
37#ifdef DEV_PTY
38/* Add /dev/ptyXX compat bits. */
39#define PTS_EXTERNAL

--- 696 unchanged lines hidden (view full) ---

736 psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO);
737 cv_init(&psc->pts_inwait, "pts inwait");
738 cv_init(&psc->pts_outwait, "pts outwait");
739
740 psc->pts_unit = unit;
741 psc->pts_uidinfo = uid;
742 uihold(uid);
743
744 tp = tty_alloc(&pts_class, psc, NULL);
744 tp = tty_alloc(&pts_class, psc);
745 knlist_init(&psc->pts_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
746 knlist_init(&psc->pts_outpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
747
748 /* Expose the slave device as well. */
749 tty_makedev(tp, td->td_ucred, "pts/%u", psc->pts_unit);
750
751 finit(fp, fflags, DTYPE_PTS, tp, &ptsdev_ops);
752

--- 23 unchanged lines hidden (view full) ---

776 cv_init(&psc->pts_inwait, "pts inwait");
777 cv_init(&psc->pts_outwait, "pts outwait");
778
779 psc->pts_unit = -1;
780 psc->pts_cdev = dev;
781 psc->pts_uidinfo = uid;
782 uihold(uid);
783
745 knlist_init(&psc->pts_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
746 knlist_init(&psc->pts_outpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
747
748 /* Expose the slave device as well. */
749 tty_makedev(tp, td->td_ucred, "pts/%u", psc->pts_unit);
750
751 finit(fp, fflags, DTYPE_PTS, tp, &ptsdev_ops);
752

--- 23 unchanged lines hidden (view full) ---

776 cv_init(&psc->pts_inwait, "pts inwait");
777 cv_init(&psc->pts_outwait, "pts outwait");
778
779 psc->pts_unit = -1;
780 psc->pts_cdev = dev;
781 psc->pts_uidinfo = uid;
782 uihold(uid);
783
784 tp = tty_alloc(&pts_class, psc, NULL);
784 tp = tty_alloc(&pts_class, psc);
785 knlist_init(&psc->pts_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
786 knlist_init(&psc->pts_outpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
787
788 /* Expose the slave device as well. */
789 tty_makedev(tp, td->td_ucred, "%s", name);
790
791 finit(fp, fflags, DTYPE_PTS, tp, &ptsdev_ops);
792

--- 61 unchanged lines hidden ---
785 knlist_init(&psc->pts_inpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
786 knlist_init(&psc->pts_outpoll.si_note, tp->t_mtx, NULL, NULL, NULL);
787
788 /* Expose the slave device as well. */
789 tty_makedev(tp, td->td_ucred, "%s", name);
790
791 finit(fp, fflags, DTYPE_PTS, tp, &ptsdev_ops);
792

--- 61 unchanged lines hidden ---