码迷,mamicode.com
首页 >  
搜索关键字:apue    ( 460个结果
3.3 将标准输入复制到标准输出
mycat/mycat.c#include "apue.h"#define BUFFSIZE 4096intmain(void){ int n; char buf[BUFFSIZE]; while ((n = read(STDIN_FILENO, buf, BUFFSIZE)) > 0) if .....
分类:其他好文   时间:2014-07-19 00:00:58    阅读次数:216
4.1 对每个命令行参数打印文件类型
file/filetype.c #include "apue.h"intmain(int argc, char *argv[]){ int i; struct stat buf; char *ptr; for (i = 1; i < argc; i++) { printf("%s: ", argv[...
分类:其他好文   时间:2014-07-18 23:38:27    阅读次数:412
3.5 对一个文件描述符打开一个或多个文件状态标志
lib/setfl.c #include "apue.h"#include voidset_fl(int fd, int flags) /* flags are file status flags to turn on */{ int val; if ((val = fcntl(fd, F_GETF...
分类:其他好文   时间:2014-07-18 23:38:21    阅读次数:333
2.3 确定文件描述符数
lib/openmax.c#include "apue.h"#include #include #ifdef OPEN_MAXstatic long openmax = OPEN_MAX;#elsestatic long openmax = 0;#endif/* * If OPEN_MAX is i...
分类:其他好文   时间:2014-07-18 23:36:31    阅读次数:279
3.2 创建一个具有空洞的文件
file/hole.c #include "apue.h"#include char buf1[] = "abcdefghij";char buf2[] = "ABCDEFGHIJ";intmain(void){ int fd; if ((fd = creat("file.hole", FILE_M...
分类:其他好文   时间:2014-07-18 23:35:26    阅读次数:193
3.4 对于指定的描述符打印文件标志
file/fileflags.c #include "apue.h"#include intmain(int argc, char *argv[]){ int val; if (argc != 2) err_quit("usage: a.out "); if ((val = fcntl(atoi(a...
分类:其他好文   时间:2014-07-18 23:28:24    阅读次数:203
3.1 测试能否对标准输入设置偏移量
file/seek.c#include "apue.h"intmain(void){ if (lseek(STDIN_FILENO, 0, SEEK_CUR) == -1) printf("cannot seek\n"); else printf("seek OK\n"); exit(0);}
分类:其他好文   时间:2014-07-18 23:27:20    阅读次数:187
APUE学习笔记:第八章 进程控制
8.1 引言本章介绍UNIX的进程控制,包括创建新进程、执行程序和进程终止。还将说明进程属性的各种ID-----实际、有效和保存的用户和组ID,以及他们如何受到进程控制原语的影响。本章还包括了解释器文件和system函数。本章最后讲述大多数UNIX系统所提供的进程会计机制。这种机制使我们能够从另一个...
分类:其他好文   时间:2014-07-18 14:18:37    阅读次数:225
【APUE】线程与信号
每个线程都有自己的信号屏蔽字,但是信号的处理是进程中所有线程共享的。进程中的信号是递送到单个线程的。线程中pthread_sigmask函数类似与进程的sigprocmask函数,可以用来阻塞信号。#include int pthread_sigmask(int how,const sigset_t...
分类:编程语言   时间:2014-07-18 08:34:25    阅读次数:325
APUE学习笔记:第七章 进程环境
7.1 引言本章将学习:当执行程序时,其main函数是如何被调用的;命令行参数是如何传送给执行程序的;典型的存储器布局是什么样式;如何分配另外的存储空间;进程如何使用环境变量;各种不同的进程终止方式等;另外还将说明longjmp和setjmp函数以及它们与栈的交互作用;还将介绍研究进程的资源限制7....
分类:其他好文   时间:2014-07-17 10:07:37    阅读次数:363
460条   上一页 1 ... 40 41 42 43 44 ... 46 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!