Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Apr 2008 18:00:43 +0200
From:      Pieter de Boer <pieter@thedarkside.nl>
To:        freebsd-emulation@freebsd.org
Subject:   Linux compat ioctl return values
Message-ID:  <481897AB.7070003@thedarkside.nl>

next in thread | raw e-mail | index | archive | help
Hi,

I've been working on a kernel driver that creates a device. This device
in turn is opened and ioctl'd from a Linux executable. I've registered a
handler for these ioctl's and my ioctl handler is succesfully executed.

My ioctl-handler returns a large positive value, but the userland
application retrieves the value 1, EPERM. If I return 42, the userland
application retrieves 42, but 260 is retrieved as 1. It appears there's a
threshold somewhere above which the return value is set to 1, but I
haven't been able to find out where in the code this is done. The Linux
executable actually expects the value I return, and doesn't work when
EPERM is found instead.

So, the question is: does anyone know where such a threshold may
reside and how to work around it?

Thanks,
Pieter




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?481897AB.7070003>