tty.c (104306) | tty.c (104387) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1990, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 30 unchanged lines hidden (view full) --- 39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 40 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 41 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 42 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 43 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 44 * SUCH DAMAGE. 45 * 46 * @(#)tty.c 8.8 (Berkeley) 1/21/94 | 1/*- 2 * Copyright (c) 1982, 1986, 1990, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 30 unchanged lines hidden (view full) --- 39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 40 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 41 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 42 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 43 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 44 * SUCH DAMAGE. 45 * 46 * @(#)tty.c 8.8 (Berkeley) 1/21/94 |
47 * $FreeBSD: head/sys/kern/tty.c 104306 2002-10-01 17:15:53Z jmallett $ | 47 * $FreeBSD: head/sys/kern/tty.c 104387 2002-10-02 20:31:47Z jhb $ |
48 */ 49 50/*- 51 * TODO: 52 * o Fix races for sending the start char in ttyflush(). 53 * o Handle inter-byte timeout for "MIN > 0, TIME > 0" in ttyselect(). 54 * With luck, there will be MIN chars before select() returns(). 55 * o Handle CLOCAL consistently for ptys. Perhaps disallow setting it. --- 2338 unchanged lines hidden (view full) --- 2394 td = FIRST_THREAD_IN_PROC(pick); 2395 if (pick->p_flag & P_KSES) { 2396 stmp = "KSE" ; /* XXXKSE */ 2397 } else { 2398 if (td) { 2399 if (TD_ON_RUNQ(td) || 2400 (TD_IS_RUNNING(td))) { 2401 stmp = "running"; | 48 */ 49 50/*- 51 * TODO: 52 * o Fix races for sending the start char in ttyflush(). 53 * o Handle inter-byte timeout for "MIN > 0, TIME > 0" in ttyselect(). 54 * With luck, there will be MIN chars before select() returns(). 55 * o Handle CLOCAL consistently for ptys. Perhaps disallow setting it. --- 2338 unchanged lines hidden (view full) --- 2394 td = FIRST_THREAD_IN_PROC(pick); 2395 if (pick->p_flag & P_KSES) { 2396 stmp = "KSE" ; /* XXXKSE */ 2397 } else { 2398 if (td) { 2399 if (TD_ON_RUNQ(td) || 2400 (TD_IS_RUNNING(td))) { 2401 stmp = "running"; |
2402 } else if (TD_ON_MUTEX(td)) { 2403 stmp = td->td_mtxname; | 2402 } else if (TD_ON_LOCK(td)) { 2403 stmp = td->td_lockname; |
2404 } else if (td->td_wmesg) { 2405 stmp = td->td_wmesg; 2406 } else { 2407 stmp = "iowait"; 2408 } 2409 } else { 2410 stmp = "threadless"; 2411 panic("ttyinfo: no thread!?"); --- 8 unchanged lines hidden (view full) --- 2420 } else { 2421 ltmp = pgtok( 2422 vmspace_resident_count(pick->p_vmspace)); 2423 } 2424 mtx_unlock_spin(&sched_lock); 2425 2426 ttyprintf(tp, " cmd: %s %d [%s%s] ", pick->p_comm, 2427 pick->p_pid, | 2404 } else if (td->td_wmesg) { 2405 stmp = td->td_wmesg; 2406 } else { 2407 stmp = "iowait"; 2408 } 2409 } else { 2410 stmp = "threadless"; 2411 panic("ttyinfo: no thread!?"); --- 8 unchanged lines hidden (view full) --- 2420 } else { 2421 ltmp = pgtok( 2422 vmspace_resident_count(pick->p_vmspace)); 2423 } 2424 mtx_unlock_spin(&sched_lock); 2425 2426 ttyprintf(tp, " cmd: %s %d [%s%s] ", pick->p_comm, 2427 pick->p_pid, |
2428 TD_ON_MUTEX(td) ? "*" : "", | 2428 TD_ON_LOCK(td) ? "*" : "", |
2429 stmp); 2430 2431 /* Print user time. */ 2432 ttyprintf(tp, "%ld.%02ldu ", 2433 utime.tv_sec, utime.tv_usec / 10000); 2434 2435 /* Print system time. */ 2436 ttyprintf(tp, "%ld.%02lds ", --- 263 unchanged lines hidden --- | 2429 stmp); 2430 2431 /* Print user time. */ 2432 ttyprintf(tp, "%ld.%02ldu ", 2433 utime.tv_sec, utime.tv_usec / 10000); 2434 2435 /* Print system time. */ 2436 ttyprintf(tp, "%ld.%02lds ", --- 263 unchanged lines hidden --- |