bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Under Linux tset should not make use of getttynam nor /etc/ttys


From: Dr. Werner Fink
Subject: Under Linux tset should not make use of getttynam nor /etc/ttys
Date: Fri, 22 Oct 2021 09:24:06 +0200

Hi,

just to mention as even if the glibc has the function getttynam[1] but
the file /etc/ttys[2] was never used with Linux (not with SysV sysvinit
with its /etc/inittab[3] nor with systemd) the

#if HAVE_GETTTYNAM
        /*
         * We have the 4.3BSD library call getttynam(3); that means
         * there's an /etc/ttys to look up device-to-type mappings in.
         * Try ttyname(3); check for dialup or other mapping.
         */
        if ((t = getttynam(p))) {
            ttype = t->ty_type;
            goto map;
        }
#else
[...]
#endif /* HAVE_GETTTYNAM */

is leading on any Linux system to

  map:ttype = "unknown";

maybe appending "&& !defined(__linux__)" to the "#if HAVE_GETTTYNAM"
would help here.

Werner

Ref:

[1] https://linux.die.net/man/3/getttynam
  [...]
  Conforming To
  Not in POSIX.1-2001. Present on the BSDs, and perhaps other systems.

  Notes
  Under Linux the file /etc/ttys, and the functions described above, are not 
used.

[2] https://man.netbsd.org/NetBSD-6.0/ttys.5
[3] https://www.unix.com/man-page/suse/5/inittab/

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]