Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sfent(3) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

uname, unamex



SFENT(3,L)                  AIX Technical Reference                  SFENT(3,L)



-------------------------------------------------------------------------------
sfent, sfnum, sfname, sfctype, sfxcode, setsf, endsf



PURPOSE

Site file entry access routines.

LIBRARY

Standard C Library (libc.a)

SYNTAX

#include <sf.h>
#include <sys/types.h>




                struct sf *sfent()          struct sf *sfxcode(xcode)
                                            short xcode;
                struct sf *sfnum(sitenum)
                siteno_t sitenum;           setsf()

                struct sf *sfname(sitename) endsf()
                char *sitename;

                struct sf *sfctype(cputype)
                char *cputype;



DESCRIPTION

These routines are used to access the site file /etc/site.  The site file is
used primarily by the Transparent Computing Facility and contains information
about each machine in the TCF cluster.  If TCF is not installed, the site file
has one entry for the local machine.  This entry contains the name of the
machine as entered during the installation of the AIX Operating System.  This
name is also returned in nodename by the uname system call.

The sfent, sfnum, sfname, sfctype and sfxcode subroutines return a pointer to a
structure containing the fields of a line in the /etc/site file.  The sf
structure is defined in the sf.h header file and contains the following
members:








Processed November 7, 1990        SFENT(3,L)                                  1





SFENT(3,L)                  AIX Technical Reference                  SFENT(3,L)



      short   sf_id;          /* Site ID                */
      char    *sf_sname;      /* Site name              */
      char    *sf_local;      /* Local file system name */
      char    *sf_ctype;      /* CPU type name          */
      short   sf_ccode;       /* CPU type code          */
      char    *sf_cname;      /* Full CPU type name     */
      char    *sf_fname;      /* Full site name         */
      short   sf_speed;       /* CPU speed              */

The setsf subroutine opens the site file and keeps it open across the other
calls.  If several entries are to be accessed, setsf should be called first.
If the site file is already open, setsf rewinds it.

The sfent subroutine reads the next entry from the site file /etc/site.  The
site file is opened if necessary.

The sfnum subroutine returns the site information for the machine specified by
sitenum.  If the specified site number is not found, NULL is returned.  If the
site file had to be opened to satisfy this request, it is also closed.

The sfname subroutine returns the site information for the machine specified by
sitename.  If the specified site name is not found, NULL is returned.  Case is
ignored in name comparisons.  If the site file had to be opened to satisfy this
request, it is also closed.

The sfctype subroutine returns the site information for the next entry with a
CPU type name that matches the type specified by cputype.  NULL is returned if
a matching entry is not found.  The site file is opened if necessary.

The sfxcode subroutine returns the site information for the next entry with a
CPU type code that matches the type specified by xcode.  NULL is returned if a
matching entry is not found.  The site file is opened if necessary.

The endsf subroutine closes the site file.

RETURN VALUE

All information is returned in a static area, so it must be copied if it is to
be saved.  All routines return NULL upon error.

FILE

/etc/site   Site description file

RELATED INFORMATION

In this book: "uname, unamex."








Processed November 7, 1990        SFENT(3,L)                                  2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026