Skip to content

Commit 4fbcab9

Browse files
committed
Add TIOCSERGETLSR ioctl.
1 parent 3aca0ef commit 4fbcab9

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/record_syscall.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,7 @@ static Switchable prepare_ioctl(RecordTask* t,
18021802
case TIOCGETD:
18031803
case TIOCMGET:
18041804
case TIOCMSET:
1805+
case TIOCSERGETLSR:
18051806
case VT_OPENQRY:
18061807
syscall_state.reg_parameter<int>(3);
18071808
return PREVENT_SWITCH;

src/test/ioctl_ttyS.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ int main(void) {
77
int fd;
88
int* mbits;
99
struct serial_icounter_struct* sicnt;
10+
int* lsr;
1011

1112
fd = open("/dev/ttyS0", O_RDWR);
1213
if (fd < 0) {
@@ -29,6 +30,11 @@ int main(void) {
2930
sicnt->cts, sicnt->dsr, sicnt->rng, sicnt->dcd, sicnt->rx, sicnt->tx,
3031
sicnt->frame, sicnt->overrun, sicnt->parity, sicnt->brk, sicnt->buf_overrun);
3132

33+
ALLOCATE_GUARD(lsr, 'c');
34+
test_assert(0 == ioctl(fd, TIOCSERGETLSR, lsr));
35+
VERIFY_GUARD(lsr);
36+
atomic_printf("TIOCSERGETLSR returned lsr=0x%x\n", *lsr);
37+
3238
atomic_puts("EXIT-SUCCESS");
3339
return 0;
3440
}

0 commit comments

Comments
 (0)