rtems_set_errno_and_return_minus_one in driver not returning correct value

Inderjit Singh inderjit.singh at aacmicrotec.com
Fri Aug 21 12:22:24 UTC 2015


Hi,

In my RTEMS driver I set and return error value by following macro:

rtems_set_errno_and_return_minus_one(EALREADY);

But in my rtems app when I print the error out by:

fd = open(RTEMS_SYSFLASH_DEVICE_NAME, O_RDWR);
if(fd < 0) {
  printk("Couldn't Open device (%d:%d:%s).", fd, errno, strerror(errno));
  exit(-1);
}

OUTPUT: Couldn't Open device (-1:22:Invalid argument).

No matter what errno value i set I always get the same (22: Invalid argument). I don't understand why. Any help would be appreciated.

Regards,
Indy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20150821/ec4d0a09/attachment.html>


More information about the devel mailing list