diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 97878699ca..245f04ff7f 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -11,7 +11,7 @@ details. */ changes to the DLL and is mainly informative in nature. */ #define CYGWIN_VERSION_DLL_MAJOR 3005 -#define CYGWIN_VERSION_DLL_MINOR 6 +#define CYGWIN_VERSION_DLL_MINOR 7 /* CYGWIN_VERSION_DLL_COMBINED gives us a single number representing the combined DLL major and minor numbers. */ diff --git a/winsup/cygwin/local_includes/devices.h b/winsup/cygwin/local_includes/devices.h index 1e035f9d6a..6a28cfd189 100644 --- a/winsup/cygwin/local_includes/devices.h +++ b/winsup/cygwin/local_includes/devices.h @@ -377,7 +377,8 @@ class device : private _device } fh_devices operator = (fh_devices n) {return d.devn_fh_devices = n;} inline void setfs (bool x) {dev_on_fs = x;} - inline bool isfs () const {return dev_on_fs || d.devn == FH_FS;} + inline bool isfs () const {return dev_on_fs || d.devn == FH_FS + || d.devn == FH_MQUEUE;} inline bool is_fs_special () const {return dev_on_fs && d.devn != FH_FS;} inline bool is_dev_resident () const {return lives_in_dev;} inline int exists () const {return exists_func (*this);} diff --git a/winsup/cygwin/local_includes/path.h b/winsup/cygwin/local_includes/path.h index 77e07eb658..6b7bc0ac1e 100644 --- a/winsup/cygwin/local_includes/path.h +++ b/winsup/cygwin/local_includes/path.h @@ -228,8 +228,7 @@ class path_conv /proc. */ int isspecial () const {return dev.not_device (FH_FS);} /* Devices with representation on disk. This includes local sockets, FIFOs, - message queues and devices created with mknod. It does not include - the /proc hierarchy. */ + devices created with mknod. It does not include the /proc hierarchy. */ int is_fs_special () const {return dev.is_fs_special ();} /* Like is_fs_special but excluding local sockets. */ int is_lnk_special () const {return is_fs_special () && !issocket ();} diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 66a4f485a0..38549eaaee 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1241,10 +1241,7 @@ path_conv::check (const char *src, unsigned opt, /* FIXME: bad hack alert!!! We need a better solution */ if (!strncmp (path_copy, MQ_PATH, MQ_LEN) && path_copy[MQ_LEN]) - { - dev.parse (FH_MQUEUE); - dev.setfs (1); - } + dev.parse (FH_MQUEUE); } if (opt & PC_NOFULL) diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc index 2650c35aca..c188b0ce21 100644 --- a/winsup/cygwin/posix_ipc.cc +++ b/winsup/cygwin/posix_ipc.cc @@ -224,7 +224,7 @@ mq_getattr (mqd_t mqd, struct mq_attr *mqstat) { int ret = -1; - cygheap_fdget fd ((int) mqd, true); + cygheap_fdget fd ((int) mqd); if (fd >= 0) { fhandler_mqueue *fh = fd->is_mqueue (); @@ -241,7 +241,7 @@ mq_setattr (mqd_t mqd, const struct mq_attr *mqstat, struct mq_attr *omqstat) { int ret = -1; - cygheap_fdget fd ((int) mqd, true); + cygheap_fdget fd ((int) mqd); if (fd >= 0) { fhandler_mqueue *fh = fd->is_mqueue (); @@ -258,7 +258,7 @@ mq_notify (mqd_t mqd, const struct sigevent *notification) { int ret = -1; - cygheap_fdget fd ((int) mqd, true); + cygheap_fdget fd ((int) mqd); if (fd >= 0) { fhandler_mqueue *fh = fd->is_mqueue (); @@ -276,7 +276,7 @@ mq_timedsend (mqd_t mqd, const char *ptr, size_t len, unsigned int prio, { int ret = -1; - cygheap_fdget fd ((int) mqd, true); + cygheap_fdget fd ((int) mqd); if (fd >= 0) { fhandler_mqueue *fh = fd->is_mqueue (); @@ -300,7 +300,7 @@ mq_timedreceive (mqd_t mqd, char *ptr, size_t maxlen, unsigned int *priop, { int ret = -1; - cygheap_fdget fd ((int) mqd, true); + cygheap_fdget fd ((int) mqd); if (fd >= 0) { fhandler_mqueue *fh = fd->is_mqueue (); diff --git a/winsup/cygwin/release/3.5.7 b/winsup/cygwin/release/3.5.7 new file mode 100644 index 0000000000..87baa3ada5 --- /dev/null +++ b/winsup/cygwin/release/3.5.7 @@ -0,0 +1,9 @@ +Fixes: +------ + +- Fix stat() on message queues. + Addresses: https://cygwin.com/pipermail/cygwin/2025-January/257186.html + +- Avoid deadlocks when calling message queue functions from different threads + in the same process. + Addresses: https://cygwin.com/pipermail/cygwin/2025-January/257120.html