06 2015 档案

摘要:例如主线程继续为用户提供服务的同时创建第二个线程这个线程的作用是将用户正在编辑的数据进行备份存储那么备份结束之后第二个线程就可以字节终止没必要再回到主线程中区称这样的线程为脱离线程,可以通过修改属性或者调用pthread_detach的方法来创建这里我们从属性的角度研究脱离线程1 #include ... 阅读全文
posted @ 2015-06-30 20:48 kongchung 阅读(627) 评论(0) 推荐(0) 编辑
摘要:在一个程序中的多个执行路线叫做线程线程是一个进程内部的一个控制序列当进程执行fork调用时,创建出该进程的一份新的拷贝,这个新的进程拥有自己的变量和pid时间调度是独立的,执行也几乎是独立的。当进程创建一个新的线程的时候,新的执行线程将有自己的栈,但是和创建者共享局部变量,文件描述符,信号句柄和当前... 阅读全文
posted @ 2015-06-30 13:07 kongchung 阅读(423) 评论(0) 推荐(0) 编辑
摘要:信号是某些错误条件而引起由shell和终端管理器生成的signal可以作为进程间传递消息或者修改行为的一种方式,明确的由一个进程传递给另外一个进程信号可以被生成,捕获,响应,或者忽略。程序可以使用signal库函数来处理信号1 #include 2 void (* signal (int sig, ... 阅读全文
posted @ 2015-06-29 17:11 kongchung 阅读(538) 评论(0) 推荐(0) 编辑
摘要:进程可以简单的看做是正在运行的程序UNIX允许多个用户同时访问系统每个用户可以同时运行多个程序每个程序可以同时运行多个实例进程之间共享程序代码和系统函数库,所以任何时候内存中只有一份代码的拷贝启动进程并等待它们结束的能力是整个系统的基础启动新的进程用库函数system完成1 #include 2 i... 阅读全文
posted @ 2015-06-29 14:04 kongchung 阅读(325) 评论(0) 推荐(0) 编辑
摘要:链接上mysql之后可以使用一些api对数据库进行一些操作1 int mysql_query(MYSQL * connection, const char * query)这是执行sql语句的函数,成功的话返回01.不返回数据的sql语句对于update,delete,insert等操作1 my_u... 阅读全文
posted @ 2015-06-29 09:38 kongchung 阅读(571) 评论(0) 推荐(0) 编辑
摘要:1 ctrl+v向下翻页 2 alt+v向上翻页 3 ctrl+l使得当前的光标位于屏幕的中间 4 5 ctrl+p是向上移动一行 6 ctrl+n是向下移动一行 7 ctrl+b是向左方向移动光标 8 ctrl+f是向右方向移动光标 9 alt+f是向右方向按字符移动光标10 alt+b是向左... 阅读全文
posted @ 2015-06-28 20:16 kongchung 阅读(226) 评论(0) 推荐(0) 编辑
摘要:首先在linux上安装mysql 1 jason@t61:~$ mysql -u root 2 Welcome to the MySQL monitor. Commands end with ; or \g. 3 Your MySQL connection id is 9 4 Server ver... 阅读全文
posted @ 2015-06-28 14:55 kongchung 阅读(523) 评论(0) 推荐(1) 编辑
摘要:1 #include 2 #include 3 #include 4 #include 5 6 const char *test_file = "/tmp/test_lock";//创建一个字符串常量指针指向临时文件 7 8 int main() 9 {10 int file... 阅读全文
posted @ 2015-06-28 10:22 kongchung 阅读(285) 评论(0) 推荐(0) 编辑
摘要:1 /* 2 对终端进行读写的程序 3 */ 4 5 #include 6 #include 7 8 char *menu[] = 9 { 10 "a - add new record", 11 "d - delete record", 12 "... 阅读全文
posted @ 2015-06-27 10:31 kongchung 阅读(347) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 void work() 9 {10 FILE *f;11 int i;12 double x=4.5;13 f=... 阅读全文
posted @ 2015-06-27 08:48 kongchung 阅读(146) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 4 int main() 5 { 6 struct tm * tm_ptr, timestruct;//定义一个tm结构的指针tm_ptr和tm结构的timestruct 7 time_t the_time; //... 阅读全文
posted @ 2015-06-26 18:54 kongchung 阅读(928) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #include 4 /* 5 这个函数是对环境变量进行一些操作的 6 */ 7 int main(int argc, char * argv[]) //主函数 8 { 9 char * var, * value; ... 阅读全文
posted @ 2015-06-26 17:23 kongchung 阅读(521) 评论(0) 推荐(0) 编辑
摘要:从stat函数开始逐个说明stat结构的每一个成员,以了解文件的所有属性。1.函数stat,fstat,fstatat和lstat1 #include 2 int stat(const char * restrict pathname, struct stat * restrict ... 阅读全文
posted @ 2015-06-26 12:43 kongchung 阅读(254) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 7 typedef struct//定义了一个包含下面两个数据类型的结构体 8 { 9 int integer;10 char string[24];11 ... 阅读全文
posted @ 2015-06-26 12:41 kongchung 阅读(688) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #include 4 5 #include 6 #include 7 #include 8 9 void printdir(char * dir, int depth)//这个是主要的打印目录函数,参数dir表征路径,参数depth代... 阅读全文
posted @ 2015-06-26 09:46 kongchung 阅读(293) 评论(0) 推荐(0) 编辑
摘要:1.文件描述符:是一个非负整数,用来描述打开的文件2.函数open和函数openat:1 #include 2 int open(const char * path, int oflag,...);3 int openat(int fd, const char * path, int oflag,.... 阅读全文
posted @ 2015-06-25 09:38 kongchung 阅读(264) 评论(0) 推荐(0) 编辑
摘要:先用ubuntu15.04光盘在已有xp的电脑上安装成功​随后在Ubuntu安装labview说glibc没安装​但是ldd --version显示是安装的新版的​后来怀疑是86_64的原因​用软碟通做了usb启动的ubuntu15.04 386版本​启动失败syslinux引导失败​然后在快捷启动... 阅读全文
posted @ 2015-06-24 23:06 kongchung 阅读(414) 评论(0) 推荐(0) 编辑
摘要:http://www.apuebook.com/code3e.html在上面的网站下载代码包,解压得到源码1 sudo apt-get install libbsd-dev 安装这个支持,在解压包的makefile路径下运行make1 sudo cp ./include/apue.h /usr/i... 阅读全文
posted @ 2015-06-24 23:02 kongchung 阅读(388) 评论(0) 推荐(0) 编辑