Print this page
14249 pseudo-terminal nomenclature should reflect POSIX
Change-Id: Ib4a3cef899ff4c71b09cb0dc6878863c5e8357bc

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ptem.c
          +++ new/usr/src/uts/common/io/ptem.c
↓ open down ↓ 393 lines elided ↑ open up ↑
 394  394  
 395  395                  default:
 396  396                          freemsg(mp);
 397  397                          break;
 398  398          }
 399  399          break;
 400  400  
 401  401          case M_IOCACK:
 402  402          case M_IOCNAK:
 403  403                  /*
 404      -                 * We only pass write-side ioctls through to the master that
      404 +                 * We only pass write-side ioctls through to the manager that
 405  405                   * we've already ACKed or NAKed to the stream head.  Thus, we
 406  406                   * discard ones arriving from below, since they're redundant
 407  407                   * from the point of view of modules above us.
 408  408                   */
 409  409                  freemsg(mp);
 410  410                  break;
 411  411  
 412  412          case M_HANGUP:
 413  413                  /*
 414  414                   * clear blocked state.
↓ open down ↓ 204 lines elided ↑ open up ↑
 619  619          int error;
 620  620  
 621  621          switch (mp->b_datap->db_type) {
 622  622  
 623  623          case M_IOCTL:
 624  624                  /*
 625  625                   * Note:  for each "set" type operation a copy
 626  626                   * of the M_IOCTL message is made and passed
 627  627                   * downstream.  Eventually the PCKT module, if
 628  628                   * it has been pushed, should pick up this message.
 629      -                 * If the PCKT module has not been pushed the master
      629 +                 * If the PCKT module has not been pushed the manager
 630  630                   * side stream head will free it.
 631  631                   */
 632  632                  iocp = (struct iocblk *)mp->b_rptr;
 633  633                  switch (iocp->ioc_cmd) {
 634  634  
 635  635                  case TCSETAF:
 636  636                  case TCSETSF:
 637  637                          /*
 638  638                           * Flush the read queue.
 639  639                           */
↓ open down ↓ 196 lines elided ↑ open up ↑
 836  836                                  miocnak(q, mp, 0, EEXIST);
 837  837                          } else {
 838  838                                  ntp->state |= IS_PTSTTY;
 839  839                                  mioc2ack(mp, NULL, 0, 0);
 840  840                                  qreply(q, mp);
 841  841                          }
 842  842                          break;
 843  843  
 844  844                  default:
 845  845                          /*
 846      -                         * End of the line.  The slave driver doesn't see any
 847      -                         * ioctls that we don't explicitly pass along to it.
      846 +                         * End of the line.  The subsidiary driver doesn't see
      847 +                         * any ioctls that we don't explicitly pass along to
      848 +                         * it.
 848  849                           */
 849  850                          miocnak(q, mp, 0, EINVAL);
 850  851                          break;
 851  852                  }
 852  853                  break;
 853  854  
 854  855          case M_DELAY: /* tty delays not supported */
 855  856                  freemsg(mp);
 856  857                  break;
 857  858  
↓ open down ↓ 118 lines elided ↑ open up ↑
 976  977                      (tp->wsz.ws_ypixel != wb->ws_xpixel)) {
 977  978                          /*
 978  979                           * SIGWINCH is always sent upstream.
 979  980                           */
 980  981                          if (qside == WRSIDE)
 981  982                                  (void) putnextctl1(RD(q), M_SIG, SIGWINCH);
 982  983                          else if (qside == RDSIDE)
 983  984                                  (void) putnextctl1(q, M_SIG, SIGWINCH);
 984  985                          /*
 985  986                           * Message may have come in as an M_IOCDATA; pass it
 986      -                         * to the master side as an M_IOCTL.
      987 +                         * to the manager side as an M_IOCTL.
 987  988                           */
 988  989                          mp->b_datap->db_type = M_IOCTL;
 989  990                          if (qside == WRSIDE) {
 990  991                                  /*
 991  992                                   * Need a copy of this message to pass on to
 992  993                                   * the PCKT module, only if the M_IOCTL
 993      -                                 * orginated from the slave side.
      994 +                                 * orginated from the subsidiary side.
 994  995                                   */
 995  996                                  if ((pckt_msgp = copymsg(mp)) == NULL) {
 996  997                                          miocnak(q, mp, 0, EAGAIN);
 997  998                                          return;
 998  999                                  }
 999 1000                                  putnext(q, pckt_msgp);
1000 1001                          }
1001 1002                          tp->wsz.ws_row = wb->ws_row;
1002 1003                          tp->wsz.ws_col = wb->ws_col;
1003 1004                          tp->wsz.ws_xpixel = wb->ws_xpixel;
1004 1005                          tp->wsz.ws_ypixel = wb->ws_ypixel;
1005 1006                  }
1006 1007  
1007 1008                  mioc2ack(mp, NULL, 0, 0);
1008 1009                  qreply(q, mp);
1009 1010                  return;
1010 1011  
1011 1012          case TIOCSIGNAL: {
1012 1013                  /*
1013      -                 * This ioctl can emanate from the master side in remote
     1014 +                 * This ioctl can emanate from the manager side in remote
1014 1015                   * mode only.
1015 1016                   */
1016 1017                  int     sig;
1017 1018  
1018 1019                  if (DB_TYPE(mp) == M_IOCTL && iocp->ioc_count != TRANSPARENT) {
1019 1020                          error = miocpullup(mp, sizeof (int));
1020 1021                          if (error != 0) {
1021 1022                                  miocnak(q, mp, 0, error);
1022 1023                                  return;
1023 1024                          }
↓ open down ↓ 3 lines elided ↑ open up ↑
1027 1028                          sig = *(int *)mp->b_cont->b_rptr;
1028 1029                  else
1029 1030                          sig = (int)*(intptr_t *)mp->b_cont->b_rptr;
1030 1031  
1031 1032                  if (sig < 1 || sig >= NSIG) {
1032 1033                          miocnak(q, mp, 0, EINVAL);
1033 1034                          return;
1034 1035                  }
1035 1036  
1036 1037                  /*
1037      -                 * Send an M_PCSIG message up the slave's read side and
1038      -                 * respond back to the master with an ACK or NAK as
     1038 +                 * Send an M_PCSIG message up the subsidiary's read side and
     1039 +                 * respond back to the manager with an ACK or NAK as
1039 1040                   * appropriate.
1040 1041                   */
1041 1042                  if (putnextctl1(q, M_PCSIG, sig) == 0) {
1042 1043                          miocnak(q, mp, 0, EAGAIN);
1043 1044                          return;
1044 1045                  }
1045 1046  
1046 1047                  mioc2ack(mp, NULL, 0, 0);
1047 1048                  qreply(q, mp);
1048 1049                  return;
↓ open down ↓ 48 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX