_NutConf()

get or set NuTCRACKER Platform configuration parameters 

Function


SYNOPSIS

#include <nutc.h>

int _NutConf(int command, ...);


DESCRIPTION

The _NutConf() function gets or sets various NuTCRACKER Platform configuration parameters based on the command specified. See the PARAMETERS section for a list of valid command values.


PARAMETERS

command 

Specifies the NuTCRACKER Platform parameter and whether to get or set that parameter. To get the current value, use the _NC_GET_XXX form. To set the value, use the _NC_SET_XXX form. command can one of the following:

_NC_GET_BINARY_OFLAG 
_NC_SET_BINARY_OFLAG 

Gets or sets the default file open mode. The parameter for the GET command is the address of an int variable to receive the current mode. The parameter for the SET function is the new default mode. A value of 1 sets the default file open mode to binary; a value of 0 sets the default file open mode to text.

_NC_GET_DFLT_SYMLINK_IS_DIRECTORY 
_NC_SET_DFLT_SYMLINK_IS_DIRECTORY 

Gets or sets the boolean default used by the symlink() API if and only if the target of the symbolic link does not exist. A value of 1 or TRUE will cause symlink() to create a directory symbolic link while 0 or FALSE will cause it to create a file symbolic link.

_NC_GET_FULL_LFS_SEMANTICS 
_NC_SET_FULL_LFS_SEMANTICS 

Enables or disables additional error checking that is done with some function calls related to the large file extensions. A value of 0 disables the error checks, a value of 1 enables the error checks. The error checks in question have to do with opening, reading and writing disk files that are larger than 2 gigabytes when the O_LARGEFILE flag is not set.

_NC_GET_MAX_COM_PORTS 
_NC_SET_MAX_COM_PORTS 

Gets or sets the maximum number of COM ports available to the process. The parameter for the GET command is the address of an unsigned int variable to receive the current value. The parameter for the SET function is the new value.

_NC_GET_NT_LIMITED_LOCKING 
_NC_SET_NT_LIMITED_LOCKING 

Gets or sets the file locking mode used by the NuTCRACKER Platform. The parameter for the GET command is the address of an int variable to receive the current mode. The parameter for the SET function is the new mode. A value of 1 sets the locking mechanism to use the native Win32 API locking functions; a value of 0 sets the locking mechanism to use the NuTCRACKER Platform implementation of full UNIX file locking semantics.

_NC_GET_PWNAME_PROFILE 
_NC_SET_PWNAME_PROFILE 

Gets or sets the profile handling mode. The parameter for the GET command is the address of an unsigned int variable to receive the current value. The parameter for the SET function is the new value. This setting is used by getpwuid() and getpwnam(). For the case of accounts where no domain home directory has been defined, the default behavior is for the pw_dir returned to be an empty string. If this value is set to 1, then as a fallback the pw_dir field is set to the profile image path (typically the value of the USERPROFILE environment variable for logged-in users).

_NC_GET_SEC_ATTR 
_NC_SET_SEC_ATTR 

Gets or sets the NuTCRACKER Platform security attribute mode. The parameter for the GET command is the address of an int variable to receive the current mode. The parameter for the SET function is the new mode. A value of 1 causes NuTCRACKER Platform to pass a NULL security descriptor to Win32 object creation functions, causing default security behavior to be used; a value of 0 causes NuTCRACKER Platform to use a security descriptor derived from umask() and file-creation mode bits, providing a UNIX security mapping.

_NC_GET_SUFFIXED_SEARCHING 
_NC_SET_SUFFIXED_SEARCHING 

Gets or sets the suffixed searching mode. The parameter for the GET command is the address of an int variable to receive the current mode. The parameter for the SET function is the new mode. A value of 1 causes NuTCRACKER Platform to search for a file with the extension .exe if the specified file passed to access() (with X_OK) or one of the exec() functions does not exist; a value of 0 causes NuTCRACKER Platform to only test for the specified file.

_NC_GET_TIMER_RESUME_MODE 
_NC_SET_TIMER_RESUME_MODE 

Gets or sets the timer resume mode. The parameter for the GET command is the address of an unsigned int variable to receive the current value. The parameter for the SET function is the new value. A value of 1 means that when a timer expires or when sleep() returns, and if the system is in a suspended power conservation mode, that the system will be restored. A value of 0 means that the system will not be restored when these events occur. The default value is 0.

_NC_GET_UTF8_LOCALE 
_NC_SET_UTF8_LOCALE 

Gets or sets the flag to indicate UTF-8 mode. This mode forces all multibyte character conversions to use the UTF-8 Unicode encoding instead of the codepage for the current locale.


RETURN VALUES

If successful, _NutConf() returns a value of zero. On failure, it returns a value of -1 and sets errno to one of the following values:

EFAULT 

A command parameter points to an invalid address.

EINVAL 

Either command is not one of the listed values, or the parameter for the command is invalid.


CONFORMANCE

PTC MKS Toolkit UNIX APIs extension.


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

It is always preferable to modify application code rather than depending on a global setting. For example, if your application were to use _NC_SET_BINARY_OFLAG to set all files to text mode, this could cause problems if you were to pass a file descriptor to a third-party library that assumes the file is in binary mode. Rather than changing the default text mode, you should modify your code to handle the carriage-return/line-feed line separators.

Several of these parameters correspond to environment variables used by the NuTCRACKER Platform. Refer to Environment Variables in the PTC MKS Toolkit UNIX to Windows Porting Guide for more information.

There are additional commands to _NutConf() that you may be asked to use by your support representative, to resolve specific issues. Please do not use any commands that are not documented on this page unless explicitly requested to by MKS Technical Support.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
_NutForkExecl(), _NutForkExecle(), _NutForkExeclp(), _NutForkExeclpe(), _NutForkExecv(), _NutForkExecve(), _NutForkExecvp(), _NutForkExecvpe(), access(), clock_nanosleep(), execl(), execle(), execlp(), execlpe(), execv(), execve(), execvp(), execvpe(), getpwnam(), getpwnam_r(), getpwuid(), getpwuid_r(), nanosleep(), open(), setitimer(), setitimer(), sleep(), symlink(), timer_settime(), umask(), usleep()

Miscellaneous:
lf64


PTC MKS Toolkit 10.1 Documentation Build 15.