-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
This package is targeted at "POSIX compatible OS". However, looking at the code, I noticed several incompatibilities with POSIX. These are a couple of examples I saw so far, but I only took a quick look and there may be others:
ndn-iot-package-over-posix/adaptation/udp/udp-face.c
Lines 203 to 204 in 4b31168
| size = recvfrom(ptr->sock, ptr->buf, sizeof(ptr->buf), MSG_DONTWAIT, | |
| (struct sockaddr*)&client_addr, &addr_len); |
MSG_DONTWAIT is not specified by POSIX.
| }else if(size == -1 && errno == EWOULDBLOCK){ |
POSIX.1-2001 allows either EAGAIN or EWOULDBLOCK to be returned for this case, and does not guarantee that these constants have the same value, so a portable application should check for both.
| if(ioctl(ptr->sock, FIONBIO, (char *)&iyes) == -1){ |
FIONBIO is non-standard. You should use fcntl(...O_NONBLOCK...) instead.
Metadata
Metadata
Assignees
Labels
No labels