Linux中的close函数

2023年7月11日,周二晚上


在 Linux 中,close() 函数是一个系统调用,用于关闭文件描述符(file descriptor)。

头文件是unistd.h

它的原型如下:

#include <unistd.h>

int close(int fd);
  • fd:要关闭的文件描述符。

close() 函数的返回值为 0 表示成功关闭文件描述符,返回值为 -1 表示关闭失败。

猜你喜欢

转载自blog.csdn.net/m0_61629312/article/details/131670587