Commonly Used Environment Variables

This appendix describes some of the environment variables that are used with the QNX Neutrino RTOS.

For general information about setting environment variables, see the Configuring Your Environment chapter of the QNX Neutrino User's Guide; for specific information, see the related utilities and programs.

In the table below, the “where used” column indicates whether the variable is used on development hosts, target systems running QNX Neutrino, or both.

Variable Where used Description
AUTOCONNECT Target In order for the /etc/autoconnect script to be run, this environment variable must be defined and set to 1.
BROADCAST Target The dhcp.client passes this environment variable to the /etc/dhcp/dhcp-up script. It indicates the client broadcast address that was obtained from the server.
COLUMNS Target The number of character columns on the screen.
DISPLAY Target The name of the physical display on which to draw.
DL_DEBUG Target If this environment variable is set, the shared library loader displays debugging information about the libraries as they're opened. The value can be a comma-separated list of the following:
  • all — display all debug messages.
  • help — display a help message, and then exit.
  • reloc — display relocation processing messages.
  • libs — display information about shared objects being opened.
  • statistics — display runtime linker statistics.
  • lazyload — print lazy-load debug messages.
  • debug — print various runtime linker debug messages.

A value of 1 (one) is the same as all. See dlopen() in the C Library Reference.

Note: For security reasons, the runtime linker unsets DL_DEBUG if the binary has the setuid bit set.
EDITOR Target The path of the editor you'd like to use by default.
EXINIT Target Default elvis option settings. If set, the contents of this environment variable are executed on startup as a series of ex commands.
FILENAME Target The dhcp.client passes this environment variable to the /etc/dhcp/dhcp-up script. It indicates the filename supplied in the server response.
GATEWAY Target The dhcp.client passes this environment variable to the /etc/dhcp/dhcp-up script. It indicates the gateway that the client is to use.
GNUTARGET Host Specifies the target (output file format) for GNU utilities. For more information, see the Selecting the Target System appendix.
GZIP Target A set of default options for gzip.
HOME Host, target Your current working directory when you first log in. It's specified as one of the fields for each user in /etc/passwd. For more information, see passwd.
HOSTALIASES Target The name of a file containing aliases for hosts. For more information, see gethostbyname() in the C Library Reference.
HOSTNAME Target The name of the host machine.
INTERFACE Target The dhcp.client passes this environment variable to the /etc/dhcp/dhcp-up script. It indicates the interface that was configured (e.g., en0).
IPADDRESS Target The dhcp.client passes this environment variable to the /etc/dhcp/dhcp-up script. It indicates the client IP address that was obtained from the server.
LANG Target The locale to use for the locale categories.
Note: QNX Neutrino currently supports only the POSIX (i.e., C) locale.
LC_TYPE Target The locale for character classification, used by uniq to determine the characters constituting a blank in the current locale.
Note: QNX Neutrino currently supports only the POSIX (i.e., C) locale.
LDEMULATION Host Specifies the linker emulation. For more information, see the Selecting the Target System appendix.
LD_BIND_NOW Target Affects lazy-load dependencies due to full symbol resolution. Typically, it forces the loading of all lazy-load dependencies (until all symbols have been resolved). See dlopen() in the C Library Reference and Optimizing the runtime linker in the “Compiling and Debugging” chapter in the QNX Neutrino Programmer's Guide.
LD_DEBUG Target A synonym for DL_DEBUG. If you set both DL_DEBUG and LD_DEBUG, then DL_DEBUG takes precedence. See dlopen() in the C Library Reference.
Note: For security reasons, the runtime linker unsets LD_DEBUG if the binary has the setuid bit set.
LD_DEBUG_OUTPUT Target The name of a file in which the runtime linker writes its output. By default, output is written to stderr. See dlopen() in the C Library Reference.
Note: For security reasons, the runtime linker unsets LD_DEBUG_OUTPUT if the binary has the setuid bit set.
LD_LIBRARY_PATH Host, target A colon-separated list of paths that the runtime linker uses to search for shared libraries. See dlopen() in the C Library Reference and the Dynamic Linking chapter in the System Architecture guide.
Note: For security reasons, the runtime linker unsets LD_LIBRARY_PATH if the binary has the setuid bit set.
LD_PRELOAD Host, target A colon-separated list of full paths to the shared libraries on an ELF system that you want to load before loading other libraries. You can use this environment variable to add or change functionality when you run a program. See dlopen() in the C Library Reference and the Dynamic Linking chapter in the System Architecture guide.
Note: For security reasons, the runtime linker unsets LD_PRELOAD if the binary has the setuid bit set.
LD_RUN_PATH Host A colon-separated list of the paths to search for shared libraries on an ELF system when linking, if you aren't using the -rpath option for ld. For more information, see the documentation for ld at https://www.gnu.org/software/binutils/.
LD_TRAP_ON_ERROR Target If this environment variable is set, the runtime linker faults instead of exiting on fatal errors, so that you can examine the core file that's generated. See Optimizing the runtime linker in the “Compiling and Debugging” chapter in the QNX Neutrino Programmer's Guide.
LEASEEXPIRES Target The dhcp.client passes this environment variable to the /etc/dhcp/dhcp-up script. It indicates the time at which the lease expires.
LEASEOBTAINED Target The dhcp.client passes this environment variable to the /etc/dhcp/dhcp-up script. It indicates the time at which the lease was obtained.
LESS Target Options that you want to pass to less automatically.
LESSEDIT Target The editor prototype string (used for the v command in less).
LINES Target The number of character lines on the screen.
LOCALDOMAIN Target The local domain name. For more information, see res_init() in the C Library Reference.
LOGNAME Target The userid you used to login; the same as USERNAME.
MAKEFLAGS Host A set of default options for make.
MALLOC_* Target These variables control how the memory allocator behaves; some are supported by the “normal” allocator defined in libc, while some are supported by the librcheck version. For more information, see the entry for mallopt() in the C Library Reference.
MKIFS_PATH Host A colon-separated list of directories that mkifs should use to search for host files to be included in an OS image.
MORE Target Default options for more.
NAMESERVER1, NAMESERVER2 Target The dhcp.client passes these environment variables to the /etc/dhcp/dhcp-up script. They indicate the nameservers that the client is to use.
NAME_MAX Target The maximum permitted length of a component of a pathname.
NETMASK Target The dhcp.client passes this environment variable to the /etc/dhcp/dhcp-up script. It indicates the client netmask that was obtained from the server.
OPTIONx Target The dhcp.client passes these additional environment variables (where x is the option number) to the /etc/dhcp/dhcp-up script.
PATH Host, target A colon-separated list of directories that are searched when the shell looks for commands and .'d files. An empty string resulting from a leading or trailing colon or two adjacent colons is treated as a ., the current directory.

For more information, see ksh.

POSIX_STRICT Target If this environment variable is set, some utilities (e.g., cp, ls, and more) interpret options according to POSIX specifications.
POSIXLY_CORRECT Target This environment variable is used by Unix-style operating systems to alter behavior to comply with POSIX where it's different from the OS's default behavior. POSIXLY_CORRECT is a de facto standard that isn't defined by POSIX.

If the POSIXLY_CORRECT environment variable is set:

  • Functions that check the length of a pathname do so before removing any redundant . and .. components, instead of after.
  • The posix option is enabled for ksh. For more information, see POSIX mode in the documentation for ksh.
PROCESSOR Host Specifies the target CPU when building an image filesystem. If not set, the default is the same as the CPU of the host system (e.g., x86). For more information, see mkifs.
QCC_CONF_PATH Host The name of the directory that contains the configuration files for qcc.
QNX_CONFIGURATION Host The location of the configuration files for the installed versions of QNX Neutrino.
QNX_HOST Host The location of host-specific files for all development hosts.
QNX_TARGET Host The location of target backends on the host machine.
RESCONF Target An way of overriding configuration strings in the resolv.conf file.
SERVER Target The dhcp.client passes this environment variable to the /etc/dhcp/dhcp-up script. It indicates the server's IP address.
SHELL Target The pathname of the command interpreter, or shell, that you want to use. It's set by login.
SOCKS_NS Target The IP address of the domain nameserver that should be used for name resolution by SOCKS client programs.
SOCKS_SERVER Target The name or IP address of the SOCKS proxy server host to use, overriding the default server for SOCKS client programs.
STDIO_DEFAULT_BUFSIZE Target As a QNX Neutrino extension to POSIX standard I/O, you can use this environment variable to override BUFSIZ as the default buffer size for stream I/O. The value of STDIO_DEFAULT_BUFSIZE must be greater than that of BUFSIZ.
SYSLOG Target The node on which syslogd is running.
SYSNAME Target The name of the system.
TERM Target The terminal type.
TERMINFO Target The name of the directory for terminfo files; see tic.
TMPDIR Target The name of a directory where utilities can create temporary files.
TZ Target The timezone definition; see Setting the time zone in the “Configuring Your Environment” chapter of the QNX Neutrino User's Guide.
USER Target The userid you used to login; the same as LOGNAME.