linux-l: Warum ist /dev/ttyq1 KEIN tty ????????

Stefan Bund bund at zedat.fu-berlin.de
Fr Nov 14 10:32:11 CET 1997


Da sitze ich jetzt schon 2 Tage an einem Perlskript (mit dem ich das
Passwort setzen will) und das bl"ode Ding funktioniert nicht. Ich
verwende chat2.pl, aber das funktioniert nicht so richtig. Also hab
ich's mir mal angeschaut. Mein `Fehlerskript' (= vereinfachter
Ausschnitt aus chat2.pl):

------> Snip <------
#!/usr/bin/perl

open(PTY,"+>/dev/ptyqf") || die "Cannot open /dev/ptyqf: $!";
open(TTY,"+>/dev/ttyqf") || die "Cannot open /dev/ttyqf: $!";
print "PTY is @{[fileno(PTY)]}, TTY is @{[fileno(TTY)]}\n";
die "OOps: $!" unless ioctl(TTY,0x540F,0);

close PTY;
close TTY;
------> Snip <------

Wenn isch das laufenlasse, ergibt das:

------> Snip <------
$ ./test.pl
PTY is 3, TTY is 4
OOps: Not a typewriter at test.pl line 6.
$
------> Snip <------

und strace ./test.pl ergibt
------> Snip <------
$ strace test.pl
[...]
sigprocmask(SIG_BLOCK, NULL, [])        = 0
open("/dev/ptyqf", O_RDWR|O_CREAT|O_TRUNC, 0666) = 3
fstat(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(2, 31), ...}) = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
open("/dev/ttyqf", O_RDWR|O_CREAT|O_TRUNC, 0666) = 4
fstat(4, {st_mode=S_IFCHR|0666, st_rdev=makedev(3, 31), ...}) = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(3, 0), ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40008000
ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
write(1, "PTY is 3, TTY is 4\n", 19PTY is 3, TTY is 4
)    = 19
ioctl(4, TIOCGPGRP, NULL)               = -1 ENOTTY (Not a typewriter)
stat("/etc/locale/C/libc.cat", 0xbffff114) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale/C/libc.cat", 0xbffff114) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale/libc/C", 0xbffff114) = -1 ENOENT (No such file or directory)
stat("/usr/share/locale/C/libc.cat", 0xbffff114) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/locale/C/libc.cat", 0xbffff114) = -1 ENOENT (No such file or directory)
write(2, "OOps: Not a typewriter at ./test"..., 44OOps: Not a typewriter at ./test.pl line 6.
) = 44
sigprocmask(SIG_SETMASK, [], NULL)      = 0
_exit(25)                               = ?
$
------> Snip <------

Was soll'n das ??? open funzt und das ioctl geht auch auf die richtige
device, aber ???

Hat jemand 'nen Tip?

Stefan.

-- 
                                    @ @
 -------------------------------oOO-(_)-OOo---------------------------
 Stefan Bund, student of physics at Freie Universitaet Berlin, Germany

 email: bund at zedat.fu-berlin.de        ( or bund at physik.fu-berlin.de )
        bund at berlin.cid-net.de
 ---------------------------------------------------------------------
 




Mehr Informationen über die Mailingliste linux-l