在bionic libc(android)

时间:2017-05-16 21:59:38

标签: android linux system-calls libc bionic

我正在经历仿生libc套接字系统调用,并注意到一些令人困惑的事情。 android / bionic / libc / include / sys / socket.h有一个sendmsg的系统调用声明

__ socketcall int sendmsg(int,const struct msghdr *,int);

在其他地方/android/bionic/libc/SYSCALLS.TXT中,#sockets中的sendmsg和x86的#sockets的系统调用声明

int sendmsg(int,const struct msghdr *,unsigned int)arm,arm64,mips,mips64,x86_64

int sendmsg:socketcall:16(int,const struct msghdr *,unsigned int)x86

为什么flags数据类型的声明发生了变化(socket.h中的int和SYSCALLS.TXT中的unsigned int)。即使在kernel / net / socket.c中的内核系统调用中,系统调用也被定义为

SYSCALL_DEFINE3(sendmsg,int,fd,struct user_msghdr __user *,msg,unsigned int,flags){ }

该标志声明为unsigned int。只有在libc的include / sys / socket.h中,标志才是int。你能解释一下为什么会这样吗?如果我将声明更改为' unsigned int'将会发生什么?在socket.h中

0 个答案:

没有答案