Re: Getting 'bad file number' error writing to device driver

2011-10-19 Thread Mandeep Sandhu
Thanks for the link; but this bit has to be set on the original executable. Is there any way a program in user mode can get around this or set the bit himself? Ummm...now that would be a security violation, don't you think? If a program can elevate it's own privileges, then whats the point of

Re: Getting 'bad file number' error writing to device driver

2011-10-17 Thread Daniel Baluta
: Getting 'bad file number' error writing to device driver On Sat, Oct 15, 2011 at 2:42 AM, Philip Anil-QBW348 anil.phi...@motorolasolutions.com wrote: I am calling the driver from an Android program (OMAP4/Blaze). It calls a c++ program via JNI which then calls the device driver. Someone suggested

Re: Getting 'bad file number' error writing to device driver

2011-10-15 Thread Daniel Baluta
On Sat, Oct 15, 2011 at 2:42 AM, Philip Anil-QBW348 anil.phi...@motorolasolutions.com wrote: I am calling the driver from an Android program (OMAP4/Blaze). It calls a c++ program via JNI which then calls the device driver. Someone suggested it might be a permissions problem - the program is

Getting 'bad file number' error writing to device driver

2011-10-13 Thread Philip Anil-QBW348
I am trying to write to mydriver but get a 'Bad file number' error. int fd = open(/dev/mydriver,O_RDWR); this opens successfully as fd is not -1. ssize_t bytesToWrite = strlen(buf); value is: bytesToWrite 28 ssize_t bytesWritten = write(fd,buf,bytesToWrite); value is: bytesWritten -1

Re: Getting 'bad file number' error writing to device driver

2011-10-13 Thread Daniel Baluta
Hello, I am trying to write to mydriver but get a 'Bad file number' error. int fd = open(/dev/mydriver,O_RDWR); this opens successfully as fd is not -1. ssize_t bytesToWrite = strlen(buf); value is: bytesToWrite 28 ssize_t bytesWritten = write(fd,buf,bytesToWrite); value is: