Skip to content

Commit

Permalink
Add recvmmsg & sendmmsg syscall number for loongarch64 (#13097)
Browse files Browse the repository at this point in the history
Motivation:
Call correct recvmmsg and sendmmsg on loongarch64.

Modification:
Add #elif declarations to ensure we pick the correct syscall number for loongarch64.

Result:
Pick the correct syscall number depending on the system architecture.
  • Loading branch information
zhaixiaojuan committed Jan 9, 2023
1 parent e530cd6 commit d03f3ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions transport-native-epoll/src/main/c/netty_epoll_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ struct mmsghdr {
#elif defined(__i386__)
// See https://github.com/torvalds/linux/blob/v5.4/arch/x86/entry/syscalls/syscall_32.tbl
#define SYS_recvmmsg 337
#elif defined(__loongarch64)
// See https://github.com/torvalds/linux/blob/v6.1/include/uapi/asm-generic/unistd.h
#define SYS_recvmmsg 243
#else
#define SYS_recvmmsg -1
#endif
Expand All @@ -115,6 +118,9 @@ struct mmsghdr {
#elif defined(__i386__)
// See https://github.com/torvalds/linux/blob/v5.4/arch/x86/entry/syscalls/syscall_32.tbl
#define SYS_sendmmsg 345
#elif defined(__loongarch64)
// See https://github.com/torvalds/linux/blob/v6.1/include/uapi/asm-generic/unistd.h
#define SYS_sendmmsg 269
#else
#define SYS_sendmmsg -1
#endif
Expand Down

0 comments on commit d03f3ed

Please sign in to comment.