Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1300861
  • 博文数量: 92
  • 博客积分: 10389
  • 博客等级: 上将
  • 技术积分: 1918
  • 用 户 组: 普通用户
  • 注册时间: 2006-08-10 16:13
文章存档

2014年(1)

2012年(15)

2009年(6)

2008年(37)

2007年(72)

2006年(54)

我的朋友

分类: LINUX

2008-01-28 15:17:28

   ________________________________________________________________


   ========================== C Library ===========================

C库,libc,包含了所有的符号(包含在libsys),另外,包含在在下面两个
表中列出的运行函数。第一个表中的运行函数是ANSI C标准的。

+ Figure 3-1: libc Contents, Names without Synonyms

  abort        fputc        isprint      putc         strncmp
  abs        fputs        ispunct      putchar      strncpy
  asctime      fread        isspace      puts         strpbrk
  atof        freopen      isupper      qsort        strrchr
  atoi        frexp        isxdigit     raise        strspn
  atol        fscanf       labs         rand         strstr
  bsearch      fseek        ldexp        rewind       strtod
  clearerr     fsetpos      ldiv         scanf        strtok
  clock        ftell        localtime    setbuf       strtol
  ctime        fwrite       longjmp      setjmp       strtoul
  difftime     getc         mblen        setvbuf      tmpfile
  div        getchar      mbstowcs     sprintf      tmpnam
  fclose       getenv       mbtowc       srand        tolower
  feof        gets         memchr       sscanf       toupper
  ferror       gmtime       memcmp       strcat       ungetc
  fflush       isalnum      memcpy       strchr       vfprintf
  fgetc        isalpha      memmove      strcmp       vprintf
  fgetpos      iscntrl      memset       strcpy       vsprintf
  fgets        isdigit      mktime       strcspn      wcstombs
  fopen        isgraph      perror       strlen       wctomb
  fprintf      islower      printf       strncat   

再加上, libc 保存着以下的服务。

+ Figure 3-2: libc Contents, Names with Synonyms

  __assert     getdate      lockf **     sleep        tell **
  cfgetispeed  getopt       lsearch      strdup       tempnam
  cfgetospeed  getpass      memccpy      swab         tfind
  cfsetispeed  getsubopt    mkfifo       tcdrain      toascii
  cfsetospeed  getw         mktemp       tcflow       _tolower
  ctermid      hcreate      monitor      tcflush      tsearch
  cuserid      hdestroy     nftw         tcgetattr    _toupper
  dup2        hsearch      nl_langinfo  tcgetpgrp    twalk
  fdopen       isascii      pclose       tcgetsid     tzset
  __filbuf     isatty       popen        tcsendbreak  _xftw
  fileno       isnan        putenv       tcsetattr   
  __flsbuf     isnand **    putw         tcsetpgrp   
  fmtmsg **    lfind        setlabel     tdelete     

  ** = Function is at Level 2 in the SVID Issue 3 and therefore at
       Level 2 in the ABI.

包括上面同义(Synonyms)表列出的标号,对于 入口已经存在的_
形式(带一个下划线,上面没有列出来)优先权高于它们的名字。所以,例如,
libc同时包含了getopt和_getopt。

在常规的上列中,其他地方以下没有被定义。

int __filbuf(FILE *f);
This function returns the next input character for f, filling
its buffer as appropriate. It returns EOF if an error occurs.

int __flsbuf(int x, FILE *f);
This function flushes the output characters for f as if
putc(x, f) had been called and then appends the value of x to
the resulting output stream. It returns EOF if an error occurs
and x otherwise.

int _xftw(int, char *, int (*)(char *, struct stat *, int), int);
Calls to the ftw(BA_LIB) function are mapped to this function
when applications are compiled. This function is identical to
ftw(BA_LIB), except that _xftw() takes an interposed first
argument, which must have the value 2.


要了解更多的关于SVID,ANSI C,POSIX的知识,可看该章节其他的库section部分。
该节“System Data Interfaces”后有更多的描述。

Global Data Symbols
                    全局数据符号


libc库需要一些外部的全局数据符号(为了它自己的常规工作而定义的)。
所有向libsys库请求的数据符号一定要让libc提供,就象下面表中的数据符号。

正式定义的数据object被他们的符号描述,看System V接口定义,第三版本
或者第6章节的数据定义(Data Definitions)section(在适当的处理器
补充到System V ABI)。

在下面表中的入口有-_的形式。一对符号都代表了一些数据。
下划线的synonyms假设满足ANSI C标准。


+ Figure 3-3: libc Contents, Global External Data Symbols

  getdate_err optarg
  _getdate_err opterr
  __iob optind
optopt

阅读(1377) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~