Creates a NetWare Core Protocol (NCP) session with the named NetWare server.
#include <client.h> int ncp_open ( const char *servername, int oflag, unsigned long flags, int identity );
(IN) Points to the name of the NetWare server, either local or remote.
(IN) Specifies the open mode with one of the following values:
(IN) Specifies whether the servername parameter points to a name or a network address.
(IN) Specifies an identity returned from a call to the create_identity function.
If successful, returns an NCP session handle. Otherwise returns -1 and sets errno.
Once you have an NCP session handle, you use ncp_send to send requests to the server.
The close() function is used to dismantel the session and disposes of all associated resources. It does not, however, dispose of the user identity passed to ncp_open. For information on deleting an identity token, see the delete_identity function.
An identity created with the create_server_identity function does not work when attempting to create a session with a remote server.
Most file system operation functions do not work with session descriptors; the select function is one that does although it always returns ready except when in the third array. The session descriptor can be dup’d and is open and accessible in children created with fork as well as exec’d children as long as FD_CLOEXEC was not passed in oflag when the parent opened the session.
Certain file system operation requests (such as eof, ioctl, filelength, tell, lseek, read, write, readv, writev, pread, and pwrite) make no sense with an NCP session handle. When one of these functions is called using an NCP session handle, EWRNGKND is passed back to signal this fact.