sec_getpsec Subroutine

Purpose

Gets the security information that is associated with a process.

Library

Standard C library (libc.a)

Syntax

#include <sys/secattr.h>
int sec_getpsec (pid, credp)
pid_t pid;
secattr_t *credp;

Description

The sec_getpsecsubroutine gets the security attributes structure for the process that is specified by the pid parameter. If the value of the pid parameter is negative, the information structure of the calling process is retrieved. The credp parameter, which is a pointer to an secattr_t structure, specifies a buffer holding the security attributes structure to be returned.

Parameters

Item Description
pid Specifies the process whose security attributes is to be returned.
credp Points to the security attribute structure.

Return Values

Item Description
0 Successful
-1 Unsuccessful

Error Codes

Item Description
EINVAL The value of the credp parameter is NULL or not valid.
ESRCH No process has a process ID equal to the value of the pid parameter.
EPERM The calling process does not have permissions or privileges.
EFAULT The address that the credp parameter points to is not valid.