Hi Everyone,

Working from Master I got the message about the missing ioctl:

Debug: term_config
==3366== Warning: noted but unhandled ioctl 0x540c with no size/direction hints.
==3366==    This could cause spurious value errors to appear.
==3366==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper
 wrapper.

Following http://www.valgrind.org/docs/manual/dist.readme-missing.html
I found the source files don't really follow what is described. For
example, I only see PRE_unknown_ioctl and POST_unknown_ioctl, and I
don't see the big collection of existing ioctl's as described. I don't
think it is a good idea to go further (for me).

If interested in closing the gap, then these ioctl's two need to be
implemented (https://linux.die.net/man/4/tty_ioctl):

  * TIOCEXCL
  * TIOCNXCL

    /* Set fd to exclusive mode, TIOCEXCL=0x540c */
    if (ioctl(fd, TIOCEXCL, NULL) != 0) {
        log_error("ioctl_tty: %s\n", strerror(errno));
        return -1;
    }

TIOCNXCL unsets exclusive mode.

Both ioctl's take a NULL argument, so no parameters are passed.

The ioctl is needed to open a serial device or modem with O_EXCL.
Using O_EXCL open() will succeed, but the flag is silently ignored
because of character devices. Later, Modem Manager or another program
will open the device and muck with program state.

To fix the missing O_EXCL, TIOCEXCL can be used. And yes, there is a
race but it is the best we have.

Jeff


_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to