Retrieves the device security information in the privileged device database.
Security Library (libc.a)
The getdevattr subroutine reads a specified attribute from the device database. If the database is not open, this subroutine does an implicit open for reading. For attributes of the SEC_CHAR and SEC_LIST types, the getdevattr subroutine returns the value to the allocated memory. Caller needs to free this memory.
| Item | Description | 
|---|---|
| Device | Specifies the device name. The value should be the full path to the device on the system. This parameter must be specified unless the Type parameter is SEC_COMMIT. | 
| Attribute | Specifies the attribute that is read. The following
possible attributes are defined in the usersec.h file:  
  | 
| Value | Specifies a pointer or a pointer to a pointer according to the Attribute array and the Type parameters. See the Type parameter for more details. | 
| Type | Specifies the type of attribute. The following
valid types are defined in the usersec.h file: 
  | 
| File | Mode | 
|---|---|
| /etc/security/privdevs | rw | 
On successful completion, the getdevattr subroutine returns a value of zero. Otherwise, a value of -1 is returned and the errno global value is set to indicate the error.
If the getdevattr subroutine fails, one of the following errno values is set:
| Item | Description | 
|---|---|
| EINVAL | The Device parameter is NULL or default. | 
| EINVAL | The Attribute or Type parameter is NULL or does not contain one of the defined values. | 
| EINVAL | The Attribute parameter is S_PRIVDEVS, but the Device parameter is not ALL. | 
| ENOENT | The device specified in the Device parameter does not exist. | 
| ENOATTR | The attribute specified in the Attribute parameter is valid, but no value is defined for the device. | 
| EPERM | The operation is not permitted. |