VCSAgGetContainerBasePath

Note:

This API is not supported for Linux Docker containers.

int VCSAgGetContainerBasePath (char *buf, int bufsize, int *exit_info)

This API returns the base path of the container mentioned under the ContainerInfo attribute at group level. This API must be called from the global zone or WPAR.

For Solaris zones:

For WPARs

Input parameters:

buf

Buffer to store the base path of the container. Caller must make the provision to reserve and release the memory for the buffer.

bufsize

Size of the buffer passed.

Output parameters:

buf

Buffer to store the base path of the container at the end of its execution.

exit_info

Provides extended information to the caller in certain cases as described under Return values.

Return values:

0

If ContainerInfo attribute is set properly, which means:

  • Name is set to <valid_container_name>

  • Type is set to <valid_container_type>

  • Enabled is set to 1

Container's base path is returned in the buf parameter.

1

If buf is passed as null.

2

If the buffer size is smaller than the size of the container's base path.

The exit_info parameter is updated to reflect the correct value of the buffer size needed to be passed.

3

If the Enable key of the ContainerInfo attribute is set to 0 or 2. Container's base path is returned in buf parameter only if Name key is set to <valid_container_name>.

4

If the ContainerInfo attribute is not set for the resource. For example, Name key of ContainerInfo is "" or Type key of ContainerInfo is invalid.

5

If command to obtain the base path of the container fails. The exit_info parameter is updated accordingly with the exit status of the command.

6

If OS is not container capable.

See VCSAG_GET_CONTAINER_BASE_PATH.