词条 | Close (system call) |
释义 |
A close system call is a system call used to close a file descriptor by the kernel. For most file systems, a program terminates access to a file in a filesystem using the close system call. This flushes file buffers, updates file metadata, which may include and end-of-file indicator in the data; de-allocates resources associated with the file (including the file descriptor) and updates the system wide table of files in use. Some programming languages maintain a data structure of files opened by their runtime library and may close when the program terminates. This practice is known as resource acquisition is initialization (RAII). Some operating systems will invoke the C library POSIX definitionThe close call is standardized by the POSIX specification The function returns zero to indicate the file was closed successfully. If any error occurs, a value of -1 is returned and errno is appropriately set. The errors that can occur include:
The argument supplied was not a valid file descriptor
The function call was interrupted by a signal
An I/O error occurred References
External links
2 : C POSIX library|System calls |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。