Dev_t C

30.12.2020
  1. Dev_t C M
  2. Ck Builders Construction & Dev't Corporation
  3. Phildex Industries & Dev't Corporation
  1. What does DEV'T mean in Miscellaneous? This page is about the meanings of the acronym/abbreviation/shorthand DEV'T in the field in general and in the Miscellaneous terminology in particular.
  2. 2 definitions of DEV-T. Definition of DEV-T in Slang/Internet Slang. What does DEV-T stand for?
  3. Feb 21, 2020  This video is unavailable. Watch Queue Queue. Watch Queue Queue.

Mar 08, 2015  Artist: Devi Dev Track: TORICK Video: Berry Oost Videos 2MG inc.

Next: Reading Attributes, Up: File Attributes [Contents][Index]

14.9.1 The meaning of the File Attributes

When you read the attributes of a file, they come back in a structurecalled struct stat. This section describes the names of theattributes, their data types, and what they mean. For the functionsto read the attributes of a file, see Reading Attributes.

The header file sys/stat.h declares all the symbols definedin this section.

Data Type: struct stat

The stat structure type is used to return information about theattributes of a file. It contains at least the following members:

mode_t st_mode

Specifies the mode of the file. This includes file type information(see Testing File Type) and the file permission bits(see Permission Bits).

ino_t st_ino

The file serial number, which distinguishes this file from all otherfiles on the same device.

dev_t st_dev

Identifies the device containing the file. The st_ino andst_dev, taken together, uniquely identify the file. Thest_dev value is not necessarily consistent across reboots orsystem crashes, however.

nlink_t st_nlink

The number of hard links to the file. This count keeps track of howmany directories have entries for this file. If the count is everdecremented to zero, then the file itself is discarded as soon as noprocess still holds it open. Symbolic links are not counted in thetotal.

uid_t st_uid

The user ID of the file’s owner. See File Owner.

gid_t st_gid

The group ID of the file. See File Owner.

off_t st_size

This specifies the size of a regular file in bytes. For files that arereally devices this field isn’t usually meaningful. For symbolic linksthis specifies the length of the file name the link refers to.

time_t st_atime

This is the last access time for the file. See File Times.

unsigned long int st_atime_usec

This is the fractional part of the last access time for the file.See File Times.

time_t st_mtime

This is the time of the last modification to the contents of the file.See File Times.

unsigned long int st_mtime_usec

This is the fractional part of the time of the last modification to thecontents of the file. See File Times.

time_t st_ctime

This is the time of the last modification to the attributes of the file.See File Times.

unsigned long int st_ctime_usec

This is the fractional part of the time of the last modification to theattributes of the file. See File Times.

blkcnt_t st_blocks

This is the amount of disk space that the file occupies, measured inunits of 512-byte blocks.

The number of disk blocks is not strictly proportional to the size ofthe file, for two reasons: the file system may use some blocks forinternal record keeping; and the file may be sparse—it may have“holes” which contain zeros but do not actually take up space on thedisk.

You can tell (approximately) whether a file is sparse by comparing thisvalue with st_size, like this:

This test is not perfect because a file that is just slightly sparsemight not be detected as sparse at all. For practical applications,this is not a problem.

unsigned int st_blksize

The optimal block size for reading or writing this file, in bytes. Youmight use this size for allocating the buffer space for reading orwriting the file. (This is unrelated to st_blocks.)

The extensions for the Large File Support (LFS) require, even on 32-bitmachines, types which can handle file sizes up to 2^63.Therefore a new definition of struct stat is necessary.

Data Type: struct stat64

The members of this type are the same and have the same names as thosein struct stat. The only difference is that the membersst_ino, st_size, and st_blocks have a differenttype to support larger values.

mode_t st_mode

Specifies the mode of the file. This includes file type information(see Testing File Type) and the file permission bits(see Permission Bits).

ino64_t st_ino

The file serial number, which distinguishes this file from all otherfiles on the same device.

dev_t st_dev

Identifies the device containing the file. The st_ino andst_dev, taken together, uniquely identify the file. Thest_dev value is not necessarily consistent across reboots orsystem crashes, however.

nlink_t st_nlink

The number of hard links to the file. This count keeps track of howmany directories have entries for this file. If the count is everdecremented to zero, then the file itself is discarded as soon as noprocess still holds it open. Symbolic links are not counted in thetotal.

uid_t st_uid

The user ID of the file’s owner. See File Owner. How do i stop little snitch.

gid_t st_gid

The group ID of the file. See File Owner.

off64_t st_size

This specifies the size of a regular file in bytes. For files that arereally devices this field isn’t usually meaningful. For symbolic linksthis specifies the length of the file name the link refers to.

time_t st_atime

This is the last access time for the file. See File Times.

unsigned long int st_atime_usec

This is the fractional part of the last access time for the file.See File Times.

time_t st_mtime

This is the time of the last modification to the contents of the file.See File Times.

unsigned long int st_mtime_usec

This is the fractional part of the time of the last modification to thecontents of the file. See File Times.

time_t st_ctime

This is the time of the last modification to the attributes of the file.See File Times.

unsigned long int st_ctime_usec

This is the fractional part of the time of the last modification to theattributes of the file. See File Times.

blkcnt64_t st_blocks

This is the amount of disk space that the file occupies, measured inunits of 512-byte blocks.

unsigned int st_blksize

The optimal block size for reading of writing this file, in bytes. Youmight use this size for allocating the buffer space for reading ofwriting the file. (This is unrelated to st_blocks.)

Some of the file attributes have special data type names which existspecifically for those attributes. (They are all aliases for well-knowninteger types that you know and love.) These typedef names are definedin the header file sys/types.h as well as in sys/stat.h.Here is a list of them.

Data Type: mode_t

This is an integer data type used to represent file modes. Inthe GNU C Library, this is an unsigned type no narrower than unsignedint.

Data Type: ino_t

This is an unsigned integer type used to represent file serial numbers.(In Unix jargon, these are sometimes called inode numbers.)In the GNU C Library, this type is no narrower than unsigned int.

If the source is compiled with _FILE_OFFSET_BITS 64 this typeis transparently replaced by ino64_t.

Data Type: ino64_t

This is an unsigned integer type used to represent file serial numbersfor the use in LFS. In the GNU C Library, this type is no narrower thanunsigned int.

When compiling with _FILE_OFFSET_BITS 64 this type isavailable under the name ino_t.

Data Type: dev_t

This is an arithmetic data type used to represent file device numbers.In the GNU C Library, this is an integer type no narrower than int.

Data Type: nlink_t

This is an integer type used to represent file link counts.

Data Type: blkcnt_t

This is a signed integer type used to represent block counts.In the GNU C Library, this type is no narrower than int.

If the source is compiled with _FILE_OFFSET_BITS 64 this typeis transparently replaced by blkcnt64_t.

Data Type: blkcnt64_t

This is a signed integer type used to represent block counts for theuse in LFS. In the GNU C Library, this type is no narrower than int.

When compiling with _FILE_OFFSET_BITS 64 this type isavailable under the name blkcnt_t.

Next: Reading Attributes, Up: File Attributes [Contents][Index]

Name

stat, fstat, lstat - get file status

Synopsis

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

int stat(const char *path, struct stat *buf);
int fstat(int
fd, struct stat *buf);
int lstat(const char *
path, struct stat *buf);

Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

Not all of the Linux file systems implement all of the time fields. Some file system types allow mounting in such a way that file and/or directory accessesdo not cause an update of the st_atime field. (See noatime, nodiratime, and relatime in mount(8), and related information inmount(2).) In addition, st_atime is not updated if a file is opened with the O_NOATIME; see open(2).

The field st_atime is changed by file accesses, for example, by execve(2), mknod(2), pipe(2), utime(2) and read(2)(of more than zero bytes). Other routines, like mmap(2), may or may not update st_atime.

The field st_mtime is changed by file modifications, for example, by mknod(2), truncate(2), utime(2) and write(2) (ofmore than zero bytes). Moreover, st_mtime of a directory is changed by the creation or deletion of files in that directory. The st_mtime field isnot changed for changes in owner, group, hard link count, or mode.

The field st_ctime is changed by writing or by setting inode information (i.e., owner, group, link count, mode, etc.).

The following POSIX macros are defined to check the file type using the st_mode field:

S_ISREG(m)

is it a regular file?

S_ISDIR(m)

directory?

S_ISCHR(m)

character device?

S_ISBLK(m)

block device?

S_ISFIFO(m)

FIFO (named pipe)?

S_ISLNK(m)

symbolic link? (Not in POSIX.1-1996.)

S_ISSOCK(m)

socket? (Not in POSIX.1-1996.)

The following flags are defined for the st_mode field:
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: filescreated there inherit their group ID from the directory, not from the effective group ID of the creating process, and directories created there will also getthe 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/recordlocking.

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 ofthe directory, and by a privileged process.

Return Value

On success, zero is returned. On error, -1 is returned, and errno is set appropriately.

Errors

EACCES

Search permission is denied for one of the directories in the path prefix of path. (See also path_resolution(7).)

EBADF

fd is bad.

EFAULT

Bad address.

ELOOP

Too many symbolic links encountered while traversing the path.

ENAMETOOLONG
path is too long.
ENOENT

A component of path does not exist, or path is an empty string.

ENOMEM

Out of memory (i.e., kernel memory).

ENOTDIR
A component of the path prefix of path is not a directory.
EOVERFLOW
path or fd refers to a file whose size, inode number, or number of blocks cannot be represented in, respectively, the types off_t,ino_t, or blkcnt_t. This error can occur when, for example, an application compiled on a 32-bit platform without -D_FILE_OFFSET_BITS=64calls stat() on a file whose size exceeds (1<<31)-1 bytes.

Conforming To

These system calls conform to SVr4, 4.3BSD, POSIX.1-2001.

According to POSIX.1-2001, lstat() on a symbolic link need return valid information only in the st_size field and the file-type component ofthe st_mode field of the stat structure. POSIX.-2008 tightens the specification, requiring lstat() to return valid information in allfields except the permission bits in st_mode.

Use of the st_blocks and st_blksize fields may be less portable. (They were introduced in BSD. The interpretation differs between systems, andpossibly on a single system when NFS mounts are involved.) If you need to obtain the definition of the blkcnt_t or blksize_t types from<sys/stat.h>, then define _XOPEN_SOURCE with the value 500 or greater (before including any header files).

POSIX.1-1990 did not describe the S_IFMT, S_IFSOCK, S_IFLNK, S_IFREG, S_IFBLK, S_IFDIR, S_IFCHR,S_IFIFO, S_ISVTX constants, but instead demanded the use of the macros S_ISDIR(), etc. The S_IF* constants are present inPOSIX.1-2001 and later.

The S_ISLNK() and S_ISSOCK() macros are not in POSIX.1-1996, but both are present in POSIX.1-2001; the former is from SVID 4, the latter fromSUSv2.

UNIX V7 (and later systems) had S_IREAD, S_IWRITE, S_IEXEC, where POSIX prescribes the synonyms S_IRUSR, S_IWUSR,S_IXUSR.

Other systems

Values that have been (or are) in use on various systems:
A sticky command appeared in Version 32V AT&T UNIX.

Notes

Since kernel 2.5.48, the stat structure supports nanosecond resolution for the three file timestamp fields. Glibc exposes the nanosecond component ofeach field using names of the form st_atim.tv_nsec if the _BSD_SOURCE or _SVID_SOURCE feature test macro is defined. These fields arespecified in POSIX.1-2008, and, starting with version 2.12, glibc also exposes these field names if _POSIX_C_SOURCE is defined with the value 200809L orgreater, or _XOPEN_SOURCE is defined with the value 700 or greater. If none of the aforementioned macros are defined, then the nanosecond values areexposed with names of the form st_atimensec. On file systems that do not support subsecond timestamps, the nanosecond fields are returned with the value0.

On Linux, lstat() will generally not trigger automounter action, whereas stat() will (but see fstatat(2)).

For most files under the /proc directory, stat() does not return the file size in the st_size field; instead the field is returned withthe value 0.

Underlying kernel interface

Dev_t C M(1),sec(1),setfilecon(3),setmode(3),setxattr(2),sh(1),spax(1),spu_create(2),spufs(2),spufs(7),star(1),stat(1),statfs(2),strmode(3),sudo(8),syscalls(2),time(7),

Ck Builders Construction & Dev't Corporation

umask(2),ustat(2),utimensat(2),watchdog(8),xbiff(1),xdvi(1),xfs_db(8),xfs_io(8),zfs(8),zshmodules

Phildex Industries & Dev't Corporation

(1)