Deleted Added
full compact
svr4_termios.c (92761) svr4_termios.c (102003)
1/*
2 * Copyright (c) 1998 Mark Newton
3 * Copyright (c) 1994 Christos Zoulas
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*
2 * Copyright (c) 1998 Mark Newton
3 * Copyright (c) 1994 Christos Zoulas
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/compat/svr4/svr4_termios.c 92761 2002-03-20 05:48:58Z alfred $
28 * $FreeBSD: head/sys/compat/svr4/svr4_termios.c 102003 2002-08-17 02:36:16Z rwatson $
29 */
30
31#include <sys/param.h>
32#include <sys/proc.h>
33#include <sys/systm.h>
34#include <sys/file.h>
35#include <sys/filedesc.h>
36#include <sys/termios.h>

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

494 *retval = 0;
495
496 DPRINTF(("TERM ioctl %lx\n", cmd));
497
498 switch (cmd) {
499 case SVR4_TCGETA:
500 case SVR4_TCGETS:
501 DPRINTF(("ioctl(TCGET%c);\n", cmd == SVR4_TCGETA ? 'A' : 'S'));
29 */
30
31#include <sys/param.h>
32#include <sys/proc.h>
33#include <sys/systm.h>
34#include <sys/file.h>
35#include <sys/filedesc.h>
36#include <sys/termios.h>

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

494 *retval = 0;
495
496 DPRINTF(("TERM ioctl %lx\n", cmd));
497
498 switch (cmd) {
499 case SVR4_TCGETA:
500 case SVR4_TCGETS:
501 DPRINTF(("ioctl(TCGET%c);\n", cmd == SVR4_TCGETA ? 'A' : 'S'));
502 if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, td)) != 0)
502 if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt,
503 td->td_ucred, td)) != 0)
503 return error;
504
505 memset(&st, 0, sizeof(st));
506 bsd_to_svr4_termios(&bt, &st);
507
508#ifdef DEBUG_SVR4
509 print_bsd_termios(&bt);
510 print_svr4_termios(&st);

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

521 case SVR4_TCSETA:
522 case SVR4_TCSETS:
523 case SVR4_TCSETAW:
524 case SVR4_TCSETSW:
525 case SVR4_TCSETAF:
526 case SVR4_TCSETSF:
527 DPRINTF(("TCSET{A,S,AW,SW,AF,SF}\n"));
528 /* get full BSD termios so we don't lose information */
504 return error;
505
506 memset(&st, 0, sizeof(st));
507 bsd_to_svr4_termios(&bt, &st);
508
509#ifdef DEBUG_SVR4
510 print_bsd_termios(&bt);
511 print_svr4_termios(&st);

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

522 case SVR4_TCSETA:
523 case SVR4_TCSETS:
524 case SVR4_TCSETAW:
525 case SVR4_TCSETSW:
526 case SVR4_TCSETAF:
527 case SVR4_TCSETSF:
528 DPRINTF(("TCSET{A,S,AW,SW,AF,SF}\n"));
529 /* get full BSD termios so we don't lose information */
529 if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, td)) != 0)
530 if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt,
531 td->td_ucred, td)) != 0)
530 return error;
531
532 switch (cmd) {
533 case SVR4_TCSETS:
534 case SVR4_TCSETSW:
535 case SVR4_TCSETSF:
536 if ((error = copyin(data, &st, sizeof(st))) != 0)
537 return error;

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

572 break;
573 }
574
575#ifdef DEBUG_SVR4
576 print_bsd_termios(&bt);
577 print_svr4_termios(&st);
578#endif /* DEBUG_SVR4 */
579
532 return error;
533
534 switch (cmd) {
535 case SVR4_TCSETS:
536 case SVR4_TCSETSW:
537 case SVR4_TCSETSF:
538 if ((error = copyin(data, &st, sizeof(st))) != 0)
539 return error;

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

574 break;
575 }
576
577#ifdef DEBUG_SVR4
578 print_bsd_termios(&bt);
579 print_svr4_termios(&st);
580#endif /* DEBUG_SVR4 */
581
580 return fo_ioctl(fp, cmd, (caddr_t) &bt, td);
582 return fo_ioctl(fp, cmd, (caddr_t) &bt, td->td_ucred, td);
581
582 case SVR4_TIOCGWINSZ:
583 DPRINTF(("TIOCGWINSZ\n"));
584 {
585 struct svr4_winsize ws;
586
583
584 case SVR4_TIOCGWINSZ:
585 DPRINTF(("TIOCGWINSZ\n"));
586 {
587 struct svr4_winsize ws;
588
587 error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws, td);
589 error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws,
590 td->td_ucred, td);
588 if (error)
589 return error;
590 return copyout(&ws, data, sizeof(ws));
591 }
592
593 case SVR4_TIOCSWINSZ:
594 DPRINTF(("TIOCSWINSZ\n"));
595 {
596 struct svr4_winsize ws;
597
598 if ((error = copyin(data, &ws, sizeof(ws))) != 0)
599 return error;
591 if (error)
592 return error;
593 return copyout(&ws, data, sizeof(ws));
594 }
595
596 case SVR4_TIOCSWINSZ:
597 DPRINTF(("TIOCSWINSZ\n"));
598 {
599 struct svr4_winsize ws;
600
601 if ((error = copyin(data, &ws, sizeof(ws))) != 0)
602 return error;
600 return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws, td);
603 return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws,
604 td->td_ucred, td);
601 }
602
603 default:
604 DPRINTF(("teleport to STREAMS ioctls...\n"));
605 return svr4_stream_ti_ioctl(fp, td, retval, fd, cmd, data);
606 }
607}
605 }
606
607 default:
608 DPRINTF(("teleport to STREAMS ioctls...\n"));
609 return svr4_stream_ti_ioctl(fp, td, retval, fd, cmd, data);
610 }
611}