偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

close 中文man頁(yè)面

系統(tǒng)
close 關(guān)閉 一個(gè) 文件 描述符 , 使它 不在 指向 任何 文件 和 可以 在 新的 文件 操作 中 被 再次 使用. 任何 與 此 文件 相關(guān)聯(lián) 的 以及 程序 所 擁有 的 鎖 , 都 會(huì) 被 刪除 (忽略 那些 持有 鎖 的 文件描述符)

NAME 名字

close - 關(guān)閉一個(gè)文件描述符  

SYNOPSIS 總覽

#include <unistd.h>

int close(int fd);

DESCRIPTION 描述

close 關(guān)閉 一個(gè) 文件 描述符 , 使它 不在 指向 任何 文件 和 可以 在 新的 文件 操作 中 被 再次 使用. 任何 與 此 文件 相關(guān)聯(lián) 的 以及 程序 所 擁有 的 鎖 , 都 會(huì) 被 刪除 (忽略 那些 持有 鎖 的 文件描述符)

假如 fd 是 最后 一個(gè) 文件描述符 與此 資源 相 關(guān)聯(lián) , 則 這個(gè) 資源 將 被 釋放. 若此 描述符 是 最后 一個(gè) 引用 到 此 文件 上 的 , 則 文件 將 使用 unlink(2) 刪除.  

RETURN VALUE 返回值

close 返回 0 表示 成功 , 或者 -1 表示 有 錯(cuò)誤 發(fā)生 .  

ERRORS 錯(cuò)誤信息

EBADF
fd 不是 一個(gè) 有效 的 已 被 打開 的 文件 的 描述符
EINTR
The close() 調(diào)用 被 一 信號(hào) 中斷.
EIO
I/O 有 錯(cuò)誤 發(fā)生

CONFORMING TO

SVr4, SVID, POSIX, X/OPEN, BSD 4.3. SVr4 documents an additional ENOLINK error condition.  

NOTES 注意

通常 不檢測(cè) 返回值 , 除了 發(fā)生 嚴(yán)重 的 程序 錯(cuò)誤. 文件系統(tǒng) 使用 了 "write-behind" 的 技術(shù) 提高 了 執(zhí)行 write(2) 時(shí) 的 性能 . 即使 還 沒有 被 寫 , 寫操作 也會(huì) 成功 . 錯(cuò)誤 信息 在 寫操作 以后報(bào)告 , 但是 這 保證 在 關(guān)閉 文件 時(shí) 報(bào)告 . 在 關(guān)閉 文件 時(shí) 不檢測(cè) 返回值 可能會(huì) 導(dǎo)致 數(shù)據(jù) 的 丟失 . 這 一點(diǎn) 在 NFS 和 磁盤 配額 上 比較 明顯.

由于 內(nèi)核 會(huì) 延遲 寫 , 所以 就算 成功 關(guān)閉 一個(gè) 文件 不能 保證 數(shù)據(jù) 被 成功 的 寫到 磁盤 上. 當(dāng) 文件流 關(guān)閉 時(shí) , 對(duì) 文件系統(tǒng) 來說 一般 不去 刷新 緩沖區(qū) . 如果 你 要 保證 數(shù)據(jù) 寫入磁盤 等 物理 存貯器 中就 使用 fsync(2) 或 sync(2), 他們 會(huì) 做到 你想做的 (對(duì)于 這一點(diǎn) 要 依賴于 磁盤 設(shè)備).  

SEE ALSO 參考

open(2), fcntl(2), shutdown(2), unlink(2), fclose(3)

#p#

NAME

close - close a file descriptor  

SYNOPSIS

#include <unistd.h>

int close(int fd);

DESCRIPTION

close closes a file descriptor, so that it no longer refers to any file and may be reused. Any locks held on the file it was associated with, and owned by the process, are removed (regardless of the file descriptor that was used to obtain the lock).

If fd is the last copy of a particular file descriptor the resources associated with it are freed; if the descriptor was the last reference to a file which has been removed using unlink(2) the file is deleted.  

RETURN VALUE

close returns zero on success, or -1 if an error occurred.  

ERRORS

EBADF
fd isn't a valid open file descriptor.
EINTR
The close() call was interrupted by a signal.
EIO
An I/O error occurred.

CONFORMING TO

SVr4, SVID, POSIX, X/OPEN, BSD 4.3. SVr4 documents an additional ENOLINK error condition.  

NOTES

Not checking the return value of close is a common but nevertheless serious programming error. It is quite possible that errors on a previous write(2) operation are first reported at the final close. Not checking the return value when closing the file may lead to silent loss of data. This can especially be observed with NFS and disk quotas.

A successful close does not guarantee that the data has been successfully saved to disk, as the kernel defers writes. It is not common for a filesystem to flush the buffers when the stream is closed. If you need to be sure that the data is physically stored use fsync(2). (It will depend on the disk hardware at this point.)  

SEE ALSO

open(2), fcntl(2), shutdown(2), unlink(2), fclose(3), fsync(2)

責(zé)任編輯:韓亞珊 來源: CMPP.net
相關(guān)推薦

2011-08-24 10:24:26

CLOSE中文man

2011-08-25 16:57:51

iconv_close中文man

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-11 15:28:43

ali中文man

2011-08-11 16:31:49

biff中文man

2011-08-11 17:16:43

cce中文man

2011-08-11 18:05:04

chvt中文man

2011-08-11 18:13:07

clear中文man

2011-08-12 09:13:02

df中文man

2011-08-12 09:38:06

dircolors中文man

2011-08-12 09:44:37

dirname中文man

2011-08-12 10:20:02

echo中文man

2011-08-12 10:25:55

eject中文man

2011-08-12 11:07:19

git中文man

2011-08-12 13:18:19

head中文man

2011-08-12 13:49:23

hostid中文man
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)