[klibc] Add accept4(), handle fallback from accept() to accept4()

Add support for the accept4() system call.

Some architectures now have accept4() but not accept(), so introduce a
standard fallback.  However, since accept() is a socketcall, we have
to do some special hacks.

While we are at it, handle conditional socketcall stubs based on
their existence <linux/net.h>, analogous to <asm/unistd.h>.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
5 files changed