VirtualBox

Changeset 27743 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Mar 26, 2010 2:50:55 PM (15 years ago)
Author:
vboxsync
Message:

IPRT,*: Renamed RTProcDaemonize to RTProcDaemonizeUsingFork. Added a new RTPRocDaemonize that is portable. RTProcCreate* got a new flag RTPROC_FLAGS_DETACHED, while RTPROC_FLAGS_DAEMONIZE got renamed to RTPROC_FLAGS_DAEMONIZE_DEPRECATED.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/process.h

    r27676 r27743  
    184184/** @name RTProcCreate and RTProcCreateEx flags
    185185 * @{ */
     186/** Detach the child process from the parents process tree and process group,
     187 * session or/and console (depends on the platform what's done applicable).
     188 *
     189 * The new process will not be a direct decendent of the parent and it will not
     190 * be possible to wait for it, i.e. @a phProcess shall be NULL. */
     191#define RTPROC_FLAGS_DETACHED               RT_BIT(0)
     192
    186193/** Daemonize the child process, without changing the directory.
    187  * @remarks Not implemented on all platforms yet... */
    188 #define RTPROC_FLAGS_DAEMONIZE          RT_BIT(0)
     194 * @deprecated Dont use this for new code, it is not portable.  Use
     195 *             RTProcDaemonize instead. */
     196#define RTPROC_FLAGS_DAEMONIZE_DEPRECATED   RT_BIT(1)
    189197/** @}  */
    190198
     
    288296
    289297/**
     298 * Daemonize the current process, making it a background process.
     299 *
     300 * The way this work is that it will spawn a detached / backgrounded /
     301 * daemonized / call-it-what-you-want process that isn't a direct child of the
     302 * current process.  The spawned will have the same arguments a the caller,
     303 * except that the @a pszDaemonizedOpt is appended to prevent that the new
     304 * process calls this API again.
     305 *
     306 * The new process will have the standard handles directed to/from the
     307 * bitbucket.
     308 *
     309 * @returns IPRT status code.  On success it is normal for the caller to exit
     310 *          the process by returning from main().
     311 *
     312 * @param   papszArgs       The argument vector of the calling process.
     313 * @param   pszDaemonized   The daemonized option.  This is appended to the end
     314 *                          of the parameter list of the daemonized process.
     315 */
     316RTR3DECL(int)   RTProcDaemonize(const char * const *papszArgs, const char *pszDaemonizedOpt);
     317
     318/**
    290319 * Daemonize the current process, making it a background process. The current
    291320 * process will exit if daemonizing is successful.
    292321 *
    293  * @returns iprt status code.
     322 * @returns IPRT status code.   On success it will only return in the child
     323 *          process, the parent will exit.  On failure, it will return in the
     324 *          parent process and no child has been spawned.
     325 *
    294326 * @param   fNoChDir    Pass false to change working directory to "/".
    295327 * @param   fNoClose    Pass false to redirect standard file streams to the null device.
     
    298330 *                      exists or cannot be written. May be NULL.
    299331 */
    300 RTR3DECL(int)   RTProcDaemonize(bool fNoChDir, bool fNoClose, const char *pszPidfile);
     332RTR3DECL(int)   RTProcDaemonizeUsingFork(bool fNoChDir, bool fNoClose, const char *pszPidfile);
    301333
    302334/**
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette