You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/06/09 15:19:54 UTC

[incubator-nuttx] 01/02: sys/ipc: correct definition value of IPC_*

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 795884dbf1cbf584ea3455c634d8e289eb04d424
Author: chao.an <an...@xiaomi.com>
AuthorDate: Wed Jun 8 13:56:13 2022 +0800

    sys/ipc: correct definition value of IPC_*
    
    the definition of MSG_NOERROR and IPC_NOWAIT should not be aligned
    
    ------------------------------------------------------------------
    
    MSGOP(2)
    
    NAME
           msgrcv, msgsnd - System V message queue operations
    ...
    EXAMPLE
           The program below demonstrates the use of msgsnd() and msgrcv().
    ...
               if (msgrcv(qid, (void *) &msg, sizeof(msg.mtext), msgtype,
                          MSG_NOERROR | IPC_NOWAIT) == -1) {
    ...
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 include/sys/ipc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/sys/ipc.h b/include/sys/ipc.h
index 724654305b..6c6d3f953a 100644
--- a/include/sys/ipc.h
+++ b/include/sys/ipc.h
@@ -35,10 +35,10 @@
 
 /* Mode bits:  The lower order 9-bit bits are the standard mode bits */
 
-#define IPC_MODE    0x01ff     /* Mode bit mask */
-#define IPC_CREAT   (1 << 10)  /* Create entry if key does not exist */
-#define IPC_EXCL    (1 << 11)  /* Fail if key exists */
-#define IPC_NOWAIT  (1 << 12)  /* Error if request must wait */
+#define IPC_MODE   0x01ff /* Mode bit mask */
+#define IPC_CREAT  0x0200 /* Create key if key does not exist. */
+#define IPC_EXCL   0x0400 /* Fail if key exists.  */
+#define IPC_NOWAIT 0x0800 /* Return error on wait.  */
 
 /* Keys: */