Hi, I am trying to build FFmpeg 7.0 with wasi-sdk and unfortunate it failed due to an error saying call to undeclared function 'dup'
. I understand from https://github.com/WebAssembly/wasi-libc/issues/459 that dup
is currently not supported in wasi-libc.
May I know if there are plans to implement support for this syscall, or what are the reasons for not supporting it? I would like to help implement if it is doable.
Thanks.
wasip1 doesn't have any api equivalent to dup and it is unlikely that it will see new api's added. As for wasip2, there is no api for it either, but given that there is no direct correspondence between resource numbers and fd's anymore, I guess it would be possible for wasi-libc to emulate multiple fd's pointing to the same fd once wasi-libc natively implements wasip2 (currently it is implemented using an adapter from wasip1 to wasip2)
Thanks for the response. Out of curiosity, does this mean that dup
might not be supported by wasi-libc in the near future? If so, are there any alternative solutions for compiling codebases that use dup
?
Also, may I know where can I find information about configuring clang in the wasi-sdk to use wasip2 instead of wasi-libc?
Thank you very much for your help.
Last updated: Apr 08 2025 at 21:03 UTC