Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* 2.0.30 + shmctl
@ 1997-05-28 21:24 Thomas Pornin
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Pornin @ 1997-05-28 21:24 UTC (permalink / raw)


Hello,

I have some problem using shared memory functions with a 2.0.30 kernel
on my UDB. This breaks X programs using shared memory extensions, namely
Quake (but not only). I have searched the mailinglist archive, but I have
not found many information; anyway, I came upon something I find rather
disturbing: a call to shmctl() with IPC_STAT as argument should fill
a struct shmid_ds, which contains a struct ipc_perm, declared this way
in /usr/include/linux/ipc.h :

struct ipc_perm
{
  key_t  key;
  ushort uid;   /* owner euid and egid */
  ushort gid;
  ushort cuid;  /* creator euid and egid */
  ushort cgid;
  ushort mode;  /* access modes see mode flags below */
  ushort seq;   /* sequence number */
};

But, in user land, it is declared this way (/usr/include/sys/ipc_buf.h):

struct ipc_perm
{
  key_t __key;                          /* key */
  __uid_t uid;                          /* owner's user ID */
  __gid_t gid;                          /* owner's group ID */
  __uid_t cuid;                         /* creator's user ID */
  __gid_t cgid;                         /* creator's group ID */
  __mode_t mode;                        /* read/write permission */
  unsigned short int __seq;             /* sequence number */
};

The main problem is that a ushort is two bytes long, and a __uid_t is
four bytes long. This is much disturbing; the kernel uses its definition
in the values it returns, but userland programs use the other one. This
breaks gdb (from RedHat 4.1), xquake (the 1.06 elf binary), and any
program using shmctl(), including all the X programs using XShmPutImage()
and similar functions.
My kernel is a clean 2.0.30 from ftp.kernel.org, no patch (and no
axp-diff patch).

What is the cure ? Recompiling a kernel with a patched definition of
ipc_perm ? Or does it exist a cleaner solution ?

Thanks in advance for any answer.

(please Cc: a copy to me <bip@orion.ens.fr> directly, because I seem to
be only randomly subscribed to the mailinglist)

	--Thomas Pornin

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread
[parent not found: <199705282124.XAA06124@orion.ens.fr>]

end of thread, other threads:[~1997-05-31  4:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-05-28 21:24 2.0.30 + shmctl Thomas Pornin
     [not found] <199705282124.XAA06124@orion.ens.fr>
1997-05-31  4:27 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox