|
|
The library routine doconfig(), defined in libnsl.so, interprets the configuration scripts contained in the files /etc/saf/pmtag/_sysconfig (the per-system configuration file), and /etc/saf/_config (per-port monitor configuration files); and in /etc/saf/pmtag/svctag (per-service configuration files). Its syntax is:
# include <sac.h>script is the name of the configuration script; fd is a file descriptor that designates the stream to which stream manipulation operations are to be applied; rflag is a bitmask that indicates the mode in which script is to be interpreted. rflag may take two values, NORUN and NOASSIGN, which may be or-ed together. If rflag is zero, all commands in the configuration script are eligible to be interpreted. If rflag has the NOASSIGN bit set, the assign command is considered invalid and will generate an error return. If rflag has the NORUN bit set, the run and runwait commands are considered invalid and will generate error returns.int doconfig (int fd, char script, long rflag);
If a command in the script fails, the interpretation of the script ceases at that point and a positive integer is returned; this number indicates which line in the script failed. If a system error occurs, a value of -1 is returned.
If a script fails, the process whose environment was being established should not be started.
In the example, doconfig() is used to interpret a per-service configuration script.
... if ((i = doconfig (fd, svctag, 0)) != 0){ error ("doconfig failed on line %d of script %s", i, svctag); }doconfig() is described on the doconfig(3iac) manual page.