Skip to content

Commit

Permalink
iox-eclipse-iceoryx#2072 Include mqueue.h needs sys/stat.h for mode_t…
Browse files Browse the repository at this point in the history
… (fixes musl compile)

As stated in the mq_open man page ([1]) the mqueue.h include needs
additional sys/stat.h include for mode_t definition.

Fixes musl compile:

  In file included from .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:17:
  .../build/iceoryx-custom/iceoryx_platform/linux/include/iceoryx_platform/mqueue.hpp:23:49: error: ‘mode_t’ has not been declared
     23 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr);
        |                                                 ^~~~~~
  .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:26:49: error: ‘mode_t’ has not been declared
     26 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr)
        |                                                 ^~~~~~

[1] https://man7.org/linux/man-pages/man3/mq_open.3.html

Signed-off-by: Peter Seiderer <[email protected]>
  • Loading branch information
pseiderer committed Nov 1, 2023
1 parent 8bc6075 commit 2aee8b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion iceoryx_platform/linux/include/iceoryx_platform/mqueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
#ifndef IOX_HOOFS_LINUX_PLATFORM_MQUEUE_HPP
#define IOX_HOOFS_LINUX_PLATFORM_MQUEUE_HPP

#include <sys/stat.h>
#include <mqueue.h>

mqd_t iox_mq_open2(const char* name, int oflag);
mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr);

#endif // IOX_HOOFS_LINUX_PLATFORM_MQUEUE_HPP
#endif // IOX_HOOFS_LINUX_PLATFORM_MQUEUE_HPP

0 comments on commit 2aee8b8

Please sign in to comment.