共 18 篇文章 |
|
Gcc编译选项分析。Gcc有超过100个的可用选项,主要包括总体选项、告警和出错选项、优化选项和体系结构相关选项。[root@localhost Gcc] Gcc hello1.c –I /root/workplace/Gcc/ -o hello1.[root@localhost Gcc] Gcc hello_sq.c –L /root/workplace/Gcc/lib –lsunq –o hello_sq.[root@localhost Gcc]# Gcc –ansi warning.c –o warning.[root... 阅2115 转9 评0 公众公开 11-08-05 11:44 |
Ubuntu inittab一点小区别转到kubuntu之前曾经学习了一下,了解到ubuntu在6.10开始用upstart替代init,主要脚本都在/etc/event.d下面,默认情况下/etc下没有inittab文件。刚装上kubuntu时候专门到/etc/event.d下看了一下,特别注意到rc-default这个脚本,里面有一段内容:说明默认情况下inittab虽然不存在,但是用户建立的inittab还是会被注意到... 阅458 转1 评0 公众公开 11-08-02 14:50 |
[root@pvcent107 build]# cp -r testLargeFile largeFile &[1] 4825[root@pvcent107 build]# jobs[1]+ Running cp -i -r testLargeFile largeFile &[root@pvcent107 build]# disown -h %1[root@pvcent107 build]# ps -ef |grep largeFileroot 4825 968 1 09:46 pts/4 00:00:00 cp -i -r testLargeFile largeFileroot 4853 968 0 09:46 ... 阅58 转0 评0 公众公开 11-07-18 11:49 |
POSIX 多线程程序设计线程管理(Thread Management) 创建和结束线程 函数: pthread_create (thread,attr,start_routine,arg) pthread_exit (status) pthread_attr_init (attr) pthread_attr_destroy (attr) 创建线程: 最初,main函数包含了一个缺省的线程。pthread_attr_init(&attr);} 线程管理 其他各种函数: pthread_self () pthread_... 阅744 转3 评0 公众公开 11-02-16 16:07 |
FD_CLR(int fd, fd_set *set);FD_ISSET(int fd, fd_set *set);FD_SET(int fd, fd_set *set);FD_SET添加一个文件描述符到指定的set中,FD_CLR则从指定的set中移除一个文件描述符:FD_SET(fd, &writefds); /* add ''fd'' to the set */FD_CLR(fd, &writefds); /* oops, remove ''fd'' from the set */因... 阅928 转4 评0 公众公开 10-07-07 10:28 |
if (FD_ISSET(fileno(fp), &rset)) { //如果标准输入可读 if (Fgets(sendline, MAXLINE, fp) == NULL) //读入一行return; // 遇到^D时退出子程序 Writen(sockfd, sendline, strlen(sendline)); //写入套接口}int main(int argc, char **argv){ int i, maxi, maxfd, listenfd, connfd, sockfd;if (FD_ISSET(sockfd, &rset)) {if ( (n = ... 阅1402 转7 评0 公众公开 10-07-07 10:27 |
/* 将set清零 */ FD_SET(fd, &set); /* 将fd加入set */ FD_CLR(fd, &set); /* 将fd从set中清除 */ FD_ISSET(fd, &set); /* 如果fd在set中则真 */在过去,一个fd_set通常只能包含少于等于32个文件描述符,因为fd_set其实只用了一个int的比特矢量来实现,在大多数情况下,检查fd_set能包括任意值的文件描述符是系统的责任,但确定你... 阅938 转6 评0 公众公开 10-07-07 10:24 |
/* 将 set清零 */ FD_SET(fd, &set); /* 将fd加入set */ FD_CLR(fd, &set); /* 将 fd从set中清除 */ FD_ISSET(fd, &set); /* 如果fd在set中则真 */ 在 过去,一个fd_set通常只能包含少于等于32个文件描述符,因为fd_set其实只用了一个int的比特矢量来实现,在大多数情况下,检查 fd_set能包括任意值的文件描... 阅1104 转6 评0 公众公开 10-07-07 10:18 |
#include <sys/select.h>#include <sys/time.h>#include <sys/types.h>#include <unistd.h> int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);void FD_SET(int fd, fd_set *set);I int FD_ISSET(int fd, fd_set *set);其中FD_SET用来将一个文件描述符加... 阅233 转14 评0 公众公开 10-06-17 17:25 |
Linux网络安全之经验谈Linux网络安全之经验谈 关于分区 一个潜在的黑客如果要攻击你的Linux服务器,他首先就会尝试缓冲区溢出。记着要在bios设置中设定一个bios密码,不接收软盘启动。口令是系统中认证用户的主要手段,系统安装时默认的口令最小长度通常为5,但为保证口令不易被猜测攻击,可增加口令的最小长度,至少等于8。同时... 阅55 转2 评0 公众公开 10-06-17 16:53 |