1 exit function and _exit function
#include <stdlib.h>void exit (int status)void _exit (int status)
The difference between these two functions is that the exit function performs cleanup before entering the kernel (cleanup I/O buffering), and the_exit function goes directly into the kernel
2 atexit function, register function, execute at exit
int atexit (void (* func) (void));
The functions that are registered are called termination handlers, which are called in the reverse order of registration, and are called multiple times if a function is registered multiple times.
3 malloc function and calloc function
#include <stdlib.h>void * malloc (size_t size)void* CALLOC (size_t nobj, size_t Size
malloc allocates space according to number of bytes,calloc allocates space according to number of objects
4 getenv, get environment variable
#include <stdlib.h>Char* getenv (constChar* name)
Get value by name
5 putenv,setenv,unsetenv function
int putenv (char* str)int setenv (constcharconst charint rewrite)int unsetenv (char* name)
Putenv takes the "Name=value" form of the string as a parameter, adds it to the environment,
Unsetenv Delete The term "name"
UNIX Environment Advanced Programming Learning Note (iv): Process environment