编译ALSA时会需要用到几个Android没有的IPC。
bionic/libc/Android.mk
----------------------------------------------------------------------------------------------------------------------------
ifeq ($(TARGET_ARCH),x86)
libc_common_src_files += \
----------------------------------------------------------------------------------------------------------------------------
bionic/libc/arch-x86/syscalls.mk
----------------------------------------------------------------------------------------------------------------------------
syscall_src += arch-x86/syscalls/ipc.S
----------------------------------------------------------------------------------------------------------------------------
bionic/libc/include/sys/linux-syscalls.h
----------------------------------------------------------------------------------------------------------------------------
#define __NR_ipc (__NR_SYSCALL_BASE + 117)
----------------------------------------------------------------------------------------------------------------------------
bionic/libc/include/sys/linux-unistd.h
----------------------------------------------------------------------------------------------------------------------------
int ipc (unsigned int call, int first, int second, int third, void* ptr, long fifth);
----------------------------------------------------------------------------------------------------------------------------
bionic/libc/arch-x86/bionic/ipc_sysv.c
----------------------------------------------------------------------------------------------------------------------------
#include <stdarg.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <sys/msg.h>
#include <asm-generic/ipc.h>
extern int ipc (unsigned int call, int first, int second, int third, void* ptr, long fifth);
int semctl (int
{
}
int semget (key_t
{
}
int semop (int
{
}
void* shmat (int
{
}
int shmctl (int
{
}
int shmdt (const void*
{
}
int shmget (key_t
{
}
int msgctl (int
{
}
int msgget (key_t
{
}
int msgrcv (int
{
}
int msgsnd (int
{
}
----------------------------------------------------------------------------------------------------------------------------
bionic/libc/arch-x86/syscalls/ipc.S
----------------------------------------------------------------------------------------------------------------------------
#include <sys/linux-syscalls.h>
ipc:
1:
----------------------------------------------------------------------------------------------------------------------------
bionic/libc/include/sys/sem.h
----------------------------------------------------------------------------------------------------------------------------
#ifndef _SYS_SEM_H
#define _SYS_SEM_H
#include <sys/ipc.h>
#include <linux/sem.h>
__BEGIN_DECLS
extern int semctl (int __semid, int __semnum, int __cmd, ...);
extern int semget (key_t __key, int __nsems, int __semflg);
extern int semop (int __semid, struct sembuf *__sops, size_t __nsops);
__END_DECLS
#endif
----------------------------------------------------------------------------------------------------------------------------