]> granicus.if.org Git - strace/commit
Support C libraries without System V shared memory/ipc
authorMike Frysinger <vapier@gentoo.org>
Sat, 31 Oct 2015 04:47:53 +0000 (00:47 -0400)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 26 Nov 2015 01:36:58 +0000 (01:36 +0000)
commitba10a421b85b7f622975f2e9f92249cfe3dcfcbd
treefe0d775ed17bb41025c6655878c375f175f0542d
parent3422849673890f9a183e616924731e4e40ea87eb
Support C libraries without System V shared memory/ipc

Some systems (like Bionic) omit support for SysV related code.  That
means no C library headers for strace to include.  Add configure tests
to probe the headers from the kernel and use them when they are
available.

It might make more sense to never rely on the C library's headers as
there is no guarantee or requirement that the structure layout between
apps and the C library match that what is passed to the kernel.

* configure.ac (AC_CHECK_HEADERS): Check for linux/ipc.h,
linux/mqueue.h, linux/msg.h, linux/sem.h, linux/shm.h,
sys/ipc.h, sys/msg.h, sys/sem.h, and sys/shm.h.
* ipc_defs.h: Include <sys/ipc.h> or <linux/ipc.h> depending
on what is available.
* ipc_msg.c: Replace <sys/ipc.h> with "ipc_defs.h".
Fallback to <linux/msg.h> when available.
* ipc_msgctl.c: Include <sys/msg.h>, <asm/msgbuf.h>, or <linux/msg.h>
based on what is available.  Note missing support for old ipc structs.
* ipc_sem.c: Include <sys/sem.h> or <linux/sem.h> depending
on what is available.  Only decode sembuf when available.
* ipc_shm.c: Fallback to <linux/shm.h> when available.
* ipc_shmctl.c: Include <sys/shm.h>, <asm/shmbuf.h>, or <linux/shm.h>
based on what is available.  Note missing support for old ipc structs.
* print_mq_attr.c: Fallback to <linux/mqueue.h> when available.
configure.ac
ipc_defs.h
ipc_msg.c
ipc_msgctl.c
ipc_sem.c
ipc_shm.c
ipc_shmctl.c
print_mq_attr.c