ChinaUnix.net
相关文章推荐:

linux execl

遇到了嵌入式linux下面系统级内存泄露问题。跟踪问题日志。 平台:ARM9 内核:2.6.22 问题:execl造成系统内存减少,通过cat /proc/memoinfo 发现少的内存并且都移往slab中去了 测试代码: #include #include #include #include #include #include #include #include #include #include int main() { int i = 0; int pid = 0; for (i=0; i<1000; i++) { pid = fork(); if (pid < 0) ...

by vikingyi - Linux文档专区 - 2009-10-10 10:25:07 阅读(1089) 回复(0)

相关讨论

请问一下:下面的程序为什么不会输出 :hello! int main() { execl("/bin/ls","ls","-l",NULL); prinf("hello!"); exit(0); } 假如本进程叫作进程1,那么它在执行完execl之后是不是进程1的代码区已被ls的代码区所覆盖了,而不能执行进程1中下面的部分,还是别的原因,小弟想知道它的机制和原理,请各位高手不吝赐教!谢谢。

by helun - Linux环境编程 - 2008-12-07 12:32:48 阅读(6668) 回复(8)

请问一下:下面的程序为什么不会输出 :hello! int main() { execl("/bin/ls","ls","-l",NULL); prinf("hello!"); exit(0); } 假如本进程叫作进程1,那么它在执行完execl之后是不是进程1的代码区已被ls的代码区所覆盖了,而不能执行进程1中下面的部分,还是别的原因,小弟想知道它的机制和原理,请各位高手不吝赐教!谢谢。

by helun - C/C++ - 2008-12-07 10:05:44 阅读(3084) 回复(6)

那个文档上写着用iozone -Ra 命令可以生成execl文件,但是我怎么还是不可以呢?只是很多数据

by gexiongzihp - 内核/嵌入技术 - 2006-03-14 09:49:49 阅读(686) 回复(0)

那个文档上写着用iozone -Ra 命令可以生成execl文件,但是我怎么还是不可以呢?只是很多数据

by gexiongzihp - 内核源码 - 2006-03-14 09:49:49 阅读(1278) 回复(0)

RedHat linux下编写的多进程使用execl,源码如下: pid=fork(); if(pid<0) { ........ } if(pid == 0) { /*执行子程序*/ if (execl("gather","gather",ini_array->;msc_name,shmid_buf,(char*)0)<0) { sprintf(buf,"error:调用%s子进程出错!\n",ini_array->;msc_name); write_main_log_file(buf); } }............ 可是运行后ps -ef|grep gather 却是三个gather进程 那位大侠知道怎...

by zgl2k - C/C++ - 2003-02-28 16:35:44 阅读(1889) 回复(5)

本帖最后由 netocool 于 2012-02-17 09:53 编辑 shell.sh:[code]#!/bin/sh echo "hello shell!"[/code]execl.c[code]#include #include #include /** * File: execl.c * */ main() { int ret; ret=(execl("/home/test/testscript/shell.sh", NULL)); if (ret != -1) { printf("OK\n"); printf("%d\n", ret); }else{ printf("failed\n"); ...

by netocool - C/C++ - 2012-02-27 14:12:38 阅读(2231) 回复(9)

#include #include #include //简单实现shell功能的函数 int main(int argc, char* argv[]) { static char prompt[32] = ">"; char command[20]; int stat; int pid; FILE* fp; fprintf(stderr, "%s", prompt); fp = fdopen(0, "r"); if(fp == NULL){ ...

by xiaozhu2007 - Linux环境编程 - 2007-10-12 09:11:31 阅读(2764) 回复(5)

想请问一下,我想execl调用grep或awk,能行吗? 参数怎么写啊,请帮忙,多谢

by zhaoming1214 - C/C++ - 2004-05-24 16:48:07 阅读(751) 回复(1)

execl("upcase","upcase",NULL) upcase是人自己写的可执行程序,然后把 标准输入作为他的输入,怎么不行啊?

by tyffly - C/C++ - 2004-02-27 17:18:35 阅读(967) 回复(3)

本帖最后由 garyv 于 2013-05-31 11:06 编辑 函数声明是: int execl(const char *path, const char *arg, ...); 我使用这个函数测试发现: execl("/work/app", NULL); // 编译报错 execl("/work/app", "app", NULL); // 编译运行都正常 execl("/work/app", "a", NULL); // 编译运行都正常 问题是,第二个参数到底是干什么用的?如果是应用程序名称的话,第一个参数里面已经有了啊,而且从第三行代码看随便填个字符串都行 我...

by garyv - 嵌入式开发 - 2013-06-20 10:57:51 阅读(1157) 回复(3)