procnto*

QNX SDP8.0Utilities ReferenceUtilities

Microkernel and process manager (QNX OS)

Note:
The safety and standard versions of procnto use different default values for some of the command-line options. If you're using the QNX OS for Safety, see the entry for procnto included in Installing and Using the QNX OS for Safety.

Syntax:

procnto* [-a d|e|s] [-b~l] [-C tick_frequency[,clock_IST_priority]]
         [-d umask] [-F number] [-h] [-H size] [-iu]
         [-m memmgr_configuration] [-n] [-P priority[s]] [-q string]
         [-S bytes_after[,bytes_before]] [-T timeout] [-u umask] [-v] [-x]

Runs on:

QNX OS

Options:

Note:
  • Some options accept a tilde (~) that clears the boolean value.
  • On all currently supported hardware, misaligned accesses are supported in hardware, so you typically don't need to use the -ad and -ae options.
-ad
Disable alignment fault emulation. The procnto manager doesn't attempt to make misaligned memory accesses work; they'll cause a SIGBUS signal for the offending thread. The -ad option isn't supported on any currently supported platform.
-ae
Enable alignment fault emulation. The procnto manager attempts to make misaligned memory accesses work, although they'll be slow. This isn't guaranteed to work; offending threads may still get a SIGBUS signal.
-as
Use the system default for alignment faults. The default is -ae for all supported platforms.
-bl, -b~l
By default, -bl calls to procmgr_ability() that specify locked abilities do not fail. This behavior prevents processes from failing when abilities are controlled from outside of a process (e.g., using a security policy).

For backwards compatibility, specify -b~l to handle these kinds of calls to procmgr_ability() as they were in pre-7.0.4 versions.

-C tick_frequency [,clock_IST_priority]
Specify the system tick frequency in Hertz (Hz) and, optionally, the priority of the clock Interrupt Service Thread (IST).
Although the system is always tickless, it still supports the concept of a periodic tick. The specified tick frequency is the granularity of the clock interrupt for all time-based operations ("normal" timers, round-robin scheduling, etc.) with the exception of HRTs, which use the granularity of the timer hardware. When this option is not set, the default frequency is 1 kHz (1 ms).

If the frequency of the timer hardware that the system tick is based on is not able to provide the exact frequency requested, the tick period is the closest value that the hardware can provide. For example, timer hardware at a frequency of 8,333,333 Hz cannot provide an exact 1 kHz tick (1,000,000 nsec period); instead, it provides a 999,960 nsec period. You can retrieve the actual system tick period via ClockPeriod().

Specify clock_IST_priority when some threads must take precedence over the clock IST (most probably for latency reasons). For example, the threads of a hardware driver that need to be serviced within a very small time frame. If clock_IST_priority is not specfied, the clock IST runs at a priority of 254, just below inter-processor interrupt ISTs.

Note:
Threads that run at higher priority than the clock ISTs cannot rely on time functionalities, such as software timers, and should avoid interacting with them.

To use the default value for either tick_frequency or clock_IST_priority, specify 0 (zero). For example, to set the clock IST priority to 200 but use the system's default tick frequency of 1 kHz, specify -C 0,200.

You can retrieve values passed to procnto from /proc/config. For example:

# cat /proc/config

clock_freq:1000
clock_prio:254
-d umask
Use the given file-creation mask (umask) when creating the /proc/pid/cmdline and /proc/pid/ctl files. If you don't specify this option, procnto uses a mask of 0022. Access to these files is governed by a combination of POSIX permissions and process-manager abilities. For more information, see Controlling processes via the /proc filesystem in the Processes chapter of the QNX OS Programmer's Guide.
-F number
The maximum number of file descriptors that can be open at the same time. The minimum allowable value is 100. The default value is 1000, but might be constrained by the RLIMIT_NOFILE system resource.
Note:
Sockets, named semaphores, and message queues all use file descriptors. Connection IDs (coids) for side channels and server connection IDs (scoids) are returned from a different space than file descriptors, so they don't count towards the limit set by the procnto -F option or RLIMIT_NOFILE.

To determine the current limit, use the ksh builtin command, ulimit, or call getrlimit().

-h, -~h
Disable (-h) or enable (-~h) CPU halting in idle thread. Some CPU and supporting chipsets can lock up if the CPU halts when idle; you'll notice the need for the -h option right away because your system will lock up after booting. The default is to enable CPU halting. Be aware of any errata for your hardware and contact us if you need help working around them.
-H size
Set the initial heap size for procnto. If more memory is required, it's dynamically obtained; however, by setting a properly calculated value, you can speed up boot time and reduce the amount of physical memory fragmentation.

The size parameter indicates the number of bytes to grow the heap in advance. You can postfix this value with a multiplier character, such as k (kilobyte) or m (megabyte). For example:

1m == 1024k == 0x100000

If the number is less than 1024 and it isn't postfixed by a multiplier character, it's assumed to be in kilobytes. The default value is 512 KB, and the minimum size permitted is 1 KB.

-iu -i~u
Specifies how the system responds to an unexpected interrupt:
  • -iu — ignores it (the current default).
  • -i~u — goes into a design safe state (DSS).

An interrupt is unexpected if no handlers are attached to it (i.e., no calls to InterruptAttach*() for that interrupt source).

-m memmgr_configuration
Control the behavior of the memory manager. The memmgr_configuration string is a sequence of characters that enable (or if preceded with a ~ character, disable) memory-manager aspects. See Memory configuration, below.
Note:
If you specify more than one -m option, procnto ignores all but the last one, even for characters that differ between the option strings. For example, if you include -mL -m~x on your command line, then procnto ignores the L configuration option and uses only the ~x one.

The same is true if you use the same configuration option more than once within the same -m option. For instance, if you specify -mLxbr~x, then procnto applies the ~x option (the last usage) but not the earlier x option.

-n, -~n
Note:
In this release, lazy stack allocation is disabled, so setting these options has no effect.
Use (-n) or don't use (-~n) nonlazy stack allocation. If nonlazy stack allocation is in effect, memory for the stack is reserved when a thread is allocated. Otherwise physical memory for a thread's stack is allocated on demand.
-P priority[s]
Set the upper end of the range of unprivileged priorities to priority − 1. Priorities range from 0 through 255:
Range Priorities
Idle thread 0
Unprivileged 1 through (priority − 1)
Privileged 1 through 255

In order to run at a priority above the unprivileged range, a process must have the PROCMGR_AID_PRIORITY ability enabled (see procmgr_ability() in the C Library Reference). The default value of priority is 64. If priority is less than 10, procnto uses a value of 10; if priority is greater than 256, it uses a value of 256.

You can append an s or S to the priority if you want out-of-range priority requests by default to use the maximum allowed value (reach a maximum saturation point) instead of resulting in an error.

-q string
Enable file usage restrictions; the string can include one or both of the following characters:
  • s — ignore the setuid or setgid bits of files. The effect is similar to specifying -o nosuid when you mount any filesystem (see mount).
  • t — enable pathtrust.
For more information, see Pathtrust in the System Security Guide.
-S bytes_after[,bytes_before]
Specify the number of bytes after and (optionally) before the stack pointer to include in a kernel dump. The default values are 128 bytes after and 0 bytes before. If you specify a value that's zero or greater than UINT_MAX, it's ignored. For more information, see the Reading a Kernel Dump technote.
-T timeout
Specify the number of seconds to wait for a close() to succeed in the event of a process termination. The default is 30 seconds; if you specify a value of 0, the default is used.

When a process terminates, any outstanding connections are closed. This means that an _IO_CLOSE message is synthesized and sent to the resource manager responsible for that connection.

Because it is not guaranteed that the server will reply in a reasonable amount of time, a TimerTimeout() call before the send guarantees that the termination process will proceed.

-u umask
Use the given file-creation mask (umask) when creating the /proc/pid/as, /proc/pid/exefile, /proc/pid/mappings, /proc/pid/pmap, and /proc/pid/vmstat files. If you don't specify this option, procnto uses a mask of 0066. Access to these files is governed by a combination of POSIX permissions and process-manager abilities. For more information, see Controlling processes via the /proc filesystem in the Processes chapter of the QNX OS Programmer's Guide.
-v[v]..., -~v
Be verbose; specifying more v characters increases the verbosity. If you specify the -v option, you'll get more useful information when a process is terminated by a signal. If you specify -~v, verbosity is turned off.
-x
Each thread has a buffer that the kernel can use when passing small messages. By default each of these buffers is 256 bytes. If you specify the -x option, each buffer is extended to be 2 KB (less some overhead), which avoids the overhead of long message passing and hence improves performance.

Description:

The procnto system process contains the microkernel, process management, memory management, and pathname management. It's required in all bootable images made using the mkifs utility. For more information, see the QNX OS System Architecture guide.

There are different versions of procnto for different processors (see the Board Support Package for your board for specific information). The most common version is procnto-smp-instr, which runs on single- or multicore systems and is instrumented for system analysis. For more information, see the System Analysis Toolkit User's Guide and the Analyzing Performance chapter of the IDE User's Guide.

Note:
  • To determine the release version of the kernel on your target system, use the uname -ak command.

    If you're running a safety version of the kernel, the release level includes an uppercase S.

  • You can use the appropriate startup-* command's -P option to specify the maximum number of CPUs to activate.

The kernel also manages named semaphores, which appear in the pathname space under /dev/sem. The sem_* client functions handle named semaphores; for more information, see the QNX OS C Library Reference.

Memory configuration options

The memory configuration characters that you can specify with the -m option include the following:

b, ~b
Enable (b) or disable (~b) backward compatibility. The default is to enable it (b).
g, ~g
Add (g) or don't add (~g) a guard page before any shared memory allocations. The default is not to add one (~g).
l, ~l
(el) Lock (l) or don't lock (~l) all memory.
Note:
In this release, all memory is locked, so these options have no effect.
Locking all memory acts as if mlockall(MCL_CURRENT|MCL_FUTURE) was specified at the start of every program. For more information, see mlockall() in the QNX OS C Library Reference.
L, ~L
Lock and superlock (L) or don't lock and superlock (~L) all memory.
Note:
In this release, all memory is locked and superlocked, so these options have no effect.
Locking and superlocking all memory acts as if ThreadCtl( _NTO_TCTL_IO_LEVEL, _NTO_IO_LEVEL_1) was specified at the start of every program (but only insofar as locking the memory; programs don't actually get I/O privileges).
r, ~r
Use (r) or don't use (~r) address space layout randomization (ASLR) by default. If you use ASLR, the kernel places certain items (e.g., the stack, libc) at different addresses every time you run a process. This can help prevent someone from hacking into a program.

The default is to use ASLR (r).

A child process normally inherits its parent's ASLR setting. You can use the on command, or posix_spawnattr_setaslr() to change this setting for a new process.

X, ~X
Disallow (X) or allow (~X) mmap() or mprotect() to turn on PROT_EXEC for a memory-mapped file mapping if the file doesn't have execute permission for the client process. If you specify X, such attempts result in an error of EACCES. The default is to allow it (~X).
x, ~x
These options no longer have any effect; by default, a binary's stack isn't executable, but you can use the elfnote utility to change this.

The /proc filesystem

The Process Manager component of procnto implements a /proc virtual filesystem that lets you access and control the processes and threads running in the system.

CAUTION:
This interface is intended for gathering information and debugging. Don't use it in production systems to control the behavior of processes and threads.

The /proc virtual filesystem includes the following:

/proc/pid/
Virtual directories that let you access and control every process and thread running within the system. For more information, see Controlling processes via the /proc filesystem in the Processes chapter of the QNX OS Programmer's Guide.
/proc/boot/
The image filesystem that comprises the boot image. For more information, see OS Images in Building Embedded Systems.
/proc/config
A virtual file that summarizes the configuration settings for procnto. Here's some sample output:
# cat /proc/config
align_fault:off
fd_close_timeout:30
ker_verbose:1
maxfds:1000
nohalt:false
pregrow_size:524288
priv_prio.prio:64
priv_prio.saturate:0
procfs_ctl_umask:0777
procfs_umask:0777
shutdown_stack_len:128/0
pathtrust:0
prp_load_profile:0
clock_freq:1000
clock_prio:254
proc_thread_pool:3,10,75
mm_cleanup_prio:10
mmflags:0x219 (BACKWARDS_COMPAT,LOCKALL,SUPERLOCKALL,RANDOMIZE)
virtualization:disabled
The settings correspond to the command-line options as follows:
Field Option Description
align_fault -ad, -ae, -as Indicates whether unaligned accesses cause a fault; off or on. Disabling unaligned access emulation with the command-line option enables the generation of a fault on an unaligned access.
fd_close_timeout -T The time, in seconds, to wait for a close() to succeed in the event of a process termination.
ker_verbose -v The verbosity level.
maxfds -F The maximum number of file descriptors that can be open at the same time.
nohalt -h, -~h Whether or not CPU halting is disabled in the idle thread; 0 or 1.
pregrow_size -H The initial heap size for procnto, in bytes.
priv_prio.prio -P The lower end of the range of privileged priorities.
priv_prio.saturate -P Whether or not out-of-range priority requests use the maximum allowed value (reach a maximum saturation point) instead of resulting in an error.
procfs_ctl_umask -d The file-creation mask, in octal, used for the /proc/pid/ctl entries.
procfs_umask -u The file-creation mask, in octal, used for the /proc/pid/as entries.
shutdown_stack_len -S The number of bytes after and before the stack pointer to include in a kernel dump.
pathtrust -q t Whether or not pathtrust is enabled; 0 or 1
clock_freq -C The system tick frequency in Hertz (Hz).
clock_prio -C The priority of the clock Interrupt Service Thread (IST).
ignore_unexpected_interrupts -iu, -i~u In the event of an unexpected interrupt, whether the system ignores it (true) or goes into a design safe state (false).
proc_thread_pool None; see the PROC_THREAD_POOL environment variable The configuration of procnto's thread pool, including the low-water mark, high-water mark, and maximum number of threads.
virtualization startup-* option (-Q) Whether access to hypervisor features is enabled, and, optionally, for AArch64 platforms, the exception level (EL) at which the host runs. Go to startup-* options for more information.
The mmflags field indicates which memory-management flags are set. You can use the -m command-line option to set some. The flags include the following:
Flag Option Description
BACKWARDS_COMPAT -mb Backward compatibility is enabled.
CACHEOP_NOCACHE None Because of a specific chip erratum, cache operations can't be done on non-cacheable memory.
LOCKALL -ml, -mL All memory is locked.
RANDOMIZE -mr Address space layout randomization (ASLR) is being used.
SHMEM_GUARD -mg Add a guard page before any shared memory allocations.
SUPERLOCKALL -mL All memory is superlocked.
/proc/dumper
A special entry that receives notification when a process terminates abnormally. The dumper utility watches this entry.
/proc/mount/
Pathname-space mountpoints.
Note:
If you list the contents of the /proc directory, /proc/mount doesn't show up, but you can list the contents of /proc/mount.
/proc/self/
The address space for yourself (i.e., for the process that's making the query).
/proc/vm/stats
A global view of the state of virtual memory in the system.

Environment variables:

PROC_THREAD_POOL= low[,high[,max]]
Specify the configuration of procnto's thread pool. You must specify the low-water mark, and you can optionally include the high-water mark and maximum number of threads. If the values are invalid, they're ignored. The default values are 3, 10, and 75, respectively.
Page updated: