Skip to content

Commit

Permalink
fix(uring): define __NR_io_uring if they are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Codesire-Deng committed Nov 22, 2023
1 parent 4a52766 commit e5e4b26
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions include/uring/syscall.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,42 @@
#include <sys/syscall.h>
#include <unistd.h>

#ifdef __alpha__
/*
* alpha and mips are the exceptions, all other architectures have
* common numbers for new system calls.
*/
#ifndef __NR_io_uring_setup
#define __NR_io_uring_setup 535
#endif
#ifndef __NR_io_uring_enter
#define __NR_io_uring_enter 536
#endif
#ifndef __NR_io_uring_register
#define __NR_io_uring_register 537
#endif
#elif defined __mips__
#ifndef __NR_io_uring_setup
#define __NR_io_uring_setup (__NR_Linux + 425)
#endif
#ifndef __NR_io_uring_enter
#define __NR_io_uring_enter (__NR_Linux + 426)
#endif
#ifndef __NR_io_uring_register
#define __NR_io_uring_register (__NR_Linux + 427)
#endif
#else /* !__alpha__ and !__mips__ */
#ifndef __NR_io_uring_setup
#define __NR_io_uring_setup 425
#endif
#ifndef __NR_io_uring_enter
#define __NR_io_uring_enter 426
#endif
#ifndef __NR_io_uring_register
#define __NR_io_uring_register 427
#endif
#endif

/*
* Don't put this below the #include "arch/$arch/syscall.h", that
* file may need it.
Expand Down

0 comments on commit e5e4b26

Please sign in to comment.