UnixProcessParameters Struct

struct QProcess::UnixProcessParameters

この構造体は Qt 6.6 で導入されました。

詳細な説明

注意: この構造体はUnixプラットフォームでのみ使用可能です。

この構造体は、QProcess::setUnixProcessParameters() を使用して、子プロセスに追加の Unix 固有の設定を渡すために使用できます。

メンバは以下のとおりです:

  • UnixProcessParameters::flags フラグ。QProcess::UnixProcessFlags
  • UnixProcessParameters::lowestFileDescriptorToClose クローズする最低ファイル記述子。

QProcess::UnixProcessFlags::CloseFileDescriptors フラグがflags フィールドに設定されている場合、QProcess は子プロセスを実行する前にアプリケーションの開いているファイル記述子を閉じます。記述子0、1、2(つまり、stdinstdoutstderr )は、lowestFileDescriptorToClose フィールドの値より小さい番号の記述子とともに、そのまま残される。

上記のすべての設定は、QProcess::setChildProcessModifier()で設定されたハンドラからそれぞれのPOSIX関数を呼び出すことで、手動で実現することもできる。この構造により、QProcess 、プラットフォーム特有の差異に対応し、特定の最適化の恩恵を受け、コードの重複を減らすことができる。さらに、これらの関数のいずれかが失敗した場合、QProcessQProcess::FailedToStart 状態に入るが、子プロセス修飾子のコールバックは失敗することが許されない。

QProcess::setUnixProcessParameters() およびQProcess::setChildProcessModifier()も参照のこと

© 2025 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.