[parisc-linux] HP-UX binary compatibility

Matthew Wilcox willy@debian.org
Thu, 4 Oct 2001 21:10:08 +0100


On Thu, Oct 04, 2001 at 12:58:18PM -0500, Neulinger, Nathan wrote:
> int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
> {
> /*Unimplemented HP-UX syscall emulation. Syscall #334 (sysfs)
>   Args: 1 80057bf4 0 400179f0 0 0 0 */
> 
>         if ( opcode == 1 ) { /* GETFSIND */
>                 printk(KERN_DEBUG "hpux_sysfs called with '%s'", (char
> *)arg1);
>         }
> 
>         printk(KERN_DEBUG "hpux_sysfs called with opcode = %d\n", opcode);
> }

You can't do that.  `arg1' points to a user address, not a kernel
address.  You need to use things like strlen_user and copy_from_user --
see include/asm-parisc/uaccess.h.

-- 
Revolutions do not require corporate support.