linux中用到的头文件标注

来源:互联网 发布:怎样开淘宝网店需要多少钱 编辑:程序博客网 时间:2024/04/30 10:48

1.#include <unistd.h>

是POSIX标准定义的unix类系统定义符号常量的头文件,包含了许多UNIX系统服务的函数原型,例如read函数、write函数、getpid函数和gethostbyname函数。


2.#include <sys/param.h>

包含了许多unix系统的一些宏定义


3.#include <getopt.h>  

getopt是一个专门设计来减轻命令行处理负担的库函数,它可以在全局结构中记录命令参数,以便随后随时在整个程序中使用,即getopt被用来解析命令行选项参数,就不用自己写代码处理argv了。其中比较重要的函数是getopt()和getopt_long()。


4.#include <strings.h> 

strings.h头文件是从BSD系UNIX系统继承而来,里面定义了一些字符串函数,如bzero等。这些函数曾经是posix标准的一部分,但是在POSIX.1-2001标准里面,这些函数被标记为了遗留函数而不推荐使用。在POSIX.1-2008标准里已经没有这些函数了。转自: http://www.cnblogs.com/sshqiu/archive/2011/07/20/2112141.html


int bcmp(const void *, const void *, size_t); /* 用memcmp替代 */
void bcopy(const void *, void *, size_t); /* 用memcpy, memmove替代 */
void bzero(void *, size_t); /* 用memset替代 */
int ffs(int); /* string.h 中有 */
char *index(const char *, int); /* 用strchr替代 */
char *rindex(const char *, int); /* 用strrchr替代 */
int strcasecmp(const char *, const char *); /* string.h 中有 */
int strncasecmp(const char *, const char *, size_t); /* string.h 中有 */

5.#include <signal.h>
包含有信号宏的定义。如
SIG_DFL   Request for default signal handling.   //默认信号处理
SIG_ERR   Return value from signal() in case of error.  //返回错误信号的值
SIG_HOLDRequest that signal be held. //    //保持该信号  
SIG_IGN     Request that signal be ignored.   //忽视该信号

6.#include <rpc/types.h>

未找到相关资料,不过rpc是远程进程调用,推测该头文件的作用与此相关


0 0