uname2

Returns the requested information about the system or the NLM.

Library:LibC
Classification:Novell
Service:General C Services

Syntax

  #include <sys/utsname.h> 
   
  int uname2 (
     void             *handle,
     struct utsname   *info,
     unsigned long     bits);
  

Parameters

handle

(IN) Points to a handle for the NLM which you are requesting information. If set to NULL, only the NLM information that is the same for all NLM applications is returned, at most: UNAME_LIBVERSION, UNAME_FSVERSION, UNAME_NETWAREVERSION, UNAME_SERVERNAME, UNAME_CLUSTERNAME, UNAME_POSIXFIELDS, UNAME_LANGINFO, UNAME_NDSTREENAME.

info

(OUT) Points to a structure which contains the requested information.

bits

(IN) Contains a bit mask that specifies the requested information. The following flags can be ORed together to request that specific fields in the utsname structure return with data.

Flag

Value

Requested Field

UNAME_NLMMODULE

0x00000001

nlmmodule field

UNAME_POSIXFIELDS

0x00000002

release, version, sysname, machine, and nodename fields (all POSIX fields)

UNAME_LIBVERSION

0x00000004

libminor, libmajor, and librevision fields

UNAME_FSVERSION

0x00000008

major, minor, revision, servicepack fields

UNAME_NETWAREVERSION

0x00000010

netware_major, netware_minor, and netware_revision fields

UNAME_SERVERNAME

0x00000020

servername field.

UNAME_CLUSTERNAME

0x00000040

clustername field

UNAME_LANGINFO

0x00000080

languagename, altlanguagename, languageid, altlanguageid, and codepage fields

UNAME_NLMMESSAGES

0x00000100

nlmmessagecount/table

UNAME_NLMVERSION

0x00000200

nlmmajor, nlmminor, and nlmrevision fields

UNAME_NLMINFO

0x00000400

nlmtimer and nlmloadflags fields

UNAME_NLMNAME

0x00000800

nlmname field

UNAME_NLMLOADPATH

0x00001000

nlmloadpath field

UNAME_NLMCOPYRIGHT

0x00002000

nlmcopyright field

UNAME_NLMDESCRIPTION

0x00004000

nlmdescription field

UNAME_NLMCOMMANDLINE

0x00008000

nlmcommandline field

Unless the NLM was linked with libcpre.o (so that LibC performed start up for the first thread of the NLM), this field contains an empty string.

UNAME_NDSTREENAME

0x00010000

treename field

UNAME_NLMCODEANDDATA

0x00020000

codelength, dataoffset, and datalength fields

Return Values

If successful, returns 0. In a successful return if the information is unavailable, the affected field will be 0, NULL, or zero-length.

If unsuccessful, returns a non-zero error code.

Decimal

Constant

Description

105

ENOCONTEXT

The handle is NULL and the requested information bits require a valid value for the handle parameter. See the handle parameter for the list of bits that allow the handle parameter to be set to NULL.

Remarks

The uname2 function returns the requested information about the operating system, LibC, the NLM, or the NetWare server. For a description of the fields, see the utsname structure.

The uname2 function has the following advantages over the uname function:

  • The information returned can be restricted to a few fields, thus saving time by not retrieving unneeded information.

  • The information can be returned about an NLM other than the calling NLM. Use the findnlmhandle function to obtain an NLM handle.

See Also