[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: problem with ioctl call

Title: AW: problem with ioctl call

Info on IOCTL

Linux Standard Base Specification 1.3.030310

ioctl -- control device

#include <sys/ioctl.h>

int ioctl(int d, int request ...);

ioctl manipulates the underlying device parameters of special files. d must be an open file descriptor. The type and value of the third parameter is dependent on the device and request.

An application may not call ioctl except for situations explicitly stated in this specification.

Return Value
On success, 0 is returned. An ioctl may use the return value as an output parameter and return a non-negative value on success. On error, -1 is returned and the global variable errno is set appropriately.


d is not a valid descriptor.

The third parameter references an inaccessible memory area.

d is not associated with a character special device.

The specified request does not apply to the kind of object that d references.

request or the third parameter is not valid.

MFG Thomas

-----Ursprungliche Nachricht-----
Von: Orjan Friberg [mailto:orjan.friberg@xxxxxxx.com]
Gesendet: Dienstag, 10. Juni 2003 15:52
An: Schachner Thomas
Cc: 'dev-etrax@xxxxxxx.com'
Betreff: Re: problem with ioctl call

Schachner Thomas wrote:
> this line in the code causes an segmentation fault on the axis board ,
> but on
> the host system all is ok!!
> ret = ioctl(dev->fd,IOCTL_USB_CLAIMINTF, &interface);
> It seems that the ioctl System call is causing this problem on the axis
> board
> What can i do now ?

I'm guessing that the ioctl call goes to the onewire/libusb.so file, so
I would suggest adding printouts to that function to try and narrow down
exactly which line in the code causes the segmentation fault.  If that
particular line accesses a pointer, for example, I would trace back to
where and how it was declared and allocated.  I've seen stuff before in
some USB drivers where static structs were declared __devinitdata (which
means it's thrown away by the kernel) and later used, which didn't work

Orjan Friberg
Axis Communications