fs_crypto_enable()

Updated: October 26, 2022

Enable encryption support on a filesystem

Synopsis:

#include <fs_crypto_api.h>
#include <sys/fs_crypto.h>

int fs_crypto_enable( const char *path,
                      int *preply );

Arguments:

path
The path to the filesystem's mountpoint.
preply
A pointer to a location where the function can store additional success or error information.

Library:

libfscrypto

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

Description:

The fs_crypto_enable() function enables encryption support on a volume.

Note:
  • In order to use filesystem encryption, download the Encrypted Filesystem package from the QNX Software Center.
  • You must be in the group that owns the filesystem's mountpoint in order to enable encryption.

This function sets the variable pointed to by preply to one of the following values:

FS_CRYPTO_REPLY_ALREADY
Encryption was already enabled on the filesystem.
FS_CRYPTO_REPLY_COMPLETE
Encryption is now enabled on the filesystem.
FS_CRYPTO_REPLY_INVALID
The command wasn't completed successfully.
FS_CRYPTO_REPLY_READONLY
The filesystem is read-only.

Returns:

EOK
Success.
EBADFSYS
Corrupted filesystem detected.
ENOTDIR
The path isn't a directory.
ENOTSUP
The filesystem doesn't support encryption.
EROFS
The filesystem is mounted read-only.

This function can also return any of the errors indicated by devctl(), open64(), fstat64(), or fstatvfs64().

Classification:

QNX Neutrino

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