diff options
| author | Paul Richards <paul@FreeBSD.org> | 2000-12-29 00:44:42 +0000 |
|---|---|---|
| committer | Paul Richards <paul@FreeBSD.org> | 2000-12-29 00:44:42 +0000 |
| commit | 7842f151ba566f9b107cdae56983eecfc3b270d2 (patch) | |
| tree | 6e3b767e529e43747cb97d0e0f49c691d2c3958a /sys/compat | |
| parent | 732556082136768bfe2f685318ca3cd504ee6fd5 (diff) | |
Notes
Diffstat (limited to 'sys/compat')
| -rw-r--r-- | sys/compat/linux/linux_stats.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index fa91a2da53db..18d76ff98da5 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -44,6 +44,8 @@ #include <machine/../linux/linux_proto.h> #include <compat/linux/linux_util.h> +#include <sys/sysctl.h> + struct linux_newstat { #ifdef __alpha__ u_int stat_dev; @@ -112,6 +114,18 @@ newstat_copyout(struct stat *buf, void *ubuf) tbuf.stat_ctime = buf->st_ctime; tbuf.stat_blksize = buf->st_blksize; tbuf.stat_blocks = buf->st_blocks; + if (tbuf.stat_mode & S_IFCHR && + (umajor(buf->st_rdev) == 116 || + umajor(buf->st_rdev) == 13)) { + + tbuf.stat_mode &= ~S_IFCHR; + tbuf.stat_mode |= S_IFBLK; + + /* XXX this may not be quite right */ + /* Map major number to 0 */ + tbuf.stat_dev = uminor(buf->st_dev) & 0xf; + tbuf.stat_rdev = buf->st_rdev & 0xff; + } return (copyout(&tbuf, ubuf, sizeof(tbuf))); } |
