unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-5.10)
Page:
Section:
Apropos / Subsearch:
optional field

ttysrch(4)                       File Formats                       ttysrch(4)



NAME
       ttysrch - directory search list for ttyname

DESCRIPTION
       ttysrch  is  an  optional file that is used by the ttyname library rou-
       tine. This file contains the names of directories in /dev that  contain
       terminal and terminal-related device files. The purpose of this file is
       to improve the performance of ttyname by indicating  which  subdirecto-
       ries  in  /dev  contain  terminal-related  device  files  and should be
       searched first. These subdirectory names must appear on separate  lines
       and  must begin with /dev. Those path names that do not begin with /dev
       will be ignored and a warning will be sent to the console. Blank  lines
       (lines  containing  only white space) and lines beginning with the com-
       ment character "#" will be ignored. For each file  listed  (except  for
       the special entry /dev), ttyname will recursively search through subdi-
       rectories looking for a match. If /dev appears in the ttysrch file, the
       /dev  directory  itself will be searched but there will not be a recur-
       sive search through its subdirectories.

       When ttyname searches through the device files, it tries to find a file
       whose major/minor device number, file system identifier, and inode num-
       ber match that of the file descriptor it was given as an argument. If a
       match  is  not  found,  it  will settle for a match of just major/minor
       device and file system identifier, if one can be found. However, if the
       file descriptor is associated with a cloned device, this algorithm does
       not work efficiently because the inode number  of the device file asso-
       ciated  with a clonable device will never match the inode number of the
       file descriptor that was returned by the open of that clonable  device.
       To help with these situations, entries can be put into the /etc/ttysrch
       file to improve performance when cloned devices are used  as  terminals
       on a system (for example, for remote login). However, this is only use-
       ful if the minor devices related to a cloned device are put into a sub-
       directory.  (It  is  important to note that device files need not exist
       for cloned devices and if that is the  case,  ttyname  will  eventually
       fail.)  An  optional  second  field is used in the /etc/ttysrch file to
       indicate the matching criteria. This field is separated by white  space
       (any  combination  of  blanks  or tabs). The letter M means major/minor
       device number, F means file system identifier, and I means  inode  num-
       ber.  If  this  field is not specified for an entry, the default is MFI
       which means try to match on all three. For  cloned  devices  the  field
       should  be MF, which indicates that it is not necessary to match on the
       inode number.

       Without the /etc/ttysrch file, ttyname will search the  /dev  directory
       by  first  looking in the directories /dev/term, /dev/pts, and /dev/xt.
       If a system has terminal devices installed in  directories  other  than
       these,  it may help performance if the ttysrch file is created and con-
       tains that list of directories.

EXAMPLES
       Example 1: A sample display of /etc/ttysrch command.

       A sample /etc/ttysrch file follows:

       /dev/term     MFI
       /dev/pts      MFI
       /dev/xt       MFI
       /dev/slan     MF

       This file tells  ttyname that it  should  first  search  through  those
       directories  listed   and  that  when  searching  through the /dev/slan
       directory, if a file is encountered whose major/minor devices and  file
       system  identifier  match  that of the file descriptor argument to tty-
       name, this device name should be considered a match.

FILES
       /etc/ttysrch


SEE ALSO
       ttyname(3C)



SunOS 5.10                        23 Feb 1994                       ttysrch(4)