![]() p4SystemLogin() |
![]() DEVELOPER |
![]() |
Initiate Connection to Kernel Manager
Connection/Disconnection Calls
The P4API p4SystemLogin() function is used to initiate a connection to a Kernel Manager.
SYSTEM_HANDLE_T p4SystemLogin (
const char *szMachine,
int nPort,
const char *szEnvironment,
const char *szSystemUserId,
const char *szSystemPassword
);
SzMachine
[in] The DNS name or IP address of the Kernel Manager machine. The domain name will be appended to the DNS name if one is not already supplied in the parameter. Any of the values . (period), localhost or LOCALHOST may be used to indicate the current machine.
nPort
[in] The TCP port number (default 5432) to connect to the Kernel Manager. A value of zero indicates the use of the default value.
szEnvironment
[in] The name of the required kernel environment.
szSystemUserId
[in] The operating system user-name to use for security validation by the Kernel Manager.
szSystemPassword
[in] The operating system password to use.
If no error occurs, p4SystemLogin() returns a system session id for the connection, which must be supplied to other P4API session level calls. Otherwise, it returns a value of INVALID_SYSTEM_HANDLE. A specific error code can be retrieved by calling p4GetLastError().
The correct values of szMachine and nPort to use for a particular Task Name are obtained by calling p4FindTask() before this call.
A calling program can have many p4SystemLogins active at one time. The returned system session ID is used to identify which machine and environment is being manipulated.
The Kernel Manager validates the szSystemUserId/szSystemPassword. These parameters are passed to the Kernel Manager. The Kernel Manager uses them to start the kernel process under the correct system security context. For example, on Unix it is used to su (setuid) to the correct user ID before executing the kernel process.
Topic ID: 540100