Skip Headers
Oracle Hierarchical Storage Manager and QFS Software Command Reference
Section 3x: Introduction to Library Functions
Release 6.1.1
E70305-03

NAME

sam_initrpc - Performs RPC initialization for StorageTek QFS and Oracle HSM RPC API library

SYNOPSIS

cc [ flag … ] file … -L∕opt∕SUNWsamfs∕lib -lsamrpc -l nsl [ library … ]

#include "∕opt∕SUNWsamfs∕include∕samrpc.h"

int sam_initrpc(char * rpchost );

int sam_initrpc_timeout(char * rpchost, int seconds );

sam_initrpc() is the initialization routine for the libsamrpc library. It finds the RPC entry for the StorageTek QFS or Oracle HSM server and creates an RPC client handle. In essence, this routine sets up the connection to the StorageTek QFS or Oracle HSM host machine, required for other API calls in the libsamrpc library. The sam_initrpc_timeout provides the additional capability to specify a timeout value for subsequent Oracle HSM RPC calls. The default timeout value is 25 seconds.

rpchost is the hostname of the StorageTek QFS or Oracle HSM host. If NULL, sam_initrpc() will check for an environment variable named SAMHOST. If such an environment variable exists, its setting will be taken for the hostname of the StorageTek QFS or Oracle HSM host, otherwise the built-in default, samhost, is used.

seconds is the number of seconds used to timeout Oracle HSM RPC calls.

sam_initrpc() and sam_initrpc_timeout() gets the RPC entry (program number) using the program name samfs. This information (the RPC program name and number), and the hostname, is used to set up communication with the StorageTek QFS or Oracle HSM RPC API server process, sam-rpcd, which runs on the StorageTek QFS or Oracle HSM host machine.

RETURN VALUES

Upon successful completion a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.

ERRORS

sam_initrpc() or sam_initrpc_timeout() fails if one or more of the following are true:

EADDRNOTAVAIL

No RPC entry for the program name samfs could be found.

EINVAL

The number of seconds specified in sam_initrpc_timeout() is less than the default.

ECANCELED

Setting the timeout value in sam_initrpc_timeout() failed.

SEE ALSO

sam_closerpc (3x), sam_archive (3x), sam_release (3x), sam_settimeout (3x), sam_stage (3x), sam_stat (3x).