Fork and execute a process

If you need to run some program or script as a separate process, you can use the mi_process_exec() function. The mi_process_exec() function forks and executes a new process and returns immediately. The database server does not wait for completion, and the new process is allowed to run independently.

Restriction: Never use the operating-system fork() and exec() calls from within a UDR. These system calls are unsafe within a UDR. (For more information, see Unsafe operating-system calls.) If you must execute a separate process, use the mi_process_exec() function to create this new process.

The mi_process_exec() function is similar to most operating-system exec() system calls in that you pass the function an argv array. This array contains all the command strings that are to be passed after the new process is forked. For more information about the syntax of the argv array, see the description of the mi_process_exec() function in the Informix® DataBlade® API Function Reference.