本文整理汇总了C++中ACE_Process_Options::getgroup方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_Process_Options::getgroup方法的具体用法?C++ ACE_Process_Options::getgroup怎么用?C++ ACE_Process_Options::getgroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_Process_Options
的用法示例。
在下文中一共展示了ACE_Process_Options::getgroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
ACE_OS::dup2 (saved_stdin, ACE_STDIN);
}
if (options.get_stdout () != ACE_INVALID_HANDLE) {
if (saved_stdout == -1)
ACE_OS::close (ACE_STDOUT);
else
ACE_OS::dup2 (saved_stdout, ACE_STDOUT);
}
if (options.get_stderr () != ACE_INVALID_HANDLE) {
if (saved_stderr == -1)
ACE_OS::close (ACE_STDERR);
else
ACE_OS::dup2 (saved_stderr, ACE_STDERR);
}
if (this->child_id_ == ACE_INVALID_PID)
{
errno = my_errno_;
}
return this->child_id_;
#else /* ACE_WIN32 */
// Fork the new process.
this->child_id_ = ACE::fork (options.process_name (),
options.avoid_zombies ());
if (this->child_id_ == 0)
{
# if !defined (ACE_LACKS_SETPGID)
// If we're the child and the options specified a non-default
// process group, try to set our pgid to it. This allows the
// <ACE_Process_Manager> to wait for processes by their
// process-group.
if (options.getgroup () != ACE_INVALID_PID
&& ACE_OS::setpgid (0,
options.getgroup ()) < 0)
{
#if !defined (ACE_HAS_THREADS)
// We can't emit this log message because ACE_ERROR(), etc.
// will invoke async signal unsafe functions, which results
// in undefined behavior in threaded programs.
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p.\n"),
ACE_TEXT ("ACE_Process::spawn: setpgid failed.")));
#endif
}
# endif /* ACE_LACKS_SETPGID */
# if !defined (ACE_LACKS_SETREGID)
if (options.getrgid () != (uid_t) -1
|| options.getegid () != (uid_t) -1)
if (ACE_OS::setregid (options.getrgid (),
options.getegid ()) == -1)
{
#if !defined (ACE_HAS_THREADS)
// We can't emit this log message because ACE_ERROR(), etc.
// will invoke async signal unsafe functions, which results
// in undefined behavior in threaded programs.
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("%p.\n"),
ACE_TEXT ("ACE_Process::spawn: setregid failed.")));
#endif
}
# endif /* ACE_LACKS_SETREGID */
# if !defined (ACE_LACKS_SETREUID)