syscall.sh / x32 / dup2

dup2

duplicate a file descriptor

sys_dup2(unsigned int oldfd, unsigned int newfd)
number1073741857 (0x40000021)
abicommon
entry pointsys_dup2
sinceLinux 3.4
man pagedup2(2)
sourceelixir.bootlin.com

Registers

registervalue
rax1073741857, the syscall number
rdiunsigned int oldfd
rsiunsigned int newfd
raxthe return value

Then run syscall to enter the kernel.

Same syscall on other architectures

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