diff options
| author | Martin Cracauer <cracauer@FreeBSD.org> | 2000-06-15 09:57:34 +0000 |
|---|---|---|
| committer | Martin Cracauer <cracauer@FreeBSD.org> | 2000-06-15 09:57:34 +0000 |
| commit | 6f6b2cd019d1fbaa22403f47b967e93a7fec25c7 (patch) | |
| tree | 0fcd66209860d461a9497e39f1c21d2cd9842b6c /sys/compat/linux/linux_misc.c | |
| parent | 7d02379e48bda7b5794419714f1cc572296e7e66 (diff) | |
Notes
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
| -rw-r--r-- | sys/compat/linux/linux_misc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index bb043e47b4e7d..1adea544b05e0 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -696,7 +696,7 @@ linux_mmap(struct proc *p, struct linux_mmap_args *args) sizeof(linux_args)))) return error; #ifdef DEBUG - printf("Linux-emul(%ld): mmap(%p, %d, %d, %08x, %d, %d)\n", + printf("Linux-emul(%ld): mmap(%p, %d, %d, 0x%08x, %d, %d)", (long)p->p_pid, (void *)linux_args.addr, linux_args.len, linux_args.prot, linux_args.flags, linux_args.fd, linux_args.pos); #endif @@ -756,9 +756,17 @@ linux_mmap(struct proc *p, struct linux_mmap_args *args) } bsd_args.prot = linux_args.prot | PROT_READ; /* always required */ - bsd_args.fd = linux_args.fd; + if (linux_args.flags & LINUX_MAP_ANON) + bsd_args.fd = -1; + else + bsd_args.fd = linux_args.fd; bsd_args.pos = linux_args.pos; bsd_args.pad = 0; +#ifdef DEBUG + printf("-> (%p, %d, %d, 0x%08x, %d, %d)\n", + (void *)bsd_args.addr, bsd_args.len, + bsd_args.prot, bsd_args.flags, bsd_args.fd, (int)bsd_args.pos); +#endif return mmap(p, &bsd_args); } |
