Henrik Nordstrom wrote:

> 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.
>

Ok, but if libc's struct stat and kernel's struct stat are that different then libc's
stat would have to do something to interpret properly what was put in its buffer by
sys_stat?

Thanks,
vs


>
> --
> Henrik Nordstrom

Reply via email to