QSTAT(2) UNIX Programmer's Manual QSTAT(2) NAME qstat, qfstat - get extended file status SYNOPSIS #include #include qstat(name, buf) char *name; struct qstat *buf; qfstat(fildes, buf) struct qstat *buf; DESCRIPTION _Q_s_t_a_t obtains detailed information about a named file. _Q_f_s_t_a_t obtains the same information about an open file known by the file descriptor from a successful _o_p_e_n, _c_r_e_a_t, _d_u_p or _p_i_p_e(2) call. _N_a_m_e points to a null-terminated string naming a file; _b_u_f is the address of a buffer into which information is placed concerning the file. It is unnecessary to have any permis- sions at all with respect to the file, but all directories leading to the file must be searchable. The layout of the structure pointed to by buf as defined in <_q_s_t_a_t._h> is given below. struct qstat { char qs_flag; char qs_count; /* reference count */ dev_t qs_dev; /* device where inode resides */ ino_t qs_number; /* i number, 1-to-1 with device address */ u_short qs_mode; short qs_nlink; /* directory entries */ short qs_uid; /* owner */ short qs_gid; /* group of owner */ off_t qs_size; /* size of file */ union { struct { daddr_t qs_addr[NADDR]; /* if normal file/directory */ daddr_t qs_lastr; /* last logical block read */ }; struct { daddr_t qs_rdev; /* qs_addr[0] */ #ifdef MPX_FILS struct group qs_group; /* multiplexer group file */ #endif }; struct { daddr_t qs_qused; Printed 7/30/83 1 QSTAT(2) UNIX Programmer's Manual QSTAT(2) daddr_t qs_qmax; }; } qs_un; time_t qs_atime; /* access time */ time_t qs_mtime; /* modification time */ time_t qs_ctime; /* creation time */ }; _Q_s__m_o_d_e is encoded according to the `#define' statements in . The mode bits 0000070 and 0000007 encode group and others permissions (see _c_h_m_o_d(2)). The defined types, _d_a_d_d_r__t, _i_n_o__t, _o_f_f__t, and _t_i_m_e__t name various width values; _d_e_v__t encodes major and minor device numbers. Their exact definitions are in the include file (see _t_y_p_e_s(5)). When _f_i_l_d_e_s is associated with a pipe, _q_f_s_t_a_t reports an ordinary file with restricted permissions. The size is the number of bytes queued in the pipe. _Q_s__a_t_i_m_e is the time the file was last read. For reasons of efficiency, it is not set when a directory is searched, although this would be more logical. _Q_s__m_t_i_m_e is the time the file was last written or created. It is not set by changes of owner, group, link count, or mode. _Q_s__c_t_i_m_e is set both both by writing and changing the i-node. ERRORS _Q_s_t_a_t will fail if: [EINVAL] The path name contains a non-ASCII byte. [ENOTDIR] A component of the path prefix is not a directory. [EACCES] A component of the path prefix denies search permission. [EFAULT] _B_u_f or _n_a_m_e points outside the process's allocated address space. [ELOOP] Too many symbolic links were encountered in translating the path name. _Q_s_t_a_t_f will fail if: [EBADF] _F_i_l_d_e_s is not a valid open descriptor. [EFAULT] _B_u_f points outside the process's allo- cated address space. Printed 7/30/83 2 QSTAT(2) UNIX Programmer's Manual QSTAT(2) SEE ALSO file(1), ls(1), pq(1), quota(2), stat(2), filsys(5), set- quota(8) ASSEMBLER (local = 58., qfstat = 11.) sys local; 9f . . . .data 9: sys qfstat; fildes; buf (local = 58. qfstat = 12.) sys local; 9f . . . .data 9: sys qstat; name; buf Printed 7/30/83 3