Skip to content

Commit 7fe1e36

Browse files
committed
Suport TIOCLINUX
The test isn't much of a test since AFAICT it only works when run on an actual console, which no-one is going to do.
1 parent 42f7589 commit 7fe1e36

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/record_syscall.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,10 @@ static Switchable prepare_ioctl(RecordTask* t,
18001800
syscall_state.reg_parameter<typename Arch::termio>(3);
18011801
return PREVENT_SWITCH;
18021802

1803+
case TIOCLINUX:
1804+
syscall_state.reg_parameter<char>(3);
1805+
return PREVENT_SWITCH;
1806+
18031807
case BLKSSZGET:
18041808
case BLKALIGNOFF:
18051809
case KDGKBMODE:

src/test/ioctl_pty.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "util.h"
44

5+
#include <linux/tiocl.h>
6+
57
int main(void) {
68
int fd = open("/dev/ptmx", O_RDWR);
79
pid_t child;
@@ -68,6 +70,13 @@ int main(void) {
6870
atomic_printf("pty TIOCGETD = %d\n", *arg);
6971
test_assert(0 == ioctl(fd, TIOCSETD, arg));
7072

73+
char* carg;
74+
ALLOCATE_GUARD(carg, 'f');
75+
*carg = TIOCL_GETSHIFTSTATE;
76+
ret = ioctl(fd, TIOCLINUX, carg);
77+
VERIFY_GUARD(carg);
78+
test_assert(ret == 0 || errno == EIO || errno == ENOTTY);
79+
7180
atomic_puts("EXIT-SUCCESS");
7281
return 0;
7382
}

0 commit comments

Comments
 (0)