All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/5] include: Add declaration of struct ipc64_perm
Date: Thu, 21 May 2020 16:17:33 +0530	[thread overview]
Message-ID: <5a10d33509ac73c26b233ab72c579f44386d0a55.1590057824.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1590057824.git.viresh.kumar@linaro.org>

This adds declaration of struct ipc64_perm, which will be used by
following patches.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 configure.ac     |  1 +
 include/ipcbuf.h | 45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 include/ipcbuf.h

diff --git a/configure.ac b/configure.ac
index 1d3ea58d0082..eaf33dd60350 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,6 +150,7 @@ AC_CHECK_TYPES([struct file_dedupe_range],,,[#include <linux/fs.h>])
 AC_CHECK_TYPES([struct fs_quota_statv],,,[#include <xfs/xqm.h>])
 AC_CHECK_TYPES([struct if_nextdqblk],,,[#include <linux/quota.h>])
 AC_CHECK_TYPES([struct iovec],,,[#include <sys/uio.h>])
+AC_CHECK_TYPES([struct ipc64_perm],,,[#include <sys/ipcbuf.h>])
 
 AC_CHECK_TYPES([struct mmsghdr],,,[
 #define _GNU_SOURCE
diff --git a/include/ipcbuf.h b/include/ipcbuf.h
new file mode 100644
index 000000000000..85162296ab44
--- /dev/null
+++ b/include/ipcbuf.h
@@ -0,0 +1,45 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2020 Linaro Limited. All rights reserved.
+ * Author: Viresh Kumar <viresh.kumar@linaro.org>
+ */
+
+#ifndef IPCBUF_H
+#define IPCBUF_H
+
+#include <linux/posix_types.h>
+
+#ifndef HAVE_IPC64_PERM
+
+/*
+ * The generic ipc64_perm structure:
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * ipc64_perm was originally meant to be architecture specific, but
+ * everyone just ended up making identical copies without specific
+ * optimizations, so we may just as well all use the same one.
+ *
+ * Pad space is left for:
+ * - 32-bit mode_t on architectures that only had 16 bit
+ * - 32-bit seq
+ * - 2 miscellaneous 32-bit values
+ */
+
+struct ipc64_perm {
+	__kernel_key_t		key;
+	__kernel_uid32_t	uid;
+	__kernel_gid32_t	gid;
+	__kernel_uid32_t	cuid;
+	__kernel_gid32_t	cgid;
+	__kernel_mode_t		mode;
+				/* pad if mode_t is u16: */
+	unsigned char		__pad1[4 - sizeof(__kernel_mode_t)];
+	unsigned short		seq;
+	unsigned short		__pad2;
+	__kernel_ulong_t	__unused1;
+	__kernel_ulong_t	__unused2;
+};
+#endif
+
+#endif /* IPCBUF_H */
-- 
2.25.0.rc1.19.g042ed3e048af


  parent reply	other threads:[~2020-05-21 10:47 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 10:47 [LTP] [PATCH 0/5] syscalls: Add tests to verify the _time_high fields Viresh Kumar
2020-05-21 10:47 ` [LTP] [PATCH 1/5] syscalls:ipc: Move libraries to libs/ director Viresh Kumar
2020-05-22 12:39   ` Cyril Hrubis
2020-05-26  3:08     ` Viresh Kumar
2020-05-29  5:39       ` Yang Xu
2020-06-15 12:20       ` Cyril Hrubis
2020-05-21 10:47 ` Viresh Kumar [this message]
2020-05-21 13:11   ` [LTP] [PATCH 2/5] include: Add declaration of struct ipc64_perm Arnd Bergmann
2020-05-22  7:10     ` Viresh Kumar
2020-05-22  7:16   ` [LTP] [PATCH V2 " Viresh Kumar
2020-06-15 12:43     ` Cyril Hrubis
2020-06-16  6:41       ` Viresh Kumar
2020-06-16  9:53         ` Cyril Hrubis
2020-06-16 18:56   ` [LTP] [PATCH " Petr Vorel
2020-05-21 10:47 ` [LTP] [PATCH 3/5] syscalls: semctl: Add new test to verify the _time_high fields Viresh Kumar
2020-05-21 13:20   ` Arnd Bergmann
2020-05-21 14:26     ` Cyril Hrubis
2020-05-22  7:12       ` Viresh Kumar
2020-05-22  7:16   ` [LTP] [PATCH V2 " Viresh Kumar
2020-06-15 13:31     ` Cyril Hrubis
2020-06-16  6:40       ` Viresh Kumar
2020-06-16  9:52         ` Cyril Hrubis
2020-06-16 10:09           ` Viresh Kumar
2020-06-16 12:41             ` Cyril Hrubis
2020-05-21 10:47 ` [LTP] [PATCH 4/5] syscalls: shmctl: " Viresh Kumar
2020-06-15 13:33   ` Cyril Hrubis
2020-05-21 10:47 ` [LTP] [PATCH 5/5] syscalls: msgctl: " Viresh Kumar
2020-06-15 13:38   ` Cyril Hrubis
2020-05-21 13:08 ` [LTP] [PATCH 0/5] syscalls: Add tests " Arnd Bergmann
2020-05-21 14:25   ` Cyril Hrubis
2020-05-21 14:29     ` Cyril Hrubis
2020-05-22  9:08     ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5a10d33509ac73c26b233ab72c579f44386d0a55.1590057824.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.