|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Returns operating-system file handle associated with existing low-level file descriptor.
The _get_osfhandle function returns an operating-system file handle if fd (the low-level file descriptor) is in range and is internally marked as free. Otherwise, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, this function returns INVALID_HANDLE_VALUE (–1) and sets errno to EBADF, indicating an invalid file handle.
For more compatibility information, see Compatibility in the Introduction.
Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.