Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/record_syscall.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

using namespace std;

#ifndef HAVE_TERMIOS2
#if defined (TCGETS2) && ! defined (HAVE_TERMIOS2)
// The kernel header that defines this conflicts badly with glibc headers
// (but not bionic, which does define this) so we define it ourselves.
// NB: We need this struct defined so that the preprocessor macro for
Expand Down Expand Up @@ -1972,7 +1972,9 @@ static Switchable prepare_ioctl(RecordTask* t,
case IOCTL_MASK_SIZE(TUNSETIFINDEX):
case IOCTL_MASK_SIZE(TUNSETVNETLE):
case IOCTL_MASK_SIZE(TUNSETVNETBE):
#ifdef TCSETS2
case IOCTL_MASK_SIZE(TCSETS2):
#endif
return PREVENT_SWITCH;
case IOCTL_MASK_SIZE(USBDEVFS_GETDRIVER):
// Reads and writes its parameter despite not having the _IOC_READ bit.
Expand Down Expand Up @@ -2108,7 +2110,10 @@ static Switchable prepare_ioctl(RecordTask* t,
case IOCTL_MASK_SIZE(OTPGETREGIONINFO):
case IOCTL_MASK_SIZE(ECCGETLAYOUT):
case IOCTL_MASK_SIZE(ECCGETSTATS):
#ifndef TCGETS2
case IOCTL_MASK_SIZE(TCGETS2):
#endif

syscall_state.reg_parameter(3, size);
return PREVENT_SWITCH;

Expand Down
2 changes: 2 additions & 0 deletions src/test/ioctl_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ int main(void) {
VERIFY_GUARD(nread);
atomic_printf("FIONREAD returned nread=%d\n", *nread);

#ifdef TCGETS2
ALLOCATE_GUARD(tc2, 'i');
test_assert(0 == ioctl(fd, TCGETS2, tc));
VERIFY_GUARD(tc2);
Expand All @@ -136,6 +137,7 @@ int main(void) {
// NB: leaving the TCSETS2 as the last word seems to mess up the terminal,
// so fix it.
test_assert(0 == ioctl(fd, TCSETS, tc));
#endif

atomic_puts("EXIT-SUCCESS");
return 0;
Expand Down