Pipe 的写端文件描述符是int
但一些函数如Tcl_MakeFileChannel接受 void*
作为文件句柄。我需要将管道写端传递给它。如何将一种类型的文件句柄转换为另一种类型的文件句柄?
最佳答案
阅读 this reference似乎您只是传递了文件描述符:
Tcl_MakeFileChannel(reinterpret_cast<void*>(fd), ...);
您可能还想阅读 this thread .
关于c++ - 无法将管道的写端作为文件描述符传递,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16393642/