Hi Werner, On Sun, Mar 31, 2013 at 02:26:15PM -0300, Werner Almesberger wrote: > Alexander Aring wrote: > > I don't know if EINVAL the right errno here. > > Yeah, I don't like EINVAL either. It seems that almost everything > that can possibly go wrong returns EINVAL, giving no clue what > actually happened. > > But one issue is that some things expect specific error codes. > Looking for precedent, the closest thing I was able to find is > net/ieee802154/nl-phy.c:ieee802154_add_iface which returns > EINVAL if there's no phy->add_iface. > > > Maybe we can use ENOTSUP > > According to [1], ENOTSUP sounds as if it belonged to a specific > subsystem: > > "Not supported. The implementation does not support this feature of > the Realtime Option Group." > > If we decide to stray from EINVAL, maybe EOPNOTSUPP would be a > little closer: > > "Operation not supported on socket. The type of socket (address > family or protocol) does not support the requested operation." > > Another fairly common choice could be ENOSYS: > ahh, ENOSYS is a good choice. I mean it sounds good to me.
I don't know if EOPNOTSUPP is only for some kind of operations for 'setsockop'(don't see this as errors in the man page) or similar functions. The opengroup documentation says about some operations on socket interfaces. I think it's a little confuse if perror(in userspace) says about a socket operation, when you do something on your netdev which isn't a socket. The same issue we have with ENOTSUP and "Realtime Option Group". An another Question is, is the errno available up to userspace? I mean the device need to transfer this errno up to some libnl error handling code which figure out a error string for the specific errno, so lowpan-tools can print it out to stderr. Alex ------------------------------------------------------------------------------ Own the Future-Intel(R) Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2 _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel