Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.sao.ru/hq/sts/linux/book/c_marshall/section2_18_2.html
Дата изменения: Unknown Дата индексирования: Sat Sep 11 19:54:09 2010 Кодировка: Поисковые слова: http news.cosmoport.com 2005 04 22 1.htm |
To use system calls and library functions in a C program we simply call the
appropriate C function (Appendix ).
We have already met some system calls when dealing with low level IO - open(), creat(), read(), write() and close() are examples.
Examples of standard library functions we have met include the higher level I/O functions - fopen(), fprintf(), sprintf(), malloc() ...
All math functions such as sin(), cos(), sqrt() and random number generators - random(), seed(), lrand48(), drand48() etc. are standard math library functions.
NOTE: most standard library functions will use system calls within them.
For most system calls and library functions we have to include an appropriate header file. e.g. stdio.h, math.h
Information on nearly all system calls and library functions is available in manual pages. These are available on line: Simply type man function name.
e.g. ~man drand48
would give information about this random number generator.
All system calls and library functions have been listed in a previous handout.
We have already seen examples of string handling library functions. For the rest of this course we will study the application of a few more system and library functions.