摘要:
// threads/exitstatus.c 11-2
#include "apue.h"
#include void* thr_fn1(void* arg)
{ printf("thread 1 returning\n"); /* return a variable of type void* return a pointer who points ... 阅读全文
posted @ 2015-02-06 21:59
孙永杰
阅读(274)
评论(0)
推荐(0)
摘要:
程序清单11-1打印线程ID// threads/threadid.c 11-1
#include "apue.h"
#include pthread_t ntid; void printids(const char* s)
{ printf("%d ", (unsigned int)ntid); printf("%ld ", (uns... 阅读全文
posted @ 2015-02-06 21:30
孙永杰
阅读(203)
评论(0)
推荐(0)
摘要:
// signals/sigusr.c 10-1
#include "apue.h" static void sig_usr(int); /* one handler for both signals */ int main(void)
{ if (signal... 阅读全文
posted @ 2015-02-06 18:53
孙永杰
阅读(265)
评论(0)
推荐(0)
摘要:
// proc/exec1.c 8-8
#include "apue.h"
#include const char* env_init[] = { "USER=unknown", "PATH=/home/sunyj/apue/proc/", NULL }; int main(void)
{ pid_t pid; if ((pid = ... 阅读全文
posted @ 2015-02-06 16:05
孙永杰
阅读(289)
评论(0)
推荐(0)
摘要:
这一节,书中的TELL_WAIT与TELL_PARENT,TELL_CHILD没有弄清楚,到底是如何实现的同步机制。 // proc/tellwait1.c 8-6
#include "apue.h" static void charatatime(const char *); int main(void)
{ pid_t pid; if ((pid = fork()... 阅读全文
posted @ 2015-02-06 13:13
孙永杰
阅读(270)
评论(0)
推荐(0)
摘要:
我的博客主题,css 阅读全文
posted @ 2015-02-06 09:59
孙永杰
阅读(197)
评论(0)
推荐(0)

浙公网安备 33010602011771号