| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "nacl_io/devfs/tty_node.h" | 5 #include "nacl_io/devfs/tty_node.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <signal.h> | 9 #include <signal.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 emitter_->RaiseEvents_Locked(POLLOUT); | 46 emitter_->RaiseEvents_Locked(POLLOUT); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void TtyNode::InitTermios() { | 49 void TtyNode::InitTermios() { |
| 50 // Some sane values that produce good result. | 50 // Some sane values that produce good result. |
| 51 termios_.c_iflag = ICRNL | IXON | IXOFF | IUTF8; | 51 termios_.c_iflag = ICRNL | IXON | IXOFF | IUTF8; |
| 52 termios_.c_oflag = OPOST | ONLCR; | 52 termios_.c_oflag = OPOST | ONLCR; |
| 53 termios_.c_cflag = CREAD | 077; | 53 termios_.c_cflag = CREAD | 077; |
| 54 termios_.c_lflag = | 54 termios_.c_lflag = |
| 55 ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN; | 55 ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN; |
| 56 #if !defined(__BIONIC__) |
| 56 termios_.c_ispeed = B38400; | 57 termios_.c_ispeed = B38400; |
| 57 termios_.c_ospeed = B38400; | 58 termios_.c_ospeed = B38400; |
| 59 #endif |
| 58 termios_.c_cc[VINTR] = 3; | 60 termios_.c_cc[VINTR] = 3; |
| 59 termios_.c_cc[VQUIT] = 28; | 61 termios_.c_cc[VQUIT] = 28; |
| 60 termios_.c_cc[VERASE] = 127; | 62 termios_.c_cc[VERASE] = 127; |
| 61 termios_.c_cc[VKILL] = 21; | 63 termios_.c_cc[VKILL] = 21; |
| 62 termios_.c_cc[VEOF] = 4; | 64 termios_.c_cc[VEOF] = 4; |
| 63 termios_.c_cc[VTIME] = 0; | 65 termios_.c_cc[VTIME] = 0; |
| 64 termios_.c_cc[VMIN] = 1; | 66 termios_.c_cc[VMIN] = 1; |
| 65 termios_.c_cc[VSWTC] = 0; | 67 termios_.c_cc[VSWTC] = 0; |
| 66 termios_.c_cc[VSTART] = 17; | 68 termios_.c_cc[VSTART] = 17; |
| 67 termios_.c_cc[VSTOP] = 19; | 69 termios_.c_cc[VSTOP] = 19; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 } | 288 } |
| 287 | 289 |
| 288 Error TtyNode::Tcsetattr(int optional_actions, | 290 Error TtyNode::Tcsetattr(int optional_actions, |
| 289 const struct termios* termios_p) { | 291 const struct termios* termios_p) { |
| 290 AUTO_LOCK(node_lock_); | 292 AUTO_LOCK(node_lock_); |
| 291 termios_ = *termios_p; | 293 termios_ = *termios_p; |
| 292 return 0; | 294 return 0; |
| 293 } | 295 } |
| 294 | 296 |
| 295 } // namespace nacl_io | 297 } // namespace nacl_io |
| OLD | NEW |