You are not logged in.

#1 2011-11-05 08:20:21

i336
Member
Registered: 2011-01-08
Posts: 11

[SOLVED!] agetty seems unable to ioctl() my serial device...?!

Hi. After much head-scratching as to the root of my serial cable issues (hint: if your serial cable works port-to-port on the same PC *and* shorting pins 2 and 3 for a loopback test both work, check that the ground line hasn't helpfully disconnected itself while you weren't looking!), I can successfully open minicom on my two PCs and typing etc works great.

Obvious next step = agetty. Or not...!

After agetty repeated inexplicably closed 3 or 4 times regardless of what options I passed it I got suss and ran it through strace. After I finally read through *all* of strace's output, well, I figured out the problem, but I can't for the life of me figure out WHY it's happening. O.o

Here are the confusing bits; the full output is at http://pastebin.com/jPQvzKEa

chown32("/dev/ttyS0", 0, 5)             = 0
chmod("/dev/ttyS0", 0660)               = 0
open("/dev/ttyS0", O_RDWR|O_NOCTTY|O_NONBLOCK|O_LARGEFILE) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B1200 -opost -isig -icanon -echo ...}) = 0
fstat64(3, {st_mode=S_IFCHR|0660, st_rdev=makedev(4, 64), ...}) = 0
ioctl(3, TIOCGSID, 0xbfb32d18)          = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(3, TIOCSCTTY)                     = -1 EPERM (Operation not permitted)
[...]
nanosleep({10, 0}, 0xbfb32cf4)          = 0

I'm... running agetty as root. I don't get it.

The nanosleep comes in at pretty much the end of the output; agetty pauses, *regardless* of what I run, for 10 seconds, then quits with return code 1 (ie, an error). My agetty is from util-linux 2.20.1, the latest.

This has me absolutely stumped. I have absolutely no idea where to go next. Help much appreciated!

-i336

Last edited by i336 (2011-11-05 08:50:36)

Offline

#2 2011-11-05 08:51:18

i336
Member
Registered: 2011-01-08
Posts: 11

Re: [SOLVED!] agetty seems unable to ioctl() my serial device...?!

....for anyone who finds this, the Big Obvious Thing I Didn't Think I Needed To Do(TM) was actually put the agetty line in /etc/inittab.

I was running it from a console (an xterm, actually).

big_smile

-i336

Last edited by i336 (2011-11-05 08:51:39)

Offline

Board footer

Powered by FluxBB