Go to main content

man pages section 3: Extended Library Functions, Volume 4

Exit Print View

Updated: Thursday, June 13, 2019
 
 

sstore_warning_next (3SSTORE)

Name

sstore_err_action, sstore_err_code, sstore_err_description, sstore_warning_next - Error interface to Statistics Store

Synopsis

    
     cc [ flag... ] file... -lsstore [ library... ]
     #include <libsstore.h>

     const char const *sstore_err_action(sstore_handle_t hdl);

     sstore_err_t sstore_err_code(sstore_handle_t hdl);

     const char const *sstore_err_description(sstore_handle_t hdl);

     sstore_warning_t sstore_warning_next(sstore_handle_t,
         char **idp, char **descp);

Parameters

hdl

Handle to libsstore

idp

Address to store the identifier

descp

Address to store the warning description

Description

These functions retrieve information about any error that occurred during the most recent function call made using the given libsstore handle.

sstore_err_code() returns the error code. Possible error codes are as follows:

ESSTORE_OK

Success.

ESSTORE_ITER_DONE

No more records left to iterate.

ESSTORE_HANDLE_INVALID

Handle is invalid.

ESSTORE_ARG_INVALID

Some arguments are invalid.

ESSTORE_TOO_BIG

The result size for the function call is larger than the maximum result size requested.

ESSTORE_UNAUTHORIZED

The caller is not authorized.

ESSTORE_RETRY

Statistics Store is busy. Please retry after some time.

ESSTORE_NOMEM

There is insufficient memory.

ESSTORE_CONNECTION_BROKEN

The connection to Statistics Store daemon (sstored(8)) is broken.

ESSTORE_INTERNAL

An internal error occurred.

sstore_err_action() returns a human readable string describing what failed. If no error has occurred it returns a NULL.

sstore_err_description() returns a human readable string describing why the requested operation failed. If no error has occurred it returns a NULL.

sstore_warning_next() retrieves the next warning from the list of warnings for the most recently requested operation. It sets the idp to the identifier associated with the warning and descp to the description of the warning. It returns a warning code associated with the current warning.

Possible warning codes are as follows:

SS_WARN_OK

No Warning.

SS_WARN_HANDLE_INVALID

Handle is invalid.

SS_WARN_INVALID

The given identifier is not valid for the requested operation.

SS_WARN_INTERNAL

Some internal error occurred while during the requested operation for the given identifier.

SS_WARN_CONN_BROKEN

Could not connect to the remote statistics sstore with which the given identifier is associated.

SS_WARN_NOENT

Unable to resolve the ssid.

SS_WARN_UNAUTHORIZED

The caller is not authorized.

Return Values

sstore_err_code() returns an error code.

Upon successful completion, sstore_err_action() and sstore_err_description() return a string. Otherwise, they return NULL.

Upon successful completion, sstore_warning_next() returns a warn code other than SS_WARN_HANDLE_INVALID. It returns SS_WARN_OK when there are no more warnings to iterate through. On failure, it returns SS_WARN_HANDLE_INVALID.

Errors

The sstore_err_action(), sstore_err_description(), and sstore_err_warning() functions will fail if:

ESSTORE_HANDLE_INVALID

The handle is invalid.

sstore_warning_next() will fail if:

SS_WARN_HANDLE_INVALID

The handle is invalid.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
Safe for separate handles

See Also

libsstore(3LIB), sstore_alloc(3SSTORE), attributes(7), sstored(8)