fdistrusted()

Determine if a file is trusted

Synopsis:

#include <unistd.h>

int fdistrusted( int fd );

Since:

BlackBerry 10.0.0

Arguments:

fd
A descriptor for the file that you want to check.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The fdistrusted() function determines whether or not the file associated with the given file descriptor is trusted or is in a trusted filesystem.

If a process with any privileged abilities enabled—see procmgr_ability()—attempts to mark a region of memory as PROT_EXEC, any memory-mapped files in the region must be trusted or be from a trusted filesystem.

You can use the pathtrust to mark files or filesystems as trusted. If no files or filesystems are designated as trusted, all are trusted.

Returns:

EOK if the file is trusted, EPERM if it isn't, or some other errno value if an error occurred.

Classification:

QNX Neutrino

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

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus