Page 922 RETURN VALUE The fgetgrent()function returns the group information structure, or NULL if there are no more entries or an error occurs. ERRORS ENOMEM Insufficient memory to allocate group information structure. CONFORMS TO SVID 3 SEE ALSO getgrnam(3), getgrgid(3), getgrent(3), setgrent(3), endgrent(3) GNU, 4 April 1993 fgetpwentfgetpwentGets password file entry SYNOPSIS #include <pwd.h> #include <stdio.h> #include <sys/types.h> struct passwd *fgetpwent(FILE *stream); DESCRIPTION The fgetpwent() function returns a pointer to a structure containing the broken-out fields of a line in the file stream. The first time it is called it returns the first entry; thereafter, it returns successive entries. The file stream must have the same format as /etc/passwd. The passwd structure is defined in <pwd.h> as follows: struct passwd { char *pw_name; /* username */ char *pw_passwd; /* user password */ uid_t pw_uid; /* user id */ gid_t pw_gid; /* group id */ char *pw_gecos; /* real name */ char *pw_dir; /* home directory */ char *pw_shell; /* shell program */ }; RETURN VALUE The fgetpwent() function returns the passwd structure, or NULL if there are no more entries or an error occurs. ERRORS ENOMEM Insufficient memory to allocate passwd structure. FILES /etc/passwd password database file CONFORMS TO SVID 3 SEE ALSO getpwnam(3), getpwuid(3), getpwent(3), setpwent(3), endpwent(3), getpw(3), putpwent( 3), passwd(5) GNU, 17 May 1996 floorfloorLargest integral value not greater than x SYNOPSIS #include <math.h> double floor(double x); DESCRIPTION The floor() function rounds x downward to the nearest integer, returning that value as a double. CONFORMS TO SVID 3, POSIX, BSD 4.3, ISO 9899 SEE ALSO abs(3), fabs(3), ceil(3), rint(3) 6 June 1993 fmodfmodFloating-point remainder function SYNOPSIS #include <math.h> double fmod(double x, double y); DESCRIPTION The modf() function computes the remainder of dividing x by y. The return value is x_n*y, where n is the quotient of x/y, rounded toward 0 to an integer. RETURN VALUE The fmod() function returns the remainder unless y is 0, in which case the function fails and errno is set. ERRORS EDOM The denominator y is 0. CONFORMS TO SVID 3, POSIX, BSD 4.3, ISO 9899 SEE ALSO drem(3) 6 June 1993 Page 924 fnmatchfnmatchMatches filename or pathname SYNOPSIS #include <fnmatch.h> int fnmatch(const char *pattern, const char *strings,int flags); DESCRIPTION fnmatch() checks the strings argument and checks whether it matches the pattern argument, which is a shell wildcard pattern. The flags argument modifies the behavior; it is the bitwise OR of zero or more of the following flags:
RETURN VALUE Zero if string matches pattern, FNM_NOMATCH if there is no match, or another value if there is an error. CONFORMS TO Proposed POSIX.2 BUGS POSIX.2 is not yet an approved standard; the information in this man page is subject to change. SEE ALSO sh(1), glob(3), glob(7) GNU, 19 April 1993 fopen, fdopen, freopenfopen, fdopen, freopenStream open functions SYNOPSIS #include <stdio.h> FILE *fopen( char *path, char *mode); FILE *fdopen( int fildes, char *mode); FILE *freopen( char *path, char *mode,FILE*stream); DESCRIPTION The fopen function opens the file whose name is the string pointed to by path and associates a stream with it. The argument mode points to a string beginning with one of the following sequences (additional characters may follow these sequences):
Page 925
The mode string can also include the letter b either as a third character or as a character between the characters in any of the two-character strings described previously. This is strictly for compatibility with ANSI C3.159-1989 (ANSI C) and has no effect; the b is ignored. Any created files will have mode S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH (0666), as modified by the process's umask value. (See umask(2).) Reads and writes may be intermixed on read/write streams in any order. Note that ANSI C requires that a file positioning function intervene between output and input, unless an input operation encounters end-of-file. (If this condition is not met, then a read is allowed to return the result of writes other than the most recent.) Therefore it is good practice (and indeed sometimes necessary under Linux) to put an fseek or fgetpos operation between write and read operations on such a stream. This operation may be an apparent no-op (as in fseek(..., 0L, SEEK_CUR)) called for its synchronizing side effect. The fdopen function associates a stream with the existing file descriptor, fildes. The mode of the stream must be compatible with the mode of the file descriptor. The file descriptor is not duplicated. The freopen function opens the file whose name is the string pointed to by path and associates the stream pointed to by stream with it. The original stream (if it exists) is closed. The mode argument is used just as in the fopen function. The primary use of the freopen function is to change the file associated with a standard text stream (stderr, stdin, or stdout). RETURN VALUES On successful completion, fopen, fdopen, and freopen return a FILE pointer. Otherwise, NULL is returned, and the global variable errno is set to indicate the error. ERRORS
The fopen, fdopen, and freopen functions may also fail and set errno for any of the errors specified for the routine malloc(3). The fopen function may also fail and set errno for any of the errors specified for the routine open(2). The fdopen function may also fail and set errno for any of the errors specified for the routine fcntl(2). The freopen function may also fail and set errno for any of the errors specified for the routines open(2), fclose(3) and fflush(3). SEE ALSO open(2), fclose(3) STANDARDS The fopen and freopen functions conform to ANSI C3.159-1989 (ANSI C). The fdopen function conforms to IEEE Std1003.1-1988 (POSIX.1). BSD Man Page, 13 December 1995 fpathconf, pathconffpathconf, pathconfGet configuration values for files Page 926 SYNOPSIS #include <unistd.h> long fpathconf(int filedes,intname); long pathconf(char *path, int name); DESCRIPTION fpathconf() gets a value for the configuration option name for the open file descriptor filedes. pathconf() gets a value for configuration option name for the filename path. The corresponding macros defined in <unistd.h> are the minimum values; if an application wants to take advantage of values that may change, a call to fpathconf() or pathconf() can be made, which may yield more liberal results. Setting name equal to one of the following constants returns the following configuration options:
RETURN VALUE The limit is returned, if one exists. If the system does not have a limit for the requested resource, _1 is returned, and errno is unchanged. If there is an error, _1 is returned, and errno is set to reflect the nature of the error. CONFORMS TO POSIX.1. Files with name lengths longer than the value returned for name equal to _PC_NAME_MAX may exist in the given directory. Some returned values may be huge; they are not suitable for allocating memory. SEE ALSO getconf(1), statfs(2), open(2), sysconf(3) GNU, 4 April 1993 fread, fwritefread, fwriteBinary stream input/output |