This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 02/17] Refactor Linux ipc_priv header
- From: Arnd Bergmann <arnd at arndb dot de>
- To: libc-alpha at sourceware dot org
- Cc: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Date: Mon, 12 Dec 2016 13:47:02 +0100
- Subject: Re: [PATCH 02/17] Refactor Linux ipc_priv header
- Authentication-results: sourceware.org; auth=none
- References: <1481545990-7247-1-git-send-email-adhemerval.zanella@linaro.org> <1481545990-7247-3-git-send-email-adhemerval.zanella@linaro.org>
On Monday, December 12, 2016 10:32:55 AM CET Adhemerval Zanella wrote:
> Since current IPC_64 default now on kernel is 0x100, some architectures
> require it to 0 (for instance x86_64) while others continue to use a
> non zero default regardless (powerpc).
I find the explanation is a bit confusing, it's not that the kernel
requires IPC_64 to be 0x100, it's that some architectures support
the the old-style IPC and require IPC_64 to be passed, while new
architectures should default to the new version.
> index 0000000..1a31396
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/aarch64/ipc_priv.h
...
> +
> +#include <sys/ipc.h> /* For __key_t */
> +
> +#define __IPC_64 0x0
> +
> +struct __old_ipc_perm
> +{
> + __key_t __key; /* Key. */
> + unsigned int uid; /* Owner's user ID. */
> + unsigned int gid; /* Owner's group ID. */
> + unsigned int cuid; /* Creator's user ID. */
> + unsigned int cgid; /* Creator's group ID. */
> + unsigned int mode; /* Read/write permission. */
> + unsigned short int __seq; /* Sequence number. */
> +};
I don't understand this part at all: the #define line first says
that the old IPC is not supported, but then you define the structure
anyway?
What is the structure actually used for in glibc? My interpretation
is that it's only needed to implement the SHLIB_COMPAT version
of the library calls that don't exist on ARM64 either.
Arnd