1 #ifndef _STRACE_TESTS_ACCEPT_COMPAT_H_
2 #define _STRACE_TESTS_ACCEPT_COMPAT_H_
3 
4 #include <unistd.h>
5 #include <sys/socket.h>
6 #include <asm/unistd.h>
7 
8 #if defined __NR_socketcall && defined __sparc__
9 /*
10  * Work around the fact that
11  * - glibc >= 2.26 uses accept4 syscall to implement accept() call on sparc;
12  * - accept syscall had not been wired up on sparc until v4.4-rc8~4^2~1.
13  */
14 static inline int
15 do_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
16 {
17 	const long args[] = { sockfd, (long) addr, (long) addrlen };
18 
19 	return syscall(__NR_socketcall, 5, args);
20 }
21 #else
22 # define do_accept accept
23 #endif
24 
25 #endif /* !_STRACE_TESTS_ACCEPT_COMPAT_H_ */
26