Skip to content

POSIX compatibility #5

@Pesa

Description

@Pesa

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:

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions