e 时,函数传递指定参数 envp,允许改变子进程的环境,
无后缀 e 时,子进程使用当前程序的环境
void _exit(int status)终止当前程序,但不清理现场
void exit(int status) 终止当前程序,关闭所有文件,写缓冲区的输出(等待输出),
并调用任何寄存器的"出口函数",无返回值
int spawn…运行子程序
int spawnl( int mode,char *pathname,char *arg0,char *arg1,…,
char *argn,NULL)
int spawnle( int mode,char *pathname,char *arg0,char *arg1,…,
char *argn,NULL,char *envp[])
int spawnlp( int mode,char *pathname,char *arg0,char *arg1,…,
char *argn,NULL)
int spawnlpe(int mode,char *pathname,char *arg0,char *arg1,…,
char *argn,NULL,char *envp[])
int spawnv( int mode,char *pathname,char *argv[])
int spawnve( int mode,char *pathname,char *argv[],char *envp[])
int spawnvp( int mode,char *pathname,char *argv[])
int spawnvpe(int mode,char *pathname,char *argv[],char *envp[])
spawn 函数族在 mode 模式下运行子程序 pathname,并将参数
arg0(arg1,arg2,argv[],envp[])传递给子程序.出错返回-1
mode 为运行模式
mode 为 P_WAIT 表示在子程序运行完后返回本程序
P_NOWAIT 表示在子程序运行时同时运行本程序(不可用)
P_OVERLAY 表示在本程序退出后运行子程序
在 spawn 函数族中,后缀 l、v、p、e 添加到 spawn 后,
所指定的函数将具有某种操作能力
有后缀 p 时, 函数利用 DOS 的 PATH 查找子程序文件
l 时, 函数传递的参数个数固定.
v 时, 函数传递的参数个数不固定.
e 时, 指定参数 envp 可以传递给子程序,允许改变子程序运行环境.
当无后缀 e 时,子程序使用本程序的环境.
int system(char *command) 将 MSDOS 命令 command 传递给 DOS 执行
转换子程序,函数库为 math.h、stdlib.h、ctype.h、float.h
char *ecvt(double value,int ndigit,int *decpt,int *sign)
将浮点数 value 转换成字符串并返回该字符串
char *fcvt(double value,int ndigit,int *decpt,int *sign)
将浮点数 value 转换成字符串并返回该字符串
char *gcvt(double value,int ndigit,char *buf)
将数 value 转换成字符串并存于 buf 中,并返回 buf 的指针
char *ultoa(unsigned long value,char *string,int radix)
将无符号整型数 value 转换成字符串并返回该字符串,radix 为转换时所用基
数
char *ltoa(long value,char *string,int radix)
将长整型数 value 转换成字符串并返回该字符串,radix 为转换时所用基数