Skip to content

Commit

Permalink
Cygwin: POSIX msg queues: move all mq_* functionality into fhandler_m…
Browse files Browse the repository at this point in the history
…queue

The POSIX entry points are just wrappers now, calling into
fhandler_mqueue.  While at it, eliminate mqi_flags, replace with
standard fhandler nonblocking flag.

Signed-off-by: Corinna Vinschen <[email protected]>
  • Loading branch information
github-cygwin committed May 25, 2021
1 parent e0cdd46 commit 46f3b0c
Show file tree
Hide file tree
Showing 4 changed files with 492 additions and 476 deletions.
12 changes: 12 additions & 0 deletions winsup/cygwin/fhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -3115,6 +3115,11 @@ class fhandler_mqueue: public fhandler_disk_file

int _dup (HANDLE parent, fhandler_mqueue *child);

int mutex_lock (HANDLE mtx, bool eintr);
int mutex_unlock (HANDLE mtx);
int cond_timedwait (HANDLE evt, HANDLE mtx, const struct timespec *abstime);
void cond_signal (HANDLE evt);

public:
fhandler_mqueue ();
fhandler_mqueue (void *) {}
Expand All @@ -3126,6 +3131,13 @@ class fhandler_mqueue: public fhandler_disk_file

int open (int, mode_t);
int mq_open (int, mode_t, struct mq_attr *);
int mq_getattr (struct mq_attr *);
int mq_setattr (const struct mq_attr *, struct mq_attr *);
int mq_notify (const struct sigevent *);
int mq_timedsend (const char *, size_t, unsigned int,
const struct timespec *);
ssize_t mq_timedrecv (char *, size_t, unsigned int *,
const struct timespec *);

struct mq_info *mqinfo () { return &mqi; }

Expand Down
Loading

0 comments on commit 46f3b0c

Please sign in to comment.