设为首页 | 收藏本站
首页>IT学院>操作系统>正文
升级Linux系统内核完全过程
WWW.DBIT.CN 2006-12-3 9:42:43 热度:
 

 

三,使用glibc-2.3.5

1)、通过调查发现要编译glibc-2.3.5,要求binutils在2.13以上。所以必须安装binutils-2.14

下载binutils-2.14.tar.gz

tar zxpvf binutils-2.14.tar.gz mkdir binutils-build cd binutils-build ../binutils-2.14/configure –prefix=/usr –enable-shared make tooldir=/usr make check make tooldir=/usr install cp ../binutils-2.14/include/libiberty.h /usr/include

2) 安装glibc-2.3.5

下载 glibc-2.3.5.tar.gz 和 glibc-2.3.5-fix_test-1.patch

tar zxpvf glibc-2.3.5.tar.gz patch –Np1 –i ../glibc-2.3.5-fix_test-1.path mkdir glibc-build cd glibc-build ../glibc-2.3.5/configure –prefix=/usr/local/glibc235 –enable-add-ons=Linuxthreads –enable-kernel=2.6.0 (若安装在/usr目录下,很危险,可能会损坏你的系统) make make check (必须执行的一步) make localedata /install-locales (对应各国文字) mkdir /usr/man/man3(man的安装路径) make –C ../glibc-2.3.5/linuxthreads/man install

上面的安装完成以后,最好把/usr/local/glibc235/lib和/usr/local/glibc235/include加入到系统的路径中,这样在编译程序时,就不必指定库和header文件的路径了。

四、使用NPTL进行线程编程

#include #include #include #include void thread_fun(void * arg); char message[] = “I am created thread”; int main() { int rnt; pthread_t new_thread; void *thread_result; rnt=pthread_create(&new_thread,NULL, thread_fun, (void*) message); if (rnt != 0) { perrer (“thread creation failed”); exit(EXIT_FAILURE); } printf(“Waiting for other thread to finish… ”); rnt = pthread_join(new_thread, &thread_result); if (rnt != 0) { perrer (“thread join failed”); exit(EXIT_FAILURE); } printf(“Thread join, it returned %s ”, (char*) thread_result); printf(“message now %s ”, message); exit(EXIT_SUCCESS); } void *thread_fun (void * arg) { printf(“the new thread is running. Argument was %s ”,(char*)arg); sleep(3); strcpy(message, “Bye”); pthread_exit(“Thank you for the test”); }

编译

gcc -D_REENTRANT test_thread.c -o test_thread -lpthread ./test_thread

成功了。

本新闻共2页,当前在第2页  1  2  

 
上一篇:利用安全模式解决实际问题
下一篇:40%恶意软件继续骚扰Vista
打印】【关闭
  相关文章:
·IBM持观望态度 目前尚不支持甲骨文·在Linux操作系统中实现内部进程通
·教你配置Linux系统安全管理服务·详细了解Linux系统中的关机命令
·Linux环境下的ReiserFS文件系统·使用 Linux LiveCD
·用日志系统保护Linux安全·架设linux下最简单的VPN系统
☆联姻学院☆

保养电脑的26个窍门
文件夹删除不掉怎么办?
教你如何用手工迅速剿灭QQ广告
“熊猫烧香”病毒的病毒描述和
在Excel中只打印图表以外区域
Excel中只选中包含文本的单元
Windows XP操作系统的几个实用
用XP系统自带网络诊断程序解决
风雨雷电→自然现象动画实战技
Flash遮罩特效之百叶窗效果
十二个Dreamweaver鲜为人知的
如何用 Dreamweaver 批量做we
JavaScript的系统函数学习
Java之父:关于Java我也有遗憾
排除网上邻居使用4大常见麻烦
解除上网限制IP和MAC捆绑的破