随笔分类 -  Linux环境编程

摘要:mkfifo() pathname :the FIFO special file's name mode :the FIFO's permissions. pipe() pipefd :return two fds referring to the ends of the pipe. pipefd[ 阅读全文
posted @ 2016-10-07 10:02 Abnor 编辑
摘要:Linux中, 系统为每个系统都维护了三种计时器,分别为: 真实计数器, 虚拟计时器以及实用计时器, 一般情况下都使用真实计时器 getitimer()/setitimer() which //具体的计时器类型 1. ITIMER_REAL :真实计时器 统计进程消耗的真实时间 通过定时产生SIGA 阅读全文
posted @ 2016-10-07 00:12 Abnor 编辑
摘要:信号本质上就是一个软件中断,它既可以作为两个进程间的通信的方式, 更重要的是, 信号可以终止一个正常程序的执行, 通常被用于处理意外情况 , 信号是异步的, 也就是进程并不知道信号何时会到达 $kill 9 3390 向PID为3390的进程发送编号为9的信号= 一个两个进程间通信的方式之一 一共6 阅读全文
posted @ 2016-10-06 23:21 Abnor 编辑
摘要:进程的状态 Linux进程有7种基础状态(两种running算一种),除了traced都可以用 命令查看, 可以查看的进程状态如下,更多进程状态信息参见 "Linux Process VS Thread VS LWP" R running or runnable (on run queue) D u 阅读全文
posted @ 2016-10-06 18:48 Abnor 编辑
摘要:access() fstat()、stat()、lstat() 获取文件大小 1. fseek()把offset移到SEEK_END, 再用ftell()返回文件的大小 2. lseek() , 返回文件的大小 3. stat(), struct stat st; st.st_size的数值就是文件 阅读全文
posted @ 2016-10-06 14:31 Abnor 编辑
摘要:文件描述符(File Descriptor) a small, nonnegative integer for use in subsequent system calls (read(2), write(2), lseek(2), fcntl(2), etc.) ($man 2 open). 一个 阅读全文
posted @ 2016-10-06 13:47 Abnor 编辑
摘要:MMU MMU=Segmentation Unit+Paging Unit //MMU: Memory Management Unit logical address = Segmentation Unit= linear address = Paging Unit= physical addres 阅读全文
posted @ 2016-10-06 10:14 Abnor 编辑