Updated: April 19, 2023

Wait until a stat() on the specified path succeeds


waitfor pathname [wait_time [poll_ms]]

Runs on:

QNX Neutrino


The path to test.
The maximum number of seconds to wait for the file to appear. It can include one decimal digit to specify tenths of a second. The default is 5.0 seconds.
(QNX Neutrino 6.6 or later) The number of milliseconds to wait between checks for the path. The default is 100 milliseconds.


The waitfor utility pauses temporarily until a stat() on the specified pathname succeeds. It's often used for synchronization, to allow a resource manager to perform its startup functionality, and then for the process manager to proceed with the further interpretation of the script file.

  • The network drivers don't put entries into the /dev/ namespace, so a waitfor command for such an entry won't work properly in buildfiles or scripts. Use if_up -p instead; for example, if_up -p en0.
  • The stat() operation is relatively expensive on QNX Neutrino, so you should avoid having several processes concurrently use waitfor with small polling periods because this can create a lot of resource contention on your system.
  • The process manager has an internal version of waitfor for use when the system is starting. It's similar to this utility but doesn't let you specify a polling time; see Script files in the entry for mkifs.

Exit status:

Zero on success, or a nonzero value if a timeout occurred.