fstatat()函式 Unix/Linux
fstatat - 得到相對檔案的狀態到一個目錄檔案描述符
內容簡介
#include <sys/stat.h> int fstatat(int dirfd, const char *path, struct stat * buf ", int " flags );
描述
The fstatat() system call operates in exactly the same way as stat(2), except for the differences described in this manual page.
If the pathname given in path is relative, then it is interpreted relative to the directory referred to by the file descriptor dirfd (rather than relative to the current working directory of the calling process, as is done by stat(2) for a relative pathname).
If the pathname given in path is relative and dirfd is the special value AT_FDCWD, thenpath is interpreted relative to the current working directory of the calling process (likestat(2)).
If the pathname given in path is absolute, then dirfd is ignored.
flags can either be 0, or include the following flag:
標籤 | 描述 |
---|---|
AT_SYMLINK_NOFOLLOW | If path is a symbolic link, do not dereference it: instead return information about the link itself, like lstat(2). (By default, fstatat() dereferences symbolic links, likestat(2).) |
返回值
On success, fstatat() returns 0. On error, -1 is returned and errno is set to indicate the error.
錯誤
The same errors that occur for stat(2) can also occur for fstatat(). The following additional errors can occur for fstatat():
標籤 | 描述 |
---|---|
EBADF | dirfd is not a valid file descriptor. |
EINVAL | Invalid flag specified in flags. |
ENOTDIR | path is a relative path and dirfd is a file descriptor referring to a file other than a directory. |
注意
See openat(2) for an explanation of the need for fstatat().
遵循於
This system call is non-standard but is proposed for inclusion in a future revision of POSIX.1. A similar system call exists on Solaris.
版本
fstatat() was added to Linux in kernel 2.6.16.
另請參閱
相關文章
- c/c++語言函式 stat, fstat, lstat, fstatat - get file statusC++函式
- Linux/Unix C程式設計之的perror函式,strerror函式,errnoLinuxC程式程式設計Error函式
- Linux Clone函式Linux函式
- Linux ---lseek() 函式Linux函式
- Linux Shell函式Linux函式
- Signal ()函式詳細介紹 Linux函式函式Linux
- UNIX系統程式設計常用庫函式說明(轉)程式設計函式
- UNIX安全程式設計及庫函式說明(轉)程式設計函式
- Linux access()函式 使用Linux函式
- 關閉 linux下的umask( )函式、setsid( )函式Linux函式
- 自己寫的unix檔案拷貝指令cp實現函式函式
- 研究linux函式 之 fork()Linux函式
- Linux上的GetTickCount函式Linux函式
- linux之getopt 函式(轉)Linux函式
- Linux Shell 自定義函式Linux函式
- linux下C語言中的mkdir函式與rmdir函式LinuxC語言函式
- Unix, Linux 和MacOSLinuxMac
- LINUX UNIX建立組Linux
- linux/unix find命令Linux
- Linux/Unix Errno CodeLinux
- Linux中select()函式分析Linux函式
- Linux下getopt函式的使用Linux函式
- linux signal函式詳解Linux函式
- linux下的c庫函式Linux函式
- linux時間函式詳解Linux函式
- linux中fork()函式詳解Linux函式
- linux下getopt函式的用法Linux函式
- Linux下的時間函式Linux函式
- Unix/Linux環境C程式設計入門教程(31) 數學函式帶你戰勝企業面試LinuxC程式程式設計函式面試
- MySQL函式大全(字串函式,數學函式,日期函式,系統級函式,聚合函式)MySql函式字串
- Oracle 函式大全(字串函式,數學函式,日期函式,邏輯運算函式,其他函式)Oracle函式字串
- 【函式式 Swift】函式式思想函式Swift
- Linux 與 Unix 之差異Linux
- linux/unix命令參考Linux
- Linux和UNIX監控Linux
- Linux/Unix筆記本Linux筆記
- linux/unix 掃描埠Linux
- 何為linux or unix posixLinux