sys_fstat [fs/stat.c]
Obtains information about a file. This system calls is identical to sys_stat except it uses a file descriptor to specify the file. Arguments
eax | 108
ebx | File descriptor.
ecx | Pointer to a stat structure which will be filled with return information:
`struc stat { .st_dev rd 1 .st_ino rd 1 .st_mode rw 1 .st_nlink rw 1 .st_uid rw 1 .st_gid rw 1 .st_rdev rd 1 .st_size rd 1 .st_blksize rd 1 .st_blocks rd 1 .st_atime rd 1 .st_atime_nsec rd 1 .st_mtime rd 1 .st_mtime_nsec rd 1 .st_ctime rd 1 .st_ctime_nsec rd 1 .__unused4 rd 1 .__unused5 rd 1 }`
`stat members: st_dev` `Device on which this file resides.` `st_ino` `Inode number.` `st_mode` `File permissions mask which may consist of the following values: S_ISUID - set user ID on execution S_ISGID - set group ID on execution S_ISVTX - on directories, restricted deletion flag S_IRWXU - owner has read, write and execute permission S_IRUSR - owner has read permission S_IWUSR - owner has write permission S_IXUSR - owner has execute permission S_IRWXG - group has read, write and execute permission S_IRGRP - group has read permission S_IWGRP - group has write permission S_IXGRP - group has execute permission S_IRWXO - others have read, write and execute permission S_IROTH - others have read permission S_IWOTH - others have write permission S_IXOTH - others have execute permission The set-group-ID bit (S_ISGID) has several special uses. For a directory it indicates that BSD semantics is to be used for that directory: files created there inherit their group ID from the directory, not from the effective group ID of the creating process, and directories created there will also get the S_ISGID bit set. For a file that does not have the group execution bit (S_IXGRP) set, the set-group-ID bit indicates mandatory file/record locking. The `sticky' bit (S_ISVTX) on a directory means that a file in that directory can be renamed or deleted only by the owner of the file, by the owner of the directory, and by a privileged process.` `st_nlink` `Number of links to the file.` `st_uid` `User ID of file owner.` `st_gid` `Group ID of group owner.` `st_rdev` `Device that this file (inode) represents.` `st_size` `Size of the file (if it is a regular file or a symbolic link) in bytes. The size of a symlink is the length of the pathname it contains, without a trailing null byte.` `st_blksize` `"Preferred" blocksize for efficient file system I/O. (Writing to a file in smaller chunks may cause an inefficient read-modify-rewrite.)` `st_blocks` `Number of blocks allocated to the file, 512-byte units.` `st_atime` `Last access time. Changed by file accesses. (depends on the file system)` `st_atime_nsec` `Last access time in nanoseconds.` `st_mtime` `Changed by file modifications. (depends on the file system)` `st_mtime_nsec` `Last modification time in nanoseconds.` `st_ctime` `Changed by writing or by setting inode information.` `st_ctime_nsec` `Creation time in nanoseconds.` `__unused4` `Not used.` `__unused5` `Not used.`
Return values If the system call succeeds the return value is 0. If the system call fails the return value is one of the following errno values:
`-EBADF` | `ebx is bad.`
`-ENOMEM` | `A component of the path is not a directory.`
Remarks n/a Compatibility n/a