Skip to content

posix updates#1

Open
thehesiod wants to merge 3 commits into
marklakata:masterfrom
thehesiod-forks:master
Open

posix updates#1
thehesiod wants to merge 3 commits into
marklakata:masterfrom
thehesiod-forks:master

Conversation

@thehesiod

@thehesiod thehesiod commented Sep 24, 2016

Copy link
Copy Markdown
  • fixes open/close etc functions
  • fixes COND_TIMED_WAIT error value
  • makes printfs debug only
  • fixes headers for POSIX
  • does more error checking on windows methods
  • fixes param issues on posix
  • does string length checking for temp paths
  • adds mq_sendtimed
  • correctly marks threaded notifications as not supported

- fixes open/close etc functions
- fixes COND_TIMED_WAIT error value
- makes printfs debug only
- fixes headers for POSIX
- does more error checking on windows methods
- fixes param issues on posix
- does string length checking for temp paths
- adds mq_sendtimed

@thehesiod thehesiod left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments based on my changes

Comment thread mqueue.c
{
SetEvent(hdr->mqh_wait);
return 0;
BOOL result = SetEvent(hdr->mqh_wait);

@thehesiod thehesiod Sep 24, 2016

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetEvent success is non-zero, however pthread_cond_signal is 0 on success, it should match pthread_cond_signal. Of Interested is that the return value is currently not checked

Comment thread mqueue.c
return ETIMEDOUT;
}

return EINVAL;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method needed to return an error value similar to pthread_cond_timedwait

Comment thread mqueue.c
strcpy(pathBuffer, temp);
strcat(pathBuffer, pathPart);
return 1;
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now does error checking on the string length

Comment thread mqueue.c
/* open and specify O_EXCL and user-execute */
oflag &= ~3; // strip off RDONLY, WRONLY or RDWR bits
fd = _open(pathBuffer, oflag | O_EXCL | O_RDWR, mode | S_IXUSR);
fd = open(pathBuffer, oflag | O_EXCL | O_RDWR, mode | S_IXUSR);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to keep the names posix compatible

Comment thread mqueue.c
}

if(n != 0) {
errno = n;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callers expect the errno to be set

Comment thread mqueue.c
errno = EMSGSIZE;
goto err;
}

@thehesiod thehesiod Sep 24, 2016

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the MUTEX_LOCK above also be timed? If so the same should be done in the timed send

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant