2009-04-06 03:03:47     Kernal returning -1 always for any negative values

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-04-06 03:03:47     Kernal returning -1 always for any negative values

ThangarJ P (INDIA)

Message: 72197   

 

Hi,

 

I am working with BF533-EZkit and uClinux distribution 2008R1.5.

 

i have written one character driver in the kernal.

 

if we call any API from the user space(read,write or ioctl) then we are returning some values to user from kernal space.

 

But we are receiving always -1in the user space  if we returning any negative value excluding -1from kernal space .

 

could you please clarify why this happening?

 

 

 

Thanks.

 

With Regards,

 

Thangaraj.P

QuoteReplyEditDelete

 

 

2009-04-06 03:46:29     Re: Kernal returning -1 always for any negative values

Mike Frysinger (UNITED STATES)

Message: 72199   

 

that isnt how char drivers (or any driver for that matter) works.  the return value of the function never represents data passed to the user.

 

please read a book about writing linux device drivers:

docs.blackfin.uclinux.org/doku.php?id=references_and_pointers

 

some there are completely free (like LDD3).

Attachments

    Outcomes