tty.c (da52b4caaf187775f6b56a72c6b16e94ad728f7b) | tty.c (6d8484b0d0191b66f9bfd0dfa89c06a29647f02a) |
---|---|
1/* 2 * Copyright (c) 1980, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 43 unchanged lines hidden (view full) --- 52static int ttyset; /* We must now do erase/kill */ 53#endif 54 55/* 56 * Read all relevant header fields. 57 */ 58 59int | 1/* 2 * Copyright (c) 1980, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 43 unchanged lines hidden (view full) --- 52static int ttyset; /* We must now do erase/kill */ 53#endif 54 55/* 56 * Read all relevant header fields. 57 */ 58 59int |
60grabh(hp, gflags) 61 struct header *hp; 62 int gflags; | 60grabh(struct header *hp, int gflags) |
63{ 64 struct termios ttybuf; 65 sig_t saveint; 66 sig_t savetstp; 67 sig_t savettou; 68 sig_t savettin; 69 int errs; 70#ifndef TIOCSTI --- 94 unchanged lines hidden (view full) --- 165/* 166 * Read up a header from standard input. 167 * The source string has the preliminary contents to 168 * be read. 169 * 170 */ 171 172char * | 61{ 62 struct termios ttybuf; 63 sig_t saveint; 64 sig_t savetstp; 65 sig_t savettou; 66 sig_t savettin; 67 int errs; 68#ifndef TIOCSTI --- 94 unchanged lines hidden (view full) --- 163/* 164 * Read up a header from standard input. 165 * The source string has the preliminary contents to 166 * be read. 167 * 168 */ 169 170char * |
173readtty(pr, src) 174 const char *pr; 175 char src[]; | 171readtty(const char *pr, char src[]) |
176{ 177 char ch, canonb[BUFSIZ]; 178 int c; 179 char *cp, *cp2; 180 181 fputs(pr, stdout); 182 (void)fflush(stdout); 183 if (src != NULL && strlen(src) > BUFSIZ - 2) { --- 83 unchanged lines hidden (view full) --- 267 return (NULL); 268 return (savestr(canonb)); 269} 270 271/* 272 * Receipt continuation. 273 */ 274void | 172{ 173 char ch, canonb[BUFSIZ]; 174 int c; 175 char *cp, *cp2; 176 177 fputs(pr, stdout); 178 (void)fflush(stdout); 179 if (src != NULL && strlen(src) > BUFSIZ - 2) { --- 83 unchanged lines hidden (view full) --- 263 return (NULL); 264 return (savestr(canonb)); 265} 266 267/* 268 * Receipt continuation. 269 */ 270void |
275ttystop(s) 276 int s; | 271ttystop(int s) |
277{ 278 sig_t old_action = signal(s, SIG_DFL); 279 sigset_t nset; 280 281 (void)sigemptyset(&nset); 282 (void)sigaddset(&nset, s); 283 (void)sigprocmask(SIG_BLOCK, &nset, NULL); 284 kill(0, s); 285 (void)sigprocmask(SIG_UNBLOCK, &nset, NULL); 286 (void)signal(s, old_action); 287 longjmp(rewrite, 1); 288} 289 | 272{ 273 sig_t old_action = signal(s, SIG_DFL); 274 sigset_t nset; 275 276 (void)sigemptyset(&nset); 277 (void)sigaddset(&nset, s); 278 (void)sigprocmask(SIG_BLOCK, &nset, NULL); 279 kill(0, s); 280 (void)sigprocmask(SIG_UNBLOCK, &nset, NULL); 281 (void)signal(s, old_action); 282 longjmp(rewrite, 1); 283} 284 |
290/*ARGSUSED*/ | |
291void | 285void |
292ttyint(s) 293 int s; | 286ttyint(int s __unused) |
294{ 295 longjmp(intjmp, 1); 296} | 287{ 288 longjmp(intjmp, 1); 289} |