C语言本身并没有提供内置的功能来完成诸如输入/输出,内存管理,字符串操作等任务,这些功能定义在标准的库中,开发人员在编译和链接程序是必须要使用库。 \r\n 本手册描述的是GNU C Library,它定义了所有的库函数,而且符合ANSI C标准,POSIX的附加特性和其他UNIX版本变种的特点。GUN C Library 支持ANSI C-1989,POSIX 1003.1-1990和POSIX 1003.2-1992的大多数函数,与4.4BSD向上兼容,包括许多System V的函数,加上GNU的扩充。GUN C Library是目前使用得非常广泛的库之一。这本手册介绍怎样使用GNU库的功能,包括UNIX上的“库函数”和“系统调用”。 \r\n
1. Introduction \r\n\r\n1.1 Getting Started\r\n1.2 Standards and Portability\r\n1.3 Using the Library\r\n1.4 Roadmap to the Manual\r\n\r\n2 Error Reporting\r\n\r\n2.1 Checking For Error\r\n2.2 Error Codes\r\n2.3 Error Messages\r\n\r\n3 Memory Allocation\r\n\r\n3.1 Dynamic Memory Allocation Concepts\r\n3.2 Dynamic Allocation and C\r\n3.3 Unconstrained Allocation\r\n3.4 Allocation Debugging\r\n3.5 Obstacks\r\n3.6 Automatic Storage with Varible Size\r\n\r\n4 Character Handling\r\n\r\n4.1 Classification of Characters\r\n4.2 Case Conversion\r\n4.3 Character Class determination for wide characters\r\n4.4 notes on using wide characters\r\n\r\n5 string and array utilities\r\n\r\n5.1 representation of strings\r\n5.2 string and array conventions\r\n5.3 string length\r\n5.4 copying and concatenation\r\n5.5 string /array comparison\r\n5.6 collation functions\r\n5.7 search functions\r\n5.8 encode binary data\r\n5.9 finding tokens in a string\r\n5.10 argz and enzy vectors\r\n\r\n6 character set handling\r\n\r\n6.1 introduction to extended characters\r\n6.2 overview about character handling funcations\r\n6.3 restartable multibyte conversion functions\r\n6.4 non-reentrantconversion function\r\n6.5 generic charset conversion\r\n\r\n7 locales and internationalization\r\n\r\n7.1 what effects a locale has\r\n7.2 choosing a locale\r\n7.3 categories of activites that locales affect\r\n7.4 how programs set the locale\r\n7.5 standard locales\r\n7.6 accessing locale information\r\n7.7 a dedicated function to format numbers\r\n\r\n8 message translation\r\n\r\n8.1 x/open message catalog handling\r\n8.2 the uniforum approach to message translation\r\n\r\n9 searching and sorting\r\n\r\n9.1 definig the comparison function\r\n9.2 array search function\r\n9.3 array sort function\r\n9.4 searching and sorting example\r\n9.5 the hsearch function\r\n9.6 the tsearch function\r\n\r\n10 pattern matching\r\n\r\n10.1 wildcard matching\r\n10.2 globbing\r\n10.3 regular expression matching\r\n10.4 shell-style word expansion\r\n\r\n11 input/output overview\r\n\r\n11.1 input/output concepts\r\n11.2 file names\r\n\r\n12 input/output on streams\r\n\r\n12.1 streams\r\n12.2 standard streams\r\n12.3 opening streams\r\n12.4 closing streams\r\n12.5 simple output by characters or lines\r\n12.6 character input\r\n12.7 line-oriented input\r\n12.8 unleading\r\n12.9 block input/output\r\n12.10 formatted output\r\n12.11 customizing printf\r\n12.12 formatted input\r\n12.13 end-of-file and errors\r\n12.14 text and binary streams\r\n12.15 file positioning\r\n12.16 portable file-position functions\r\n12.17 stream buffering\r\n12.18 other kinds of streams\r\n12.19 formatted messages\r\n\r\n13 low-level input/output\r\n\r\n13.1 opening and closing files\r\n13.2 input and output primitives\r\n13.3 setting the file position of a descript\r\n13.4 descriptors and streams\r\n13.5 dangers of mixing streams and descriptors\r\n13.6 fast scatter-gather I/O\r\n13.7 Momory-mapped I/O\r\n13.8 Waiting for Input or Output\r\n13.9 synchronizing I/O operations\r\n13.10 perform I/O operations in parallel\r\n13.11 control operations on files\r\n13.12 file Descriptor flags\r\n13.13 duplication descriptors\r\n13.14 file status flags\r\n13.15 file locks\r\n13.16 interrupt-driven input\r\n13.17 generic I/O control operators\r\n\r\n14 file system interface\r\n\r\n14.1 working directory\r\n14.2 accessing directories\r\n14.3 working with directory trees\r\n14.4 hard links\r\n14.5 symbolic links\r\n14.6 deleting files\r\n14.7 renaming files\r\n14.8 creating directories\r\n14.9 files attributes\r\n14.10 making special files\r\n14.11 temporary files\r\n\r\n15 pipes and fifos\r\n\r\n15.1 creating a pipe\r\n15.2 pipe to a subprocess\r\n15.3 fifo special files\r\n15.4 automicity of pipe I/O\r\n\r\n16 sockets\r\n\r\n16.1 socket concepts\r\n16.2 communication styles\r\n16.3 socket addresses\r\n16.4 interface naming\r\n16.5 the local namespace\r\n16.6 the internet namespace\r\n16.7 other namespaces\r\n16.8 opening and closing sockets\r\n16.9 using sockets with connections\r\n16.10 datagram socket operations\r\n16.11 the inetd daemon\r\n16.12 socket options\r\n16.13 networks database\r\n\r\n17 low-level terminal interface\r\n\r\n17.1 identifying terminals\r\n17.2 I/O queues\r\n17.3 two styles of input:canonical or not\r\n17.4 terminal modes\r\n17.5 line control functions\r\n17.6 noncanonical mode example\r\n17.7 pseudo-tdrminals\r\n\r\n18 mathematics\r\n\r\n18.1 predefined mathematical constants\r\n18.2 trigonometric functions\r\n18.3 inverse trigonometric functions\r\n18.4 exponentiation and logarithms\r\n18.5 hyperbolic functions\r\n18.6 special functions\r\n18.7 pseudo-random numbers\r\n18.8 is fast code or small code preferred\r\n\r\n19 arithmetic functions\r\n\r\n19.1 floating point numbers\r\n19.2 floating-point number classification functions\r\n19.3 errors in floating-point calculations\r\n19.4 rounding modes\r\n19.5 floating-point control functions\r\n19.6 arithmetic functions\r\n19.7 complex unmbers\r\n19.8 projections,conjugates,and decompoing of complex numbers\r\n19.9 integer division\r\n19.10 parsion of numbers\r\n19.11 old-fashioned system v number-to-string functions\r\n\r\n20 date and time\r\n\r\n20.1 processor time\r\n20.2 calendar time\r\n20.3 precision time\r\n20.4 setting an alarm\r\n20.5 sleeping \r\n20.6 resource usage\r\n20.7 limiting resource usage\r\n20.8 process priority\r\n\r\n21 Non-Local Exits\r\n\r\n21.1 Introduction to Non-Local Exits\r\n21.2 Datails of Non-Local Exits\r\n21.3 Non-Local Exits and Signals\r\n\r\n22 Signal Handling \r\n\r\n22.1 Basic Concepts of Signals\r\n22.2 Standard Signals\r\n22.3 Special Signal Actions\r\n22.4 Defining Signal Handlers\r\n22.5 Primitives Interrupted by Signals\r\n22.6 Generating Signals\r\n22.7 Blocking Signals\r\n22.8 Waiting for a Signal\r\n22.9 Using a Separate Signal Stack\r\n22.10 BSD Signal Handling\r\n\r\n23 Process Startup and Termination\r\n\r\n23.1 Program Arguments\r\n23.2 Parsing program options using getopt\r\n23.3 Parsing Program Options with Argp\r\n23.4 Environment Varisbles\r\n23.5 Program Termination\r\n\r\n24 processes\r\n\r\n24.1 running a command\r\n24.2 process creation concepts\r\n24.3 process identification\r\n24.4 creating a process\r\n24.5 executing a file\r\n24.6 process completion\r\n24.7 process completion\r\n24.8 bsd process wait functions\r\n24.9 process creation example\r\n\r\n25 job control\r\n\r\n25.1 concepts of job control \r\n25.2 job control is optional\r\n25.3 controlling termianl of a process\r\n25.4 orphaned process groups\r\n25.5 access to the controlling terminal \r\n25.6 implementing a job control shell\r\n25.7 funcitons for job control\r\n\r\n26 system databases and name service switch\r\n\r\n26.1 nss basics\r\n26.2 the nss configuration file\r\n26.3 nss nodule internals\r\n26.4 extending nss\r\n\r\n27 users and groups\r\n\r\n27.1 user and group ids\r\n27.2 the persona of a process\r\n27.3 why change the persona of a process\r\n27.4 how an application can change persona\r\n27.5 reading the persona of a process\r\n27.6 setting the user id\r\n27.7 setting the group ids\r\n27.8 enabling and disabling setuid access\r\n27.9 setuid program example\r\n27.10 tips for writing setuid programs\r\n27.11 identifying who logged in\r\n27.12 the user accounting database\r\n27.13 user database\r\n27.14 group database\r\n27.15 user and group database example\r\n27.16 netgroup database\r\n\r\n28 system information\r\n\r\n28.1 host indentification\r\n28.2 hardware/software type identification\r\n28.3 which filesystems are mounted and /or available\r\n\r\n29 system configuration paremeters\r\n\r\n29.1 general capactiy limits\r\n29.2 overall system options\r\n29.3 which version of posix is supported\r\n29.4 using sysconf\r\n29.5 minimum values for general capacity limits\r\n29.6 limits on file system capacity\r\n29.7 optional features in file support\r\n29.8 minimum values for file system limits\r\n29.9 using pathconf\r\n29.10 utility program capacity limits\r\n29.11 minimum values for utility limits\r\n29.12 string-valued parameters\r\n\r\n30 des encryption and password handling\r\n\r\n30.1 legal problems\r\n30.2 reading passwords\r\n30.3 encrypting passwords\r\n30.4 des encryption\r\n\r\n31 posix threads\r\n\r\n31.1 basic thread operations\r\n31.2 thread attributes\r\n31.3 cancellation\r\n31.4 cleanup handlers\r\n31.5 mutexes\r\n31.6 condition variables\r\n31.7 posix semaphores\r\n31.8 thread-specific data\r\n31.9 threads and signal handling\r\n31.10 miscellaneous thread funcitons\r\n\r\nAppendix A C Language Facilities In the Library\r\n\r\nAppendix B Summary of Library facilities\r\n\r\nAppendix C Installing the GNU C Library\r\n\r\nAppendix D Library Maintenance\r\n\r\nAppendix E Contributors ot the GNU C Library\r\n\r\nAppendix F GNU LIBRARY GENERAL PUBLICE LICENSE