Table of Contents
Unix标准
ISO C
最初由ANSI制定,为了C语言的通用性而订制的标准。现在大多数软件支持的都还是c99标准,但最新的标准是2011年的。99年引入了restrict关键字。
ISO C library,FreeBSD、Linux、Mac OS X、Solaris都支持:
| Header | Description |
|---|---|
| assert.h | 断言 |
| complex.h | 复数 |
| ctype.h | character classification and mapping support |
| errno.h | 错误码 |
| fenv.h | 浮点数环境 |
| float.h | 浮点数常量和特性 |
| inttypes.h | 整数类型转换 |
| iso646.h | 赋值、关系运算、一元运算符相关的宏 |
| limits.h | 实现中所使用的常量 |
| locale.h | 语言环境相关 |
| math.h | 数学函数、类型声明、常量 |
| setjmp.h | 非局部跳转 |
| signal.h | 信号 |
| stdarg.h | 可变参数列表 |
| stdbool.h | 布尔类型 |
| stddef.h | 标准定义? |
| stdint.h | 整数类型 |
| stdio.h | 标准输入输出 |
| stdlib.h | 一些工具库函数 |
| string.h | 字符串运算 |
| tgmath.h | type-generic math macros |
| time.h | 时间和日期 |
| wchar.h | 多字节字符和宽字符 |
| wctype.h | 宽字符分类和映射 |
IEEE POSIX
IEEE搞的标准,Portable Operating System Interface。所以就是为了方便应用程序在各操作系统间移植,定义了一套建议各操作系统都提供/遵循的接口(系统调用还是库函数都可以)。
POSIX标准中必须支持的接口:
| Header | Description |
|---|---|
| aio.h | 异步IO |
| cpio.h | cpio archive values |
| dirent.h | directory entries |
| dlfcn.h | 动态链接 |
| fcntl.h | 文件控制 |
| fnmatch.h | 文件名匹配 |
| glob.h | 路径模式匹配和生成 |
| grp.h | group file |
| iconv.h | 编码转换 |
| langinfo.h | 语言信息常量 |
| monetary.h | 钱的类型和函数? |
| netdb.h | 网络数据库操作 |
| nl_types.h | message catalogs |
| poll.h | poll函数 |
| pthread.h | 线程 |
| pwd.h | 密码文件 |
| regex.h | 正则表达式 |
| sched.h | 调度 |
| semaphore.h | 信号量 |
| strings.h | 字符串处理 |
| tar.h | tar archive values |
| termios.h | 终端I/O |
| unistd.h | 符号常量 |
| wordexp.h | word-expansion definitions |
| %%%%%%%%%%%%% | %%%%%%%%%%%%%%% |
| arpa/inet.h | Internet definitions |
| net/if.h | socket local interfaces |
| netinet/in.h | Internet address family |
| netinet/tcp.h | Transmission Control Protocol definitions |
| %%%%%%%%%%%%% | %%%%%%%%%%%%%%% |
| sys/mman.h | 内存管理声明 |
| sys/select.h | select函数 |
| sys/socket.h | 套接字函数 |
| sys/stat.h | 文件信息 |
| sys/statvfs.h | 文件系统信息 |
| sys/times.h | 进程时间 |
| sys/types.h | primitive system data types |
| sys/un.h | UNIX domain socket definitions |
| sys/utsname.h | system name |
| sys/wait.h | 进程控制 |
POSIX标准规定的可选头文件:
| Header | Description |
|---|---|
| mqueue.h | message queues |
| spawn.h | real-time spawn interface |
X/Open System Interfaces(XSI)
The Single UNIX Specification是POSIX.1标准的超集。POSIX.1标准是XSI的Base Specifications portion。只有遵循了XSI标准的才能被称为UNIX。
POSIX标准规定的XSI选项头文件:
| Header | Description |
|---|---|
| fmtmsg.h | message display structures |
| ftw.h | file tree walking |
| libgen.h | pathname management functions |
| ndbm.h | database operations |
| search.h | search tables |
| syslog.h | System error logging |
| utmpx.h | user accounting database |
| %%%%%%%%%%%%% | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| sys/ipc.h | IPC |
| sys/msg.h | XSI message queues |
| sys/resource.h | resource operations |
| sys/sem.h | XSI semaphores |
| sys/shm.h | XSI shared memory |
| sys/time.h | time types |
| sys/uio.h | vector I/O operations |
FIPS
Federal Information Processing Standard.美国政府采购标准,貌似被废弃了?
UNIX 实现
- SVR4
UNIX System V Release 4。 - 4.4BSD
- FreeBSD
- Linux
- Mac OS X
- Solaris
- 其他

近期评论