getfsfbitindex and getfsfbitstring Subroutines

Purpose

Retrieve file security flag indices and strings.

Library

Trusted AIX® Library ( libmls.a )

Syntax

#include <mls/mls.h>

int getfsfbitindex (fsfname)
const char *fsfname;

int getfsfstring (buff, size, index)
char *buff;
int *size;
int index;

Description

The getfsfbitindex subroutine searches in the file security flags table for the file security flag that the fsfname parameter specifies. The file security flag name that the fsfname parameter specified is used as a string.

The getfsfstring subroutine converts the specified file security flag index into a string and stores the result in the buff parameter. The length of the buff parameter is specified by the size parameter. If the length specified by the size parameter is less than that of the string, the getfsfstring subroutine fails and returns the required length into the size parameter for the index that is specified by the index parameter.

Parameters

Item Description
buff Specifies the buffer that the file security flag is copied to.
fsfname Specifies the file security flag to be searched for.
index Specifies the file security flag index that is to be converted to a string.
size Specifies the size of the buffer that the buff parameter specifies.

Return Values

If successful, the getfsfbitindex subroutine returns a value that is equal to or greater than zero. Otherwise, it returns a value of -1.

If successful, the getfsfstring subroutine returns a value of zero. Otherwise, it returns a value of -1.

Error Codes

If these subroutines fail, they set one of the following error codes:

Item Description
EINVAL The parameters specified NULL value or the index is not valid.
ENOSPC The size of the buffer is not large enough to store the file security flag string.