How can I initialize sigset_t or other variables used as “out parameters” in Rust?

前端 未结 2 967
南笙
南笙 2020-12-11 10:49

I\'m trying to learn more about FFI in Rust and linking with C libraries, specifically libc. While on my "quest", I came across the following problem.

2条回答
  •  庸人自扰
    2020-12-11 11:29

    How about using mem::zeroed? The docs even say:

    This is useful for FFI functions sometimes, but should generally be avoided.

提交回复
热议问题