syscall.sh / sh / dup3

dup3

duplicate a file descriptor

sys_dup3(unsigned int oldfd, unsigned int newfd, int flags)
number330 (0x14a)
abicommon
entry pointsys_dup3
sinceLinux 5.0
man pagedup3(2)
sourceelixir.bootlin.com

Registers

registervalue
r3330, the syscall number
r4unsigned int oldfd
r5unsigned int newfd
r6int flags
r0the return value

Then run trapa #31 to enter the kernel.

Same syscall on other architectures

Get this as JSON: https://api.syscall.sh/v2/syscalls/sh/dup3