Mark sockets on creation (socket()) and accept4().

Remove the separate syscall for accept() and implement it as accept4(..., 0).

Change-Id: Ib0b8f5d7c5013b91eae6bbc3847852eb355c7714
This commit is contained in:
Sreeram Ramachandran
2014-05-19 13:39:57 -07:00
parent 172ab0f650
commit 903b78873a
26 changed files with 93 additions and 164 deletions

View File

@@ -22,8 +22,9 @@
#define __socketcall
#endif
extern "C" __socketcall int __accept(int, sockaddr*, socklen_t*);
extern "C" __socketcall int __accept4(int, sockaddr*, socklen_t*, int);
extern "C" __socketcall int __connect(int, const sockaddr*, socklen_t);
extern "C" __socketcall int __socket(int, int, int);
static unsigned fallBackNetIdForResolv(unsigned netId) {
return netId;
@@ -32,7 +33,8 @@ static unsigned fallBackNetIdForResolv(unsigned netId) {
// This structure is modified only at startup (when libc.so is loaded) and never
// afterwards, so it's okay that it's read later at runtime without a lock.
__LIBC_HIDDEN__ NetdClientDispatch __netdClientDispatch __attribute__((aligned(32))) = {
__accept,
__accept4,
__connect,
__socket,
fallBackNetIdForResolv,
};