上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 82 下一页
摘要: #include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <pwd.h>int main (void){ struct passwd *passwd; passwd=getpwuid(getuid()); /** passwd=getcwnam("phpos"); **/ printf("U 阅读全文
posted @ 2012-02-20 13:38 greencolor 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 系统对SIGHUP信号的默认处理是终止收到该信号的进程。所以若程序中没有捕捉该信号,当收到该信号时,进程就会退出。下面观察几种因终端关闭导致进程退出的情况,在这儿进程退出是因为收到了SIGHUP信号。login shell是session首进程。首先写一个测试程序,代码如下:#include <stdio.h>#include <signal.h>char **args;void exithandle(int sig)...{ printf("%s : sighup received ",args[1]);}int main(int argc,cha 阅读全文
posted @ 2012-02-20 08:56 greencolor 阅读(1119) 评论(0) 推荐(0) 编辑
摘要: signal (SIGPIPE, SIG_IGN); 阅读全文
posted @ 2012-02-19 22:36 greencolor 阅读(157) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <signal.h>#include <unistd.h>void show_handler(int sig){ printf("I got signal %d\n", sig); int i; for(i = 0; i < 5; i++) { printf("i = %d\n", i); sleep(1); }}int main(void){ int i = 0; struct sigaction act, oldact; act.sa_handler = 阅读全文
posted @ 2012-02-19 20:32 greencolor 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> // printf(),#include <stdlib.h> // exit(), EXIT_SUCCESS#include <pthread.h> // pthread_create(), pthread_join()#include <semaphore.h> // sem_init()sem_t binSem;void* helloWorld(void* arg);int main() { // Result for System call int res = 0; int i= 0; // Init 阅读全文
posted @ 2012-02-18 18:29 greencolor 阅读(158) 评论(0) 推荐(0) 编辑
摘要: int pthread_create(pthread_t *restrict tidp, const pthread_attr_t *restrict attr, void *(*start_rtn)(void), void *restrict arg);Returns: 0 if OK, error number on failure第一个参数为指向线程标识符的指针。第二个参数用来设置线程属性。第三个参数是线程运行函数的起始地址。第四个参数是运行函数的参数。 阅读全文
posted @ 2012-02-17 22:39 greencolor 阅读(160) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#include <pthread.h>void thread(void){ int i;for(i=0;i<3;i++){ sleep(1);printf("This is a pthread.\n");}}int main(void){pthread_t id;int i,ret;ret=pthread_create(&id,NULL,(void *) thread,NULL);if(ret!=0){ printf ("Create pt 阅读全文
posted @ 2012-02-17 22:37 greencolor 阅读(151) 评论(1) 推荐(0) 编辑
摘要: testop.tcl=========proc testop_initialize { } {}proc testop_start { state} { variabletestopsp set testopsp $state log_note "set test_shutter to $testopsp" log_error "error information" log_warning "warning information"}=========in device dbtestop11self testop0 1 1 1 10 阅读全文
posted @ 2012-02-13 23:39 greencolor 阅读(381) 评论(0) 推荐(0) 编辑
摘要: sudo yum install *tomcat5*/etc/init.d/tomcat5 starttest http://localhost:8080/etc/init.d/tomcat5 stopedit /etc/tomcat5/tomcat-users.xml as<tomcat-users> <role rolename="manager"/> <role rolename="tomcat"/> <role rolename="role1"/> <user userna 阅读全文
posted @ 2012-02-09 22:36 greencolor 阅读(180) 评论(0) 推荐(0) 编辑
摘要: prot 14244 in use:netstat -anp | grep 14244tcp 0 0 0.0.0.0:14244 0.0.0.0:* LISTEN 12206/dcss tcp 0 0 127.0.0.1:57332 127.0.0.1:14244 ESTABLISHED 12206/dcss tcp 0 0 127.0.0.1:14244 127.0.0.1:57332 ESTABLISHED 12206/dcsskill -9 12206 阅读全文
posted @ 2012-02-06 02:01 greencolor 阅读(154) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 82 下一页