UnixProcessParameters Struct

struct QProcess::UnixProcessParameters

This struct was introduced in Qt 6.6.

Detailed Description

Note: This struct is only available on Unix platforms

This struct can be used to pass extra, Unix-specific configuration for the child process using QProcess::setUnixProcessParameters().

Its members are:

  • UnixProcessParameters::flags Flags, see QProcess::UnixProcessFlags
  • UnixProcessParameters::lowestFileDescriptorToClose The lowest file descriptor to close.

When the QProcess::UnixProcessFlags::CloseFileDescriptors flag is set in the flags field, QProcess closes the application's open file descriptors before executing the child process. The descriptors 0, 1, and 2 (that is, stdin, stdout, and stderr) are left alone, along with the ones numbered lower than the value of the lowestFileDescriptorToClose field.

All of the settings above can also be manually achieved by calling the respective POSIX function from a handler set with QProcess::setChildProcessModifier(). This structure allows QProcess to deal with any platform-specific differences, benefit from certain optimizations, and reduces code duplication. Moreover, if any of those functions fail, QProcess will enter QProcess::FailedToStart state, while the child process modifier callback is not allowed to fail.

See also QProcess::setUnixProcessParameters() and QProcess::setChildProcessModifier().

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.