undefined reference to `ioctl_tty'
Jeffrey Walton
noloader at gmail.com
Wed Mar 6 02:41:18 EST 2019
On Wed, Mar 6, 2019 at 2:32 AM Alexander Kapshuk
<alexander.kapshuk at gmail.com> wrote:
>
> ---------- Forwarded message ---------
> From: Alexander Kapshuk <alexander.kapshuk at gmail.com>
> Date: Wed, Mar 6, 2019 at 9:30 AM
> Subject: Re: undefined reference to `ioctl_tty'
> To: <noloader at gmail.com>
> ...
> > $ cat test.c
> > #include <stdio.h>
> > #include <string.h>
> > #include <errno.h>
> > #include <termios.h>
> > #include <fcntl.h>
> > #include <sys/ioctl.h>
> >
> > int main(int argc, char* argv[])
> > {
> > if (ioctl_tty(1 /*STDOUT_FILENO*/, TIOCEXCL, NULL) == -1) {
> > fprintf(stderr, "%s\n", strerror(errno));
> > return 1;
> > }
> > return 0;
> > }
>
> While the man page does refer to this function as ioctl_tty, the
> actual signature, as shown in the man page, is:
> int ioctl(int fd, int cmd, ...);
>
> Not ioctl_tty.
Derp, thanks.
Jeff
More information about the Kernelnewbies
mailing list