ChinaUnix.net
相关文章推荐:

进程 返回值 说明

#include #include #include #include #include #include #include int main() { int status, result=0; pid_t pid, pr; pid = fork(); if(pid == 0){ printf("I am child!\n"); sleep(6); exit(3); } else if(pid > 0){ pr = wait(&status); result = WIFEXITED(status); printf("I am parent!\n"); } else printf...

by mousexqshe - C/C++ - 2007-07-20 13:30:58 阅读(1601) 回复(4)

相关讨论

后台进程启动后,父进程需要得到其运行的返回值 xterm -e XXX & 在无法弹出窗口的情况下 如果直接用$? 得到的始终是0,但实际后台返回的是1 怎么得到后台的返回值呢?

by jincode - Shell - 2006-07-28 12:41:10 阅读(2033) 回复(1)

在advanced linux programming中,有下面一段,然后写了一点代码想测试一下,发现不对,是不是我的理解有问题? Note that even though the parameter type of the exit function is int and the main function returns an int,Linux does not preserve the full 32 bits of the return code.In fact,you should use exit codes only between zero and 127.Exit codes above 128 have a special meaning—when a process is termin...

by robinchris - 程序开发 - 2006-06-06 23:33:41 阅读(980) 回复(2)

我是初学者,现在在做一个入侵检测系统 给异常判断建立了一个子进程,如果异常返回一变量i,INT型为1 现在父进程需对 i 判断,如果为1则进行异常信息输出 现在的问题是子进程改变了i值后,怎么让父进程的i值也变化,谢谢

by kingjwj - C/C++ - 2006-01-18 23:22:42 阅读(2432) 回复(2)
by GPRS10 - Oracle - 2004-06-09 15:08:19 阅读(1226) 回复(0)

比如脚本文件aa.sh #!/bin/bash (echo "hello";ret=$?;export ret) echo "ret=${ret}" 怎么没有ret显示呢?

by xnkjdx1998 - Shell - 2007-03-15 17:01:51 阅读(3692) 回复(2)

请教:在linux shell中怎么获取最近执行过的进程返回值啊? 也就是 C/C++ 中main() 函数的返回值 紧急!

by zenglj - Shell - 2007-01-10 16:03:25 阅读(3770) 回复(4)

[code] import threading def show(sec): return sec loops=[2,4] threads = [] for i in range(len(loops)): t= threading.Thread(target=show,args=(loops,)) threads.append(t) for i in range(len(loops)): threads.start() for i in range(len(loops)): threads.join() [/code] 我想得到show函数的返回值,怎么做呢?谢谢啊

by dianker - Python - 2006-10-09 11:13:15 阅读(7991) 回复(2)

我想实现一个应用进程在的时候返回 0 进程掉了之后返回 1 一下是我在脚本中的一段命名 不知为什莫我的进程在与不在 都只能执行到 行4 ( 1 ps -ef | grep ** | grep -v grep | awk '{print $1}' 2 if ["$1" = ""] 3 then 4 exit 1 5 fi 6 exit 0 请哪位大哥赐教 我看到过一个类似的是如下(不过也只能运行到行4) 1 set -- `ps -ef | grep ** | grep -v grep | awk '{print $1}'` 2 if ["$1" = ""] 3 then 4 exit 1 5 fi 6 ...

by zxq20004 - Linux论坛 - 2005-08-19 08:11:56 阅读(935) 回复(2)

dll文件 PHP_FUNCTION(searchbinzy) { char *geta; char *getb; int geta_len,getb_len; long getnum; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &geta,&geta_len,&getb,&getb_len,&getnum) == FAILURE) { RETURN_NULL(); } getnum=9; RETURN_LONG(getnum); } // php文件 -- 为何$ab输出1;

by mico - PHP - 2008-11-03 08:44:00 阅读(1799) 回复(4)

查了半天,没弄明白。 哪位告诉一声。 谢谢

by DirtyBear - Shell - 2008-09-03 13:34:32 阅读(2818) 回复(4)