Load and execute a child process within the current program memory.
Compatibility:This function is compatible with the following targets:
|
EMB/RTOS
|
Win32
|
|
#include <unistd.h>  
int exec(const char *path, ...);
int execl(const char *path, ...);
int execle(const char *path, ...);
int execlp(const char *path, ...);
int execv(const char *path, ...);
intexecve(const char *path, ...);
int excevp(const char *path, ...);
NOTE
exec-type calls pass through -exec(), because argument passing (argc, argv) doesn't exist for MacOS applications
Parameters for this facility are:
|
UNIX Function
|
On the Macintosh System
|
|---|---|
Launches the application named and then quits upon successful launch. Example of usage is given in "Example of exec() usage.."
Returns:
NOTE
#include <stdio.h>
#include <SIOUX.h>
#include <unistd.h>
#define SIZE FILENAME_MAX
char appName[SIZE] = "Macintosh HD:SimpleText";
int main(void)
{
SIOUXSettings.autocloseonquit = 1;
SIOUXSettings.asktosaveonclose = 1;
printf("Original Program\n");
exec(appName);
printf("program terminated"); /* not displayed */
return 0;
}
result
Display "Original Program"
after the close of the program
the SimpleText application is launched
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000