Vladimir V. Saveliev wrote:

> It is doable, but afaics now it looks almost useless as far as st_nlink is 16 bit
> even in stat64.

glibc uses int for link count (all modes).
typedef __u_int __nlink_t;              /* Type of file link counts.  */

kernel stat uses short
struct stat {
        [...]
        unsigned short st_nlink;

kernel stat64 also uses int
struct stat64 {
        [...]
        unsigned int    st_nlink;


and in case of stat, link counts above a couple of hundreds is rarely
important, so for most practical uses returning 65535 for counts above
65535 is perfectly fine.

> libc also will have to change, and that will probably make problems for existing
> programs.

libc is already using int for both stat and stat64.

--
Henrik Nordstrom

Reply via email to