69,373
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc,char *argv[],char **environ)
{
char *p;
pid_t pid;
setenv("VERSION_MAIN","1.08",1);
putenv("BUILD_DATE=April 16th, 2011");
if((pid=fork())<0)
{
printf("Error\n");
exit(1);
}
if(pid==0) /* child process */
{
p=getenv("VERSION_MAIN");
puts(p);
p=getenv("BUILD_DATE");
puts(p);
}
return 0;
}