Question about g_spawn_sync/child_setup



Hello everyone.

The g_spawn_sync provides a handy option of providing a setup function
(child_setup) that is executed by the child process before executing the
child's argument vector.  However, child_setup returns void.  Because of
this, there is now way to ensure the success of child_setup before executing
the argument vector.

I am interested in using child_setup to do some UID manipulation.  However,
it is important to ensure that this manipulation does not fail before
executing anything.  How may this be done?  Why does child_setup not return a
gboolean that could then be checked by the g_spawn_sync function before
executing anything?  I wish to avoid calling fork myself.

Thanks!

--
Mike



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]