linux编程精髓 源代码

源代码在线查看: ch09-run.c

软件大小: 39 K
上传用户: afaslgo
关键词: linux 编程 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				/* ch09-run.c --- run a program with a different name and any arguments */								#include 				#include 				#include 								/* main --- adjust argv and run named program */								int main(int argc, char **argv)				{					char *path;									if (argc < 3) {						fprintf(stderr, "usage: %s path arg0 [ arg ... ]\n", argv[0]);						exit(1);					}									path = argv[1];									execv(path, argv + 2);	/* skip argv[0] and argv[1] */									fprintf(stderr, "%s: execv() failed: %s\n", argv[0],						strerror(errno));					exit(1);				}							

相关资源