DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

getbsvalue(D3oddi)


getbsvalue: getbsflag, getbsvalue, getbsword -- get configuration information from the bootstring

Synopsis

#include <sys/strg.h>

int getbsword(const char *module, const char *name, char *buffer, unsigned buflen);

int getbsflag(const char *module, const char *name);

char *getbsvalue(const char *module, const char *name);

Description

These routines access configuration information passed in the bootstring, as described in boot(HW)

Arguments


module and name
point to module.name pairs in the bootstring.

buffer
points to a buffer in which buflen-1 bytes of the bootstring value will be placed. This buffer is always zero-terminated.

buflen
indicates how many bytes (minus 1) of the rightmost word of the bootstring get placed in buffer.

Return values

getbsword( ) and getbsflag( ) return one of the following values:

BS_ABSENT
No word was found corresponding to the specified module and name.

BS_ON
A word was found, but there was no associated value.

BS_VALUE
A matching word and its associated value were found; getbsword places buflen-1 bytes of value in buffer.

On success, getbsvalue( ) returns a string that represents the bootstring value. On failure, getbsvalue( ) returns (char *) -1.

Usage

After the parsing and editing described on the boot(HW) manual page, the command line used to boot the kernel is passed to the kernel as the bootstring. The bootstring consists of a series of words of the following form:

module.name
module.name=value

Normally, device drivers should use their internal name as the module; this is the internal name (xname) specified in the first field of the mdevice(F) file.

A word not preceded by a module is assumed to be in the kernel module. A NULL value for module indicates the kernel module.

getbsword( ) places buflen-1 bytes of the rightmost word in the bootstring matching the specified module and name, into buffer.

Both getbsword( ) and getbsflag( ) return whether or not the requested word existed, and, if it did, whether it had a value.

getbsvalue( ) returns a pointer to the word's value if the preceding getbsflag( ) returned BS_VALUE.

getbsvalue( ) should only be called if the corresponding getbsflag( ) returns BS_VALUE.

Context and synchronization

Any context

These functions may be called at any time on any CPU at any spl(D3oddi) level. They do not sleep (see sleep(D3oddi)). No interlocking is required.

Hardware applicability

All

Version applicability

oddi: 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

Differences between versions

An older version of getbsvalue( ) returned the leftmost word in the bootstring. This is inconsistent with boot, so these functions have been changed to return the rightmost word. The older routines did not allow a quoted value, and a NULL module argument was illegal; these are now supported.

References

boot(HW) mdevice(F) , sleep(D3oddi), spl(D3oddi), string(HW) tab(HW)

``ODDI driver interface version for SCO OpenServer 5'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005