某教材有如下示例程序: void cleanup(void *arg) { ...略 ... } void * tfn1(void * arg) { int a = 1; printf("the 1st thread\n"); pthread_cleanup_push(cleanup,&a); a = 2; pthread_cleanup_push(cleanup,&a); return NULL; pthread_cleanup_pop(0); pthread_cleanup_pop(0); return NULL; } int main()\ { ... pthread_create(&tid,NULL,tfn1,NULL); 略...
by banbi1985 - Linux环境编程 - 2011-12-28 12:19:31 阅读(1195) 回复(4)
1、函数原型int atexit( void (__cdecl *func )( void )); 2、功能:注册程序正常终止时要被调用的函数#include #include void exit_fn1(void) { printf("Exit function #1 called\n"); } void exit_fn2(int a) { printf("Exit function #2 called, a = %d\n",a); } int main(void) { /* post exit function #1 */ atexit(exit_fn1); /* post exit function #2 */ atexit(exit_fn2(2)); re...
atexit的参数是一个函数指针, 参数函数无需任何参数和返回. void fun1() { printf("fun1() done!!!\n"); } int fun2(int i) { printf("fun2() done!!! %d\n", i); return i+2; } int main(void) { printf("Main Start!!!!\n"); atexit(fun1); atexit(fun2(2)); /* 当不给参数时, 两个函数都可以正常执行*/ printf("Main End!!!!\n"); exit(0); } 下面是执行...
2010-5-17 8:00:06 - Info bpdbm(pid=4288) image catalog cleanup 2010-5-17 8:00:06 - Info bpdbm(pid=4288) deleting images which expire before Mon May 17 08:00:06 2010 (1274054406) 2010-5-17 8:00:06 - Info bpdbm(pid=4288) processing client aqx 2010-5-17 8:00:06 - Info bpdbm(pid=4288) processing client backupserver 2010-5-17 8:00:06 - Info bpdbm(pid=4288) processing cli...
为什么这么说呢? 卸载deb包时候,可以连不要的依赖关系包一起删除,但是多如牛毛的rpm却不可以。 这个真的是rpm的痛! yum仅仅能在线安装rpm,但是只能在安装的时候解决依赖关系,卸载的时候却不行。 不过,有个工具可以专门解决rpm依赖关系:package-cleanup Options: -h, --help show this help message and exit --problems List dependency problems in the local RPM database --leaves ...
1.shutdown the SF6800 steps 1)telnet the OS hosts (domain a),execute: #init 5 2)connect the serial console witch SC0 3)Type 1 into the domain System Controller 'USF6800': Type 0 for Platform Shell Type 1 for domain A console Type 2 for domain B console Type 3 for domain C console Type 4 for domain D console Input: 1 -- Type 1 for domain A console ...
C++ introduced the concept of a constructor, a special method automatically called when an objects is created. Java also adopted the constructor, an in additon has a garbage collector that automatically releases memory resources when they're no longer being used. Guaranteed initialization with the constructor In Java, the class designer can guarantee initialization of ...
\r\nI have a AIX RS/6000 server which has a Logical Volumn is nearly 100% full. The mount point is /var and the lv is /dev/hd9var\r\n\r\nWhat I think is maybe there are too much log files there. But I don\'t know which files can be deleted to free up space.\r\n\r\nThanks.