ccc8030189
returned to userland by read(2) also needs to be converted. For this, the bpf descriptor is flagged as compat32 (or not) in the open and ioctl functions (where the user process's pid is also updated in the descriptor). When the bpf buffer is filled in, the 32bits or native header is used depending on the information stored in the descriptor. This won't work if a 64bit binary does the open and ioctls, and then exec a 32bit program which will do the read. But this is very unlikely to happen in real life ... Tested on i386 and loongson; with these changes my loongson can run dhclient and tcpdump with a n32 userland. |
||
---|---|---|
.. | ||
Makefile | ||
files.netbsd32 | ||
netbsd32.h | ||
netbsd32_compat_09.c | ||
netbsd32_compat_10.c | ||
netbsd32_compat_12.c | ||
netbsd32_compat_13.c | ||
netbsd32_compat_14.c | ||
netbsd32_compat_20.c | ||
netbsd32_compat_30.c | ||
netbsd32_compat_43.c | ||
netbsd32_compat_50.c | ||
netbsd32_conv.h | ||
netbsd32_core.c | ||
netbsd32_event.c | ||
netbsd32_exec.h | ||
netbsd32_exec_aout.c | ||
netbsd32_exec_elf32.c | ||
netbsd32_execve.c | ||
netbsd32_fs.c | ||
netbsd32_ioctl.c | ||
netbsd32_ioctl.h | ||
netbsd32_ipc.c | ||
netbsd32_lwp.c | ||
netbsd32_mod.c | ||
netbsd32_netbsd.c | ||
netbsd32_sa.c | ||
netbsd32_sa.h | ||
netbsd32_select.c | ||
netbsd32_sem.c | ||
netbsd32_signal.c | ||
netbsd32_socket.c | ||
netbsd32_syscall.h | ||
netbsd32_syscallargs.h | ||
netbsd32_syscalls.c | ||
netbsd32_sysctl.c | ||
netbsd32_sysctl.h | ||
netbsd32_sysent.c | ||
netbsd32_time.c | ||
netbsd32_wait.c | ||
syscalls.conf | ||
syscalls.master |