C or ioctl help needed.

Richard A Downing richard at langside.org.uk
Sat Oct 8 15:04:32 PDT 2005

I'm trying to debug fgetty.  It's a replacement for getty using dietlibc.

Now it's supposed to run if called like this:

fgetty /dev/tty3

But this fails for me.  The relevant code is:

if ((fd=open(tty, O_RDWR, 0))<0 || ioctl (fd, TIOCSCTTY, (void *1)==-1)
    error("could not open tty device\n",3);

and this always fails (despite any perms, mine are 666 of /dev/tty3).

The open is OK, it's the ioctl condition that's failing.  But I'm damned
if I know where to look for what this is doing.

Any ideas?  Google has revealed zilch.

I've tried this before and given up on it (March 2004) - but I don't
like loose ends.


More information about the lfs-chat mailing list