ipc.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /****************************************************************************
  2. * include/sys/ipc.h
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one or more
  5. * contributor license agreements. See the NOTICE file distributed with
  6. * this work for additional information regarding copyright ownership. The
  7. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance with the
  9. * License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. * License for the specific language governing permissions and limitations
  17. * under the License.
  18. *
  19. ****************************************************************************/
  20. #ifndef __INCLUDE_SYS_IPC_H
  21. #define __INCLUDE_SYS_IPC_H
  22. /****************************************************************************
  23. * Included Files
  24. ****************************************************************************/
  25. #include <nuttx/config.h>
  26. #include <sys/types.h>
  27. /****************************************************************************
  28. * Pre-processor Definitions
  29. ****************************************************************************/
  30. /* Mode bits: The lower order 9-bit bits are the standard mode bits */
  31. #define IPC_MODE 0x01ff /* Mode bit mask */
  32. #define IPC_CREAT (1 << 10) /* Create entry if key does not exist */
  33. #define IPC_EXCL (1 << 11) /* Fail if key exists */
  34. #define IPC_NOWAIT (1 << 12) /* Error if request must wait */
  35. /* Keys: */
  36. #define IPC_PRIVATE 0 /* Private key */
  37. /* Control commands: */
  38. #define IPC_RMID 0 /* Remove identifier */
  39. #define IPC_SET 1 /* Set options */
  40. #define IPC_STAT 2 /* Get options */
  41. /****************************************************************************
  42. * Public Type Definitions
  43. ****************************************************************************/
  44. /****************************************************************************
  45. * Public Data
  46. ****************************************************************************/
  47. #undef EXTERN
  48. #if defined(__cplusplus)
  49. #define EXTERN extern "C"
  50. extern "C"
  51. {
  52. #else
  53. #define EXTERN extern
  54. #endif
  55. /* The ipc_perm structure is used by three mechanisms for XSI interprocess
  56. * communication (IPC): messages, semaphores, and shared memory. All use a
  57. * common structure type, ipc_perm, to pass information used in determining
  58. * permission to perform an IPC operation.
  59. */
  60. struct ipc_perm
  61. {
  62. #if 0 /* User and group IDs not yet supported by NuttX */
  63. uid_t uid; /* Owner's user ID */
  64. gid_t gid; /* Owner's group ID */
  65. uid_t cuid; /* Creator's user ID */
  66. gid_t cgid; /* Creator's group ID */
  67. #endif
  68. mode_t mode; /* Read/write permission */
  69. };
  70. /****************************************************************************
  71. * Public Function Prototypes
  72. ****************************************************************************/
  73. key_t ftok(FAR const char *path, int id);
  74. #undef EXTERN
  75. #if defined(__cplusplus)
  76. }
  77. #endif
  78. #endif /* __INCLUDE_SYS_IPC_H */