MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ttcompatsetlflags

Function ttcompatsetlflags

freebsd/kern/tty_compat.c:412–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412static void
413ttcompatsetlflags(struct tty *tp, struct termios *t)
414{
415 int flags = tp->t_compatflags;
416 tcflag_t iflag = t->c_iflag;
417 tcflag_t oflag = t->c_oflag;
418 tcflag_t lflag = t->c_lflag;
419 tcflag_t cflag = t->c_cflag;
420
421 iflag &= ~(PARMRK|IGNPAR|IGNCR|INLCR);
422 if (flags&CRTERA)
423 lflag |= ECHOE;
424 else
425 lflag &= ~ECHOE;
426 if (flags&CRTKIL)
427 lflag |= ECHOKE;
428 else
429 lflag &= ~ECHOKE;
430 if (flags&PRTERA)
431 lflag |= ECHOPRT;
432 else
433 lflag &= ~ECHOPRT;
434 if (flags&CTLECH)
435 lflag |= ECHOCTL;
436 else
437 lflag &= ~ECHOCTL;
438 if (flags&TANDEM)
439 iflag |= IXOFF;
440 else
441 iflag &= ~IXOFF;
442 if ((flags&DECCTQ) == 0)
443 iflag |= IXANY;
444 else
445 iflag &= ~IXANY;
446 if (flags & MDMBUF)
447 cflag |= MDMBUF;
448 else
449 cflag &= ~MDMBUF;
450 if (flags&NOHANG)
451 cflag &= ~HUPCL;
452 else
453 cflag |= HUPCL;
454 lflag &= ~(TOSTOP|FLUSHO|PENDIN|NOFLSH);
455 lflag |= flags&(TOSTOP|FLUSHO|PENDIN|NOFLSH);
456
457 /*
458 * The next if-else statement is copied from above so don't bother
459 * checking it separately. We could avoid fiddlling with the
460 * character size if the mode is already RAW or if neither the
461 * LITOUT bit or the PASS8 bit is being changed, but the delta of
462 * the change is not available here and skipping the RAW case would
463 * make the code different from above.
464 */
465 cflag &= ~(CSIZE|PARENB);
466 if (flags&(RAW|LITOUT|PASS8)) {
467 cflag |= CS8;
468 if (!(flags&(RAW|PASS8))
469 || (flags&(RAW|PASS8|ANYP)) == (PASS8|ANYP))

Callers 1

ttsetcompatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected