ipc-perm.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* struct ipc_perm definition.
  2. Copyright (C) 2019-2021 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _SYS_IPC_H
  16. # error "Never use <bits/ipc-perm.h> directly; include <sys/ipc.h> instead."
  17. #endif
  18. /* Data structure used to pass permission information to IPC operations.
  19. It follows the kernel ipc64_perm size so the syscall can be made directly
  20. without temporary buffer copy. However, since glibc defines the MODE
  21. field as mode_t per POSIX definition (BZ#18231), it omits the __PAD1 field
  22. (since glibc does not export mode_t as 16-bit for any architecture). */
  23. struct ipc_perm
  24. {
  25. __key_t __key; /* Key. */
  26. __uid_t uid; /* Owner's user ID. */
  27. __gid_t gid; /* Owner's group ID. */
  28. __uid_t cuid; /* Creator's user ID. */
  29. __gid_t cgid; /* Creator's group ID. */
  30. __mode_t mode; /* Read/write permission. */
  31. unsigned short int __seq; /* Sequence number. */
  32. unsigned short int __pad2;
  33. __syscall_ulong_t __glibc_reserved1;
  34. __syscall_ulong_t __glibc_reserved2;
  35. };