Sun StorageTek 5800 System Client API Reference Manual


Creates a session.


    hcerr_t hc_session_create_ez(char *host, 
          int port,
          hc_session_t **sessionp);


This function initializes the 5800 system API and must be called before calling any of the other functions in this API. It downloads a copy of the schema for a particular host or port. The schema is used to validate the name-value-type tuples that are added to metadata records.

Both the synchronous and the nonsynchronous C APIs are fully thread-safe and can be used simultaneously in multiple threads from the same process. Each thread must call hc_session_create_ez to create its own session. Sessions must not be shared between threads.

Note –

hc_init should be called once per process before any thread calls hc_session_create_ez. If hc_session_create_ez is called before hc_init, an implicit call is made to hc_init from that thread. But that call to hc_init is not interlocked with other threads, and it uses the C API shared library’s version of malloc and free, which might be different than the application’s version of malloc and free. It is strongly recommended that all applications call hc_init once per process with their own allocator and deallocator.

For more information on hc_init, see Initializing a Global Session



IN: The name or IP address of a 5800 system server.


IN: The port number of the 5800 system server (normally 8080).


OUT: Updated to point to a session object.

Return Codes