getgrgid

相关函数:fgetgrent, getgrent, getgrnam

头文件:#include <grp.h>    #include <sys/types.h>

定义函数:strcut group * getgrgid(gid_t gid);

函数说明:getgrgid()用来依参数gid 指定的组识别码逐一搜索组文件, 找到时便将该组的数据以group 结构返回. group 结构请参考getgrent().

返回值:返回 group 结构数据, 如果返回NULL 则表示已无数据, 或有错误发生.

范例
/* 取得gid=3 的组数据 */
#include <grp.h>
#include <sys/types.h>
main()
{
    strcut group *data;
    int i = 0;
    data = getgrgid(3);
    printf("%s:%s:%d:", data->gr_name, data->gr_passwd, data->gr_gid);
    while(data->gr_mem[i])
        printf("%s, ", data->mem[i++]);
        printf("\n");
}


执行:
sys:x:3:root, bin, adm
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
perl函数手册英文版 Perl提供了可以直接调用的、数目众多的函数。可以对以下对象进行操作: 数组:chomp, join, keys, map, pop, push, reverse, shift, sort, splice, split, unshift, values 数据库:dbmclose, dbmopen 目录:chdir, closedir, mkdir, opendir, readdir, rewinddir, rmdir, seekdir, telldir 文件:binmode, chdir, chmod, chown, chroot, close, eof, fnctl, fileno, flock, getc, glob, ioctl, link, lstat, open, print, printf, read, readdir, readlink, rename, rmdir, seek, select, stat, symlink, sysopen, sysread, syswrite, tell, truncate, umask, unlink, utime, write 组:endgrent, getgrent, getgrgid, getgrname, getpgrp, setgrent, setpgrp Hash: delete, each, exists, keys, values 主机:endhostent, gethostbyaddr, gethostbyname, sethostent 输入:getc, read, sysread 处理器间通讯:msgctl, msgget, msgrcv, msgsnd, pipe, semctl, semget, semop, shmctl, shmget, hmread, shmwrite 数学:abs, atan2, cos, exp, hex, int, log, oct, rand, sin, sqrt, srand 消息队列:msgctl, msgget, msgrcv, msgsnd 其他:bless, defined, do, eval, formline, import, ref, scalar, syscall, tie, tied, undef, untie, wantarray 网络:endnetent, getnetbyaddr, getnetbyname, getnetent, setnetent 输出:die, print, printf, syswrite, warn, write 口令:endpwent, getpwent, getpwname, getpwuid, setpwent 进程:alarm, die, dump, exec, exit, fork, getlogin, getpgrp, getppid, getpriority, kill, setpriority, sleep, system, times, umask, wait, waitpid 协议:endprotent, getprotobyname, getprotobynumber, getprotoent, getservbyname, getservbyport, getservent, setprotoent 正则表达式:grep, pos, quotemeta, reset, split, study 范围:caller, local, my 服务:endservent, getservbyname, getservbyport, getservent, setservent 套节字:accept, bind, connect, gethostbyaddr, gethostbyname, gethostent, getpeername, getservbyname, getservbyport, getservent, getsockname, getsockopt, listen, recv, select, send, setsockopt, shutdown, socket, socketpair 字符串:chop, chr, crypt, hex, index, join, lc, lcfirst, length, oct, Ord, pack, q, qq, quotemeta, qw, qx, reverse, rindex, split, sprintf, substr, uc, ucfirst, unpack, vec 时间:gmtime, localtime, time UNIX: chmod, chown, chroot, dump, endgrent, endhostent, endnetent, endprotent, endpwent, endservent, fnctl, fork, getgrent, getgrgid, getgrname, gethostent, getlogin, getnetent, getpgrp, getppid, getpriority, getprotobyname, getprotobynumber, getprotoent, getpwent, getpwname, getpwuid, getservbyname, getservbyport, getservent, ioctl, link, lstat, readlink, select, setgrent, sethostent, setnetent, setpgrp, setpriority, setprotoent, setpwent, setservent, sleep, syscall, times, umask, wait, waitpid
Special Edition Using Perl for Web Programming David Harlan, et al. CONTENTS Chapter 1 Perl Overview Perl Origins H Borrowings H Cost and Licensing H Distribution H G Perl Programs Invocation H Command-Line Arguments H Program Layout H G Data Types Scalars H Arrays H Associative Arrays H File Handles H G Special Variables Environment Variables H Program Arguments H Current Line H System Error Messages H G Flow Control Logical Operators H G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (1 of 24) [2/17/2007 1:22:33 PM] Conditional Expressions H Compound Statements H Loops H Labels H Subroutines H Variable Scope H Patterns Regular Expressions H Matching H Substitution H G From Here G Chapter 2 Introduction to CGI Justifying the Use of CGI Reasons for Using Perl H How to Make Perl Do CGI H G Understanding CGI Calling a Script from a Form H Getting Information to the Script H Processing QUERY_STRING into Useful Chunks H Using Regular Expressions tr/// and s/// H Printing the Page H Creating a Script on Your Web Server H Calling a CGI Script Directly H Limiting Data-File Size H Using the Location Header H Using CGI in Server-Side Includes H G From Here G Chapter 3 Advanced Form Processing and Data Storage Using the POST Method Comparing GET and POST H Processing the Information from a POST-Method Form H G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (2 of 24) [2/17/2007 1:22:34 PM] Making Your Perl Code Modular Defining and Calling Subroutines H Using Variable Aliases H G Using DBM Files for Data Storage Opening a DBM File H Assigning Values to a DBM File H Initializing a DBM File H Adding Data to the DBM File H G Using Complex Forms and Storing Related Data Processing the Form Data and Checking the Password H Working Around the Limitations of DBM Files H G From Here G Chapter 4 Advanced Page Output Parsing the DBM File and Printing Pages Printing a Standard Page H Printing User-Designed Pages H G Returning Data to a Form for Further Revision Filling in Text Fields and Selecting List Items H Saving and Editing User-Designed Pages H G From Here G Chapter 5 Searching Searching the Full Text of Your Site Scanning Directories Using a Recursive Subroutine H Using Recursive Subroutines H Processing the Files in Each Directory H G Using an Index Search Indexing Your Web Site into a DBM File H Performing a Search Using the Index File H G Printing the Resulting Pages Returning Pages from the Nonindex Search H Returning Pages from the Index Search H G From Here G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (3 of 24) [2/17/2007 1:22:34 PM] Chapter 6 Using Dynamic Pages Generating HTML Pages G Understanding the CGI Environment and HTML Generation CGI Environment Variables Using the GET Method H CGI Environment Variables Using the POST Method H G Referring the User to Browser-Specific Web Pages G Using Client Pull with Perl G Using Server Push with Perl G From Here G Chapter 7 Dynamic and Interactive HTML Content in Perl and CGI Creating User-Specific Pages Allowing the User to Shop for Options H Building an HTML Document Based on Options H G Using Server-Side Includes Understanding the SSI Commands H Setting up an Environment for Server-Side Includes H Understanding the Commands H G Understanding Shopping Carts Shopping Cart Using Hidden Fields H Shopping Cart Using HTTP Cookies H G From Here G Chapter 8 Understanding Basic User Authentication Basic User Authentication Processes and User IDs H CGI Program Execution H Access Control H User Identification H G User Authentication on the Apache Server Access Restrictions H G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (4 of 24) [2/17/2007 1:22:34 PM] Apache Configuration Files H Configuration Directives H User Administration Adding Users H Deleting Users H Changing Passwords H Adding Users to Groups H Deleting Users from Groups H G From Here G Chapter 9 Understanding CGI Security Understanding the Security Issues Tracing the Chain of Command H Reading Files H Writing to Files H Storing Variables H Losing the Data H G Managing Sessions The Nature of a Session H The Wrapper H Generic Substitutions H Flow Control H G Designing the Sample Application Program Flow H Data Issues H G Implementing the Sample Application Getting Started: The Main Routine H Getting the CGI Values H Reading the Product Data H Invoking a Specific Function H Parsing an HTML File H Initiating a Login H G Logging In and Out Logging In H Validating the User H G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (5 of 24) [2/17/2007 1:22:34 PM] Logging Out H Managing Session Data Storing Session Data H Retrieving Session Data H G Managing the Orders Building an Order H Reviewing the Order H Placing the Order H G Wrapping Up G From Here G Chapter 10 Site Administration Working with Web Server Log Files Generating HTML Output from a Log File H Reviewing the AccessWatch Log Analyzer H G Understanding File Maintenance G Understanding Robots and the Robot-Exclusion Standard G Configuring Some Common Web Servers O'Reilly's WebSite H NCSA httpd H Apache H G Examining Some Other File- and Site-Administration Issues G From Here G Chapter 11 Database Interaction Justifying Perl/Database Interaction G Examining the Database Options DBI and DBD Database Access Modules for Perl 5 H mSQL and mSQLPerl H Oracle RDBMS and Oraperl H Starting a New Message Thread H Listing Threads and Displaying the Contents of a Single Thread H Navigating Through Messages and Posting Replies H G From Here G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (6 of 24) [2/17/2007 1:22:34 PM] Chapter 12 Database Application Using CGI Fundamental Design and Security Issues Advantages and Disadvantages of a Web/RDBMS Interface H Limitations of HTTP in a Database Context H Security Issues H G A Simple Working Example in Perl Accessing a DBMS from Perl H Defining the Database Schema for the Working Example H Searching the Hotlist H Viewing the Detail Record H Submitting Data to the Hotlist H Generating SQL Code to Transfer Submitted Data H G Perl Tools for Web/DBMS Work WDB H Web/Genera H MiniSQL (mSQL) and W3-mSQL H DBI H ODBC Tools H Some Useful Hotlists H G Problem-Solving Debugging H Tuning Performance H G The Future of Web/Database Interfaces G From Here... G Chapter 13 Special Variables $<I<digit>> G $[ G $ACCUMULATOR G $ARG G $ARGV G $BASETIME G $CHILD_ERROR G $DEBUGGING G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (7 of 24) [2/17/2007 1:22:34 PM] $EFFECTIVE_GROUP_ID G $EFFECTIVE_USER_ID G $EVAL_ERROR G $EXECUTABLE_NAME G $FORMAT_FORMFEED G $FORMAT_LINES_LEFT G $FORMAT_LINES_PER_PAGE G $FORMAT_LINE_BREAK_CHARACTERS G $FORMAT_NAME G $FORMAT_PAGE_NUMBER G $FORMAT_TOP_NAME G $INPLACE_EDIT G $INPUT_LINE_NUMBER G $INPUT_RECORD_SEPARATOR G $LAST_PAREN_MATCH G $LIST_SEPARATOR G $MATCH G $MULTILINE_MATCHING G $OFMT G $OS_ERROR G $OUTPUT_AUTOFLUSH G $OUTPUT_FIELD_SEPARATOR G $OUTPUT_RECORD_SEPARATOR G $PERLDB G $PERL_VERSION G $POSTMATCH G $PREMATCH G $PROCESS_ID G $PROGRAM_NAME G $REAL_GROUP_ID G $REAL_USER_ID G $SUBSCRIPT_SEPARATOR G $SYSTEM_FD_MAX G $WARNING G %ENV<variable_name>,<variable_value> G %INC<file-name>,<file-load-status> G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (8 of 24) [2/17/2007 1:22:35 PM] %SIG<signal-name>,<signal-value> G @ARGV G @INC G From Here... G Chapter 14 Operators ! G != G !~ G % G %= G & G && G &&= G &= G * G ** G **= G *= G + (Unary) G + (Binary) G ++ G += G , G - (Unary) G - (Binary) G -- G -= G -> G . G .. G .= G / G /= G < G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (9 of 24) [2/17/2007 1:22:35 PM] << G <<= G <= G <=> G = G == G => G =~ G > G >= G >> G >>= G ? G LIST Operators (Leftward) G LIST Operators (Rightward) G NAMED Unary Operators G TERMs G " G ^ G ^= G and G cmp G eq G ge G gt G le G lt G ne G not G or G x G x= G xor G | G |= G || G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (10 of 24) [2/17/2007 1:22:35 PM] ||= G ~ G From Here... G Chapter 15 Function List -A Compliance H Syntax H Definition H Example H G -B Compliance H Syntax H Definition H Example H G -b Compliance H Syntax H Definition H Example H G -C Compliance H Syntax H Definition H Example H G -c Compliance H Syntax H Definition H Example H G -d Compliance H Syntax H Definition H Example H G endprotoent Compliance H Syntax H Definition H Example H G endpwent Compliance H Syntax H Definition H Example H G endservent Compliance H Syntax H Definition H Example H G eof Compliance H Syntax H Definition H Example H G eval Compliance H Syntax H Definition H Example H G exec Compliance H Syntax H Definition H Example H G local Compliance H Syntax H Definition H G localtime Compliance H Syntax H Definition H Example H G log Compliance H Syntax H Definition H Example H G lstat Compliance H Syntax H Definition H Example H G m// Compliance H Syntax H Definition H Example H G map Compliance H Syntax H Definition H Example H G setpriority Compliance H Syntax H Definition H Example H G setprotoent Compliance H Syntax H Definition H Example H G setpwent Compliance H Syntax H Definition H Example H G setservent Compliance H Syntax H Definition H Example H G setsockopt Compliance H Syntax H Definition H G shift Compliance H Syntax H Definition H Example H G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (11 of 24) [2/17/2007 1:22:35 PM] -e Compliance H Syntax H Definition H Example H G -f Compliance H Syntax H Definition H Example H G -g Compliance H Syntax H Definition H Example H G -k Compliance H Syntax H Definition H Example H G -l Compliance H Syntax H Definition H Example H G -M Compliance H Syntax H Definition H Example H G -O Compliance H Syntax H Definition H Example H G -o G exists Compliance H Syntax H Definition H Example H G exit Compliance H Syntax H Definition H Example H G exp Compliance H Syntax H Definition H Example H G fcntl Compliance H Syntax H Definition H G fileno Compliance H Syntax H Definition H Example H G flock Compliance H Syntax H Definition H G fork Compliance H Syntax H Definition H Example H G format G mkdir Compliance H Syntax H Definition H Example H G msgctl Compliance H Syntax H Definition H G msgget Compliance H Syntax H Definition H G msgrcv Compliance H Syntax H Definition H G msgsnd Compliance H Syntax H Definition H G my Compliance H Syntax H Definition H G next Compliance H Syntax H Definition H Example H G no Compliance H G shmctl Compliance H Syntax H Definition H G shmget Compliance H Syntax H Definition H G shmread Compliance H Syntax H Definition H G shmwrite Compliance H Syntax H Definition H G shutdown Compliance H Syntax H Definition H G sin Compliance H Syntax H Definition H Example H G sleep Compliance H Syntax H Definition H Example H G socket Compliance H G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (12 of 24) [2/17/2007 1:22:35 PM] Compliance H Syntax H Definition H Example H -p Compliance H Syntax H Definition H Example H G -R Compliance H Syntax H Definition H Example H G -r Compliance H Syntax H Definition H Example H G -S Compliance H Syntax H Definition H Example H G -s Compliance H Syntax H Definition H Example H G -T Compliance H Syntax H Definition H Example H G -t Compliance H G Compliance H Syntax H Definition H Example H formline Compliance H Syntax H Definition H Example H G getc Compliance H Syntax H Definition H Example H G getgrent Compliance H Syntax H Definition H Example H G getgrgid Compliance H Syntax H Definition H Example H G getgrname Compliance H Syntax H Definition H Example H G gethostbyaddr Compliance H Syntax H Definition H Example(Perl5 only) H G gethostbyname G Syntax H Definition H Example H oct Compliance H Syntax H Definition H Example H G open Compliance H Syntax H Definition H Example H G opendir Compliance H Syntax H Definition H Example H G ord Compliance H Syntax H Definition H Example H G pack Compliance H Syntax H Definition H Example H G package Compliance H Syntax H Definition H G pipe Compliance H Syntax H G Syntax H Definition H socketpair Compliance H Syntax H Definition H G sort Compliance H Syntax H Definition H Example H G splice Compliance H Syntax H Definition H Example H G split Compliance H Syntax H Definition H Examples H G sprintf Compliance H Syntax H Definition H Example H G sqrt Compliance H Syntax H Definition H Example H G srand Compliance H Syntax H G CONTENTS http://docs.rinet.ru:8080/Using_Perl5_in_Web/ (13 of 24) [2/17/2007 1:22:35 PM] Syntax H Definition H Example H -u Compliance H Syntax H Definition H Example H G -W Compliance H Syntax H Definition H Example H G -w Compliance H Syntax H Definition H Example H G -X Compliance H Syntax H Definition H Example H G -x Compliance H Syntax H Definition H Example H G -z Compliance H Syntax H Definition H Example H G abs Compliance H Syntax H G Compliance H Syntax H Definition H Example H gethostent Compliance H Syntax H Definition H Example H G getlogin Compliance H Syntax H Definition H Example H G getnetbyaddr Compliance H Syntax H Definition H Example H G getnetbyname Compliance H Syntax H Definition H Example H G getnetent Compliance H Syntax H Definition H Example H G getpeername
LINUX C函数库API 1.字符测试篇 15 1.1 15 isalnum(测试字符是否为英文或数字) 15 1.2 15 isalpha (测试字符是否为英文字母) 15 1.3 16 isascii(测试字符是否为ASCII 码字符) 16 1.4 17 iscntrl(测试字符是否为ASCII 码的控制字符) 17 1.5 17 isdigit(测试字符是否为阿拉伯数字) 17 1.6 17 isgraphis(测试字符是否为可打印字符) 17 1.7 18 islower(测试字符是否为小写字母) 18 1.8 18 isprint(测试字符是(否为可打印字符) 18 1.9 19 isspace(测试字符是否为空格字符) 19 1.10 20 ispunct(测试字符是否为标点符号或特殊符号) 20 1.11 20 isupper(测试字符是否为大写英文字母) 20 1.12 21 isxdigit(测试字符是否为16进制数字) 21 2.字符串转换篇 21 2.1 21 atof(将字符串转换成浮点型数) 21 2.2 22 atoi(将字符串转换成整型数) 22 2.3 22 atol(将字符串转换成长整型数) 22 2.4 23 gcvt(将浮点型数转换为字符串,取四舍五入) 23 2.5 24 strtod(将字符串转换成浮点数) 24 2.6 24 strtol(将字符串转换成长整型数) 24 2.7 25 strtoul(将字符串转换成无符号长整型数) 25 2.8 25 toascii(将整型数转换成合法的ASCII 码字符) 25 2.9 26 tolower(将大写字母转换成小写字母) 26 2.10 26 toupper(将小写字母转换成大写字母) 26 3.内存控制篇 27 3.1 27 calloc(配置内存空间) 27 3.2 28 free(释放原先配置的内存) 28 3.3 28 getpagesize(取得内存分页大小) 28 3.4 28 malloc(配置内存空间) 28 3.5 28 mmap(建立内存映射) 28 3.6 30 munmap(解除内存映射) 30 4.日期时间篇 31 4.1 31 asctime(将时间和日期以字符串格式表示) 31 4.2 31 ctime(将时间和日期以字符串格式表示) 31 4.3 32 gettimeofday(取得目前的时间) 32 4.4 33 gmtime(取得目前时间和日期) 33 4.5 34 localtime(取得当地目前时间和日期) 34 4.6 34 mktime(将时间结构数据转换成经过的秒数) 34 4.7 35 settimeofday(设置目前时间) 35 4.8 35 time(取得目前的时间) 35 5.内存及字符串操作篇 36 5.1 36 bcmp(比较内存内容) 36 5.2 36 bcopy(拷贝内存内容) 36 5.3 37 bzero(将一段内存内容全清为零) 37 5.4 37 index(查找字符串中第一个出现的指定字符) 37 5.5. 37 memccpy(拷贝内存内容) 37 5.6 38 memchr(在某一内存范围中查找一特定字符) 38 5.7 38 memcmp(比较内存内容) 38 5.8 39 memcpy(拷贝内存内容) 39 5.9 40 memmove(拷贝内存内容) 40 5.10 40 memset(将一段内存空间填入某值) 40 5.11 40 rindex(查找字符串中最后一个出现的指定字符) 40 5.12 41 strcasecmp(忽略大小写比较字符串) 41 5.13 41 strcat(连接两字符串) 41 5.14 42 strchr(查找字符串中第一个出现的指定字符) 42 5.15 42 strcmp(比较字符串) 42 5.16 43 strcoll(采用目前区域的字符排列次序来比较字符串) 43 5.17 43 strcpy(拷贝字符串) 43 5.18 44 strcspn(返回字符串中连续不含指定字符串内容的字符数) 44 5.19 44 strdup(复制字符串) 44 5.20 45 strlen(返回字符串长度) 45 5.21 45 strncasecmp(忽略大小写比较字符串) 45 5.22 46 strncat(连接两字符串) 46 5.23 46 strncpy(拷贝字符串) 46 5.24 47 strpbrk(查找字符串中第一个出现的指定字符) 47 5.25 47 strrchr(查找字符串中最后出现的指定字符) 47 5.26 47 strspn(返回字符串中连续不含指定字符串内容的字符数) 47 5.27 48 strstr(在一字符串中查找指定的字符串) 48 5.28 48 strtok(分割字符串) 48 6. 常用数学函数篇 49 6.1 49 abs(计算整型数的绝对值) 49 6.2 49 acos(取反余弦函数数值) 49 6.3 50 asin(取反正弦函数值) 50 6.4 50 atan(取反正切函数值) 50 6.5 51 atan2(取得反正切函数值) 51 6.6 51 ceil(取不小于参数的最小整型数) 51 6.7 52 cos(取余玄函数值) 52 6.8 52 cosh(取双曲线余玄函数值) 52 6.9 53 exp(计算指数) 53 6.10 53 frexp(将浮点型数分为底数与指数) 53 6.11 54 ldexp(计算2的次方值) 54 6.12 54 log(计算以e 为底的对数值) 54 6.13 55 log10(计算以10 为底的对数值) 55 6.14 55 pow(计算次方值) 55 6.15 56 sin(取正玄函数值) 56 6.16 56 sinh(取双曲线正玄函数值) 56 6.17 56 sqrt(计算平方根值) 56 6.18 57 tan(取正切函数值) 57 6.19 57 tanh(取双曲线正切函数值) 57 7.用户组篇 58 7.1 58 endgrent(关闭组文件) 58 7.2 58 endpwent(关闭密码文件) 58 7.3 58 endutent(关闭utmp 文件) 58 7.4 59 fgetgrent(从指定的文件来读取组格式) 59 7.5 60 fgetpwent(从指定的文件来读取密码格式) 60 7.6 61 getegid(取得有效的组识别码) 61 7.7 61 geteuid(取得有效的用户识别码) 61 7.8 62 getgid(取得真实的组识别码) 62 7.9 62 getgrent(从组文件中取得账号的数据) 62 7.10 63 getgrgid(从组文件中取得指定gid 的数据) 63 7.11 64 getgrnam(从组文件中取得指定组的数据) 64 7.12 64 getgroups(取得组代码) 64 7.13 65 getpw(取得指定用户的密码文件数据) 65 7.14 66 getpwent(从密码文件中取得账号的数据) 66 7.15 67 getpwnam(从密码文件中取得指定账号的数据) 67 7.16 68 getpwuid(从密码文件中取得指定uid 的数据) 68 7.17 68 getuid(取得真实的用户识别码) 68 7.18 69 getutent(从utmp 文件中取得账号登录数据) 69 7.19 70 getutid(从utmp 文件中查找特定的记录) 70 7.20 71 getutline(从utmp 文件中查找特定的记录) 71 7.21 71 initgroups(初始化组清单) 71 7.22 71 pututline(将utmp 记录写入文件) 71 7.23 72 seteuid(设置有效的用户识别码) 72 7.24 72 setfsgid(设置文件系统的组识别码) 72 7.25 73 setfsuid(设置文件系统的用户识别码) 73 7.26 73 setgid(设置真实的组识别码) 73 7.27 73 setgrent(从头读取组文件中的组数据) 73 7.28 74 setgroups(设置组代码) 74 7.29 74 setpwent(从头读取密码文件中的账号数据) 74 7.30 75 setregid(设置真实及有效的组识别码) 75 7.31 75 setreuid(设置真实及有效的用户识别码) 75 7.32 75 setuid(设置真实的用户识别码) 75 7.33 76 setutent(从头读取utmp 文件中的登录数据) 76 7.34 76 utmpname(设置utmp 文件路径) 76 8.数据结构和算法篇 76 8.1 76 crypt(将密码或数据编码) 76 8.2 77 bsearch(二元搜索) 77 8.3 78 lfind(线性搜索) 78 8.4 79 lsearch(线性搜索) 79 8.5 80 qsort(利用快速排序法排列数组) 80 8.6 81 rand(产生随机数) 81 8.7 81 srand(设置随机数种子) 81 9 文件操作篇 82 9.1 82 close(关闭文件) 82 9.2 82 creat(建立文件) 82 9.3 83 dup(复制文件描述词) 83 9.4 83 dup2(复制文件描述词) 83 9.5 84 fcntl(文件描述词操作) 84 9.6 85 flock(锁定文件或解除锁定) 85 9.7 85 fsync(将缓冲区数据写回磁盘) 85 9.8 85 lseek(移动文件的读写位置) 85 9.9 86 mkstemp(建立唯一的临时文件) 86 9.10 86 open(打开文件) 86 9.11 88 read(由已打开的文件读取数据) 88 9.12 89 sync(将缓冲区数据写回磁盘) 89 9.13 89 write(将数据写入已打开的文件内) 89 10 文件内容操作篇 89 10.1 89 clearerr(清除文件流的错误旗标) 89 10.2 90 fclose(关闭文件) 90 10.3 90 fdopen(将文件描述词转为文件指针) 90 10.4 90 feof(检查文件流是否读到了文件尾) 90 10.5 91 fflush(更新缓冲区) 91 10.6 91 fgetc(由文件中读取一个字符) 91 10.7 91 fgets(由文件中读取一字符串) 91 10.8 92 fileno(返回文件流所使用的文件描述词) 92 10.9 92 fopen(打开文件) 92 10.10 93 fputc(将一指定字符写入文件流中) 93 10.11 94 fputs(将一指定的字符串写入文件内) 94 10.12 94 fread(从文件流读取数据) 94 10.13 95 freopen(打开文件) 95 10.14 95 fseek(移动文件流的读写位置) 95 10.15 96 ftell(取得文件流的读取位置) 96 10.16 96 fwrite(将数据写至文件流) 96 10.17 97 getc(由文件中读取一个字符) 97 10.18 97 getchar(由标准输入设备内读进一字符) 97 10.19 98 gets(由标准输入设备内读进一字符串) 98 10.20 98 mktemp(产生唯一的临时文件名) 98 10.21 99 putc(将一指定字符写入文件中) 99 10.22 99 putchar(将指定的字符写到标准输出设备) 99 10.23 99 rewind(重设文件流的读写位置为文件开头) 99 10.24 99 setbuf(设置文件流的缓冲区) 99 10.25 100 setbuffer(设置文件流的缓冲区) 100 10.26 100 setlinebuf(设置文件流为线性缓冲区) 100 10.27 100 setvbuf(设置文件流的缓冲区) 100 10.28 101 ungetc(将指定字符写回文件流中) 101 11 进程操作篇 101 11.1 101 atexit(设置程序正常结束前调用的函数) 101 11.2 101 execl(执行文件) 101 11.3 102 execlp(从PATH 环境变量中查找文件并执行) 102 11.4 102 execv(执行文件) 102 11.5 103 execve(执行文件) 103 11.6 104 execvp(执行文件) 104 11.7 104 exit(正常结束进程) 104 11.8 104 _exit(结束进程执行) 104 11.9 105 vfork(建立一个新的进程) 105 11.10 105 getpgid(取得进程组识别码) 105 11.11 106 getpgrp(取得进程组识别码) 106 11.12 106 getpid(取得进程识别码) 106 11.13 107 getppid(取得父进程的进程识别码) 107 11.14 107 getpriority(取得程序进程执行优先权) 107 11.15 108 nice(改变进程优先顺序) 108 11.16 108 on_exit(设置程序正常结束前调用的函数) 108 11.17 109 setpgid(设置进程组识别码) 109 11.18 109 setpgrp(设置进程组识别码) 109 11.19 109 setpriority(设置程序进程执行优先权) 109 11.20 110 system(执行shell 命令) 110 11.21 110 wait(等待子进程中断或结束) 110 11.22 111 waitpid(等待子进程中断或结束) 111 11.23 112 fprintf(格式化输出数据至文件) 112 11.24 112 fscanf(格式化字符串输入) 112 ... ... ... ...

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值