sandbox_create()

Create a sandbox.

Synopsis:

#include <sandbox.h>

int sandbox_create(const char *confpath);

Arguments:

confpath
The pathname of the sandbox description file to parse.

Library:

libsandbox

Use the -l sandbox option to qcc to link against this library.

Description:

This function parses a text file and creates a sandbox. The text file must be a UNIX text file (LF) not a DOS text file (CRLF).

Returns:

The sandbox identifier, if successful in creating the sandbox.

negative value
An error occurred (errno is NOT set, the value is the negative of a value from the Errors section) and the sandbox could not be created.

Errors:

EACCES
Search permission is denied on a component of the confpath prefix.
EBADMSG
Parsing the confpath file failed. If you get this error, open the confpath file, and call sandbox_parse_config() directly to debug it. It returns the line on which the parse failed. See the Security Developer's Guide for an example of how to use sandbox_parse_config() to initialize a sandbox configuration.
ENOENT
The confpath file was not found.
ENOMEM
Not enough memory was available to create the sandbox. Failed to allocate local storage for the sandbox.
EPERM
The calling process doesn't have the required permission.

Classification:

QNX Neutrino

Safety:  
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread Yes