]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Make linux stat(2) return the same st_dev for every devfs instance.
authortrasz <trasz@FreeBSD.org>
Sat, 11 Jul 2020 13:08:16 +0000 (13:08 +0000)
committertrasz <trasz@FreeBSD.org>
Sat, 11 Jul 2020 13:08:16 +0000 (13:08 +0000)
commitedfea716900a1d92a9fbfd51ed501b4bfd465663
tree7c87314e60126d28ebc655d7f5ffcba7ba943f68
parent478bacc77c13048f5767f00345ad0fd1ec2bbb2e
Make linux stat(2) return the same st_dev for every devfs instance.
The reason for this is to work around an idiosyncrasy of glibc
getttynam(3) implementation: it checks whether st_dev returned for
fd 0 is the same as st_dev returned for the target of /proc/self/fd/0
symlink, and with linux chroots having their own devfs instance,
the check will fail if you chrooted into it.

PR: kern/240767
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25559
sys/compat/linux/linux_stats.c