Glibc:Functions
lastmod 2021-11-05created 2021-11-052 edits
List of GNU C functions.
Data conversion functions
- strtof(): Converts a real-number string to a float
- strtod(): Converts a real-number string to a double
- strtoul(): Converts an integer string to an unsigned long integer in a chosen base
- strtol(): Converts an integer string to an integer in a chosen base
- atof(): Converts a decimal real-number string to a double
- atol(): Converts a decimal integer string to a long integer
- atoi(): Converts a decimal integer string to an integer
Working with files and directories
- dup2(): Makes a copy of a file descriptor
- dup(): Makes a copy of a file descriptor
- ftruncate(): Changes a file to the specified size
- truncate(): Changes a file to the specified size
- fdopen(): Gets a stream pointer from a descriptor
- lseek(): Moves the read/write pointer to an arbitrary position in a file
- read(): Reads a file
- fcntl(): Record locking
- access(): Checks whether a file exists or its access permissions.
- fsync(): Writes buffer contents to disk
- sync(): Writes buffer contents to disk
- chroot(): Sets the root directory]
- fchown(): Changes ownership
- chown(): Changes ownership
- fchmod(): Changes a file's access permissions
- chmod(): Changes file access permissions
- rename(): Renames a file or directory
- remove(): Deletes a file or directory
- symlink(): Creates a symbolic link
- unlink(): Deletes a link
- link(): Creates a link
- rewinddir(): Resets the directory read position to the beginning
- readdir(): Gets an entry in a directory
- closedir(): Closes a directory
- opendir(): Opens a directory
- getcwd(): Gets the current working directory
- creat(): Creates a file
- write(): Writes a file
- close(): Closes a file
- open(): Opens a file
I/O functions
- fseek(): Moves the read/write position in a file
- rewind(): Resets the file read/write position to the beginning
- ftell(): Gets the read/write position in a file
- I/O(): function clearerr Resets file error information
- ferror(): Checks whether a file error occurred
- feof(): Checks for end of file
- ungetc(): Gives back the last character read
- fwrite(): Writes buffer contents to a file
- fread(): Reads the specified number of items from a file
- fprintf(): Formatted output to a file
- fscanf(): Reads formatted data from a file
- fputs(): Writes a string to a file
- fgets(): Reads a string from a file
- fputc(): Writes a character to a file
- fgetc(): Reads one character from a file
- fclose(): Closes a file
- fopen(): Opens a file
- sprintf(): Formatted output to a memory area
- sscanf(): Reads formatted data from a data area
- printf(): Formatted output to the standard output device
- scanf(): Reads formatted input from the standard input device
- puts(): Writes a string to standard output
- gets(): Reads a string from the standard device
- putchar(): Writes a character to the standard output device
- getchar(): Reads one character from the standard input device
IPC functions
- semop(): Changes a semaphore value
- semctl(): Controls a semaphore
- semget(): Creates and accesses a semaphore
- shmctl(): Checks/changes/removes shared memory information
- shmdt(): Detaches shared memory from a process
- shmat(): Attaches shared memory to a process
- shmget(): Creates shared memory
- msgctl(): Message queue status info/change/delete
- msgrcv(): Receives data from a message queue
- msgsnd(): Sends data to a message queue
- msgget(): Creates a message queue
- mkfifo(): Makes a FIFO pipe
- pipe(): IPC using a pipe
- pclose(): Closes a pipe
- popen(): Creates a pipe
Math functions
- log10(): Gets the common logarithm
- log(): Gets the natural logarithm
- exp(): Gets e to the power of x
- tan(): Gets the tan value
- cos(): Gets the cos value
- sin(): Gets the sin value
- sqrt(): Gets the square root
- pow(): Gets the power
- srand(): Sets the random number seed
- rand(): Generates a random number
- modf(): Gets the integer and fractional parts of a double value
- floor(): Rounds down everything after the decimal point
- ceil(): Rounds up everything after the decimal point
- fmod(): Gets the remainder of a double division
- ldiv(): Gets the quotient and remainder of a long integer division
- div(): Gets the quotient and remainder of an int integer division
- fabs(): Gets the absolute value of a double variable
- labs(): Gets the absolute value of a long variable
- abs(): Gets the absolute value of an int variable
Memory management functions
- memset(): Initializes memory to a specific value
- memcmp(): Compares the contents of two memory variables
- memchr(): Searches memory for a character
- memmove(): Copies a memory area, works on overlapping areas too
- memcpy(): Copies a memory area
- realloc(): Changes the size of dynamic memory
- free(): Returns allocated memory
- calloc(): Dynamic memory allocation with a specified element size
- malloc(): Dynamic memory allocation
Search and sort functions
- qsort(): Quicksort
- hdestroy(): Deletes a hash table
- hsearch(): Searches a hash table for data
- hcreate(): Creates a hash table
- twalk(): Visits the contents of every node in a binary tree
- tdelete(): Deletes a node from a binary tree
- tfind(): Binary tree search
- tsearch(): Binary tree search and insert
- bsearch(): Binary search
- lfind(): Searches a table for data
- lsearch(): Searches a table for data and adds it
Program execution functions
- getopt_long(): Uses long-name options at runtime
- unsetenv(): Deletes an environment variable
- setenv(): Adds or modifies an environment variable
- putenv(): Adds or modifies an environment variable
- getenv(): Gets the value of an individual environment variable
- environ(): Global variable holding the program's execution environment values
- envp(): Argument of main that holds the program environment
- getopt(): Gets program argument information
- abort(): Forcibly terminates the program
- assert(): Checks a given condition
- perror(): Prints the error message
- strerror(): Gets the error message for errno.
- errno(): Gets the error number
Processor functions
- getgrnam(): Gets group information by group name
- getgrgid(): Gets group information by group ID
- endgrent(): Closes the group file
- setgrent(): Moves the group file read position to the top line
- getgrent(): Reads the contents of the group file
- endpwent(): Closes the password file
- setpwent(): Moves the read position in the password file to the first line
- getpwent(): Gets user information from the password file
- getpwnam(): Gets user information by login user name
- getpwuid(): Gets user information by user ID
- getlogin(): Gets the logged-in user name
- getegid(): Gets the effective group ID
- getgid(): Gets the real group ID
- geteuid(): Gets the effective user ID.
- getuid(): Gets the real user ID.
Signal functions
- sigsuspend(): Sets a signal block and waits
- sigpending(): Checks blocked signals
- sigpromask(): Sets signals to the pending state
- alarm(): Sends SIGALRM at the specified time
- raise(): Sends a signal to the process itself
- pause(): Waits until a signal is received
- kill(): Sends a signal
- sigaction(): Versatile signal handling
- signal(): Sets how a signal is handled
- sleep(): Waits for the specified time
- sigfillset(): Adds all signals to a signal set
- sigismember(): Checks whether a signal is in a signal set
- sigdelset(): Removes a signal from a signal set
- sigaddset(): Adds a signal to a signal set
Socket functions
- gethostbyname(): Gets hostent information from a domain name
- gethostname(): Gets the host name
- recvfrom(): Receives data from a socket
- sendto(): Sends data through a socket
- recv(): Receives data from a socket
- send(): Sends data through a socket
- accept(): Accepts a client connection request
- connect(): Requests a connection to a server
- listen(): Waits until a client connection request arrives
- inet_addr(): Gets a long numeric IP address from an IP string
- ntohl(): long network byte order to host byte order
- ntohs(): short network byte order to host byte order
- htnol(): Host byte order to network byte order
- htnos(): Host byte order to network byte order
- bind(): Assigns an IP address and port number to a socket
- socket(): Creates a socket
Date and time functions
- clock(): Gets the time elapsed since the program started
- difftime(): Gets the difference between dates and times
- strftime(): Gets a date and time string
- mktime(): Gets an integer date and time value from a specified date and time
- gmtime(): Gets Coordinated Universal Time information from a time_t value
- localtime(): Gets local time information from a time_t value
- ctime(): Converts a time in seconds to a readable string
- time(): Gets the current time value
String handling functions
- isdigit(): Checks whether a character is a digit ('0'~'9')
- iscntrl(): Checks whether a character is a control character
- isblank(): Checks whether it is a space or tab character
- isascii(): Checks whether a character is an ASCII character
- isalpha(): Checks whether it is an alphabetic character
- isalnum(): Checks whether it is an alphabetic character or a digit
- strncmp(): Compares strings up to a length
- strcmp(): Compares strings
- strncat(): Concatenates two strings with a specified length
- strcat(): Concatenates two strings
- sigemptyset(): Clears all contents of a signal set
- strtok(): Splits a string by characters
- strpbrk(): Gets a pointer to where any of the specified characters first appears in a string
- strcspn(): Gets the length of the part of a string not containing the specified characters
- strspn(): Gets the length of the part of a string made up of the specified characters
- strstr(): Searches a string for the position of a given substring
- strrchr(): Searches for the position of a given character from the end of a string
- strchr(): Searches a string for the position of a given character
- strlen(): Gets the length of a string
- strdup(): Makes a clone of a string
- strncpy(): Copies the specified number of characters of a string
- strcpy(): Copies a string
- strncasecmp(): Compares strings up to the specified length, ignoring case
- strcasecmp(): Compares strings ignoring case
- tolower(): Converts an uppercase letter to lowercase and returns it
- toupper(): Converts a lowercase letter to uppercase
- isxdigit(): Checks whether a character is a hexadecimal digit
- isupper(): Checks whether a character is uppercase
- isspace(): Checks whether a character is a whitespace character
- ispunct(): Checks whether a character is a punctuation character
- isprint(): Checks whether a character is printable
- islower(): Checks whether a character is lowercase
- isgraph(): Checks whether a character is printable
User and group management functions
- getgrnam(): Gets group information by group name
- getgrgid(): Gets group information by group ID
- endgrent(): Closes the group file
- setgrent(): Moves the group file read position to the top line
- getgrent(): Reads the contents of the group file
- endpwent(): Closes the password file
- setpwent(): Moves the read position in the password file to the first line
- getpwent(): Gets user information from the password file
- getpwnam(): Gets user information by login user name
- getpwuid(): Gets user information by user ID
- getlogin(): Gets the logged-in user name
- getegid(): Gets the effective group ID
- getgid(): Gets the real group ID
- geteuid(): Gets the effective user ID.
- getuid(): Gets the real user ID.