rv = DosQueryFHState((HFILE)fd->secret->md.osfd, &flags); if (rv != 0) { PR_SetError(PR_UNKNOWN_ERROR, _MD_ERRNO()); return PR_FAILURE;
if (inheritable) flags &= ~OPEN_FLAGS_NOINHERIT; else flags |= OPEN_FLAGS_NOINHERIT;   flags &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT); rc = DosSetFHState((HFILE)fd->secret->md.osfd, flags); if (rc != NO_ERROR) { PR_SetError(PR_UNKNOWN_ERROR, _MD_ERRNO()); return PR_FAILURE; } break;  case PR_DESC_LAYERED:  PR_SetError(PR_UNKNOWN_ERROR, 87 ); return PR_FAILURE;  case PR_DESC_SOCKET_TCP: case PR_DESC_SOCKET_UDP:  break;
_PR_MD_SET_FD_INHERITABLE(PRFileDesc *fd, PRBool inheritable){    int rv = 0;    ULONG flags;    rv = DosQueryFHState((HFILE)fd->secret->md.osfd, &flags);    if (rv != 0) {        PR_SetError(PR_UNKNOWN_ERROR, _MD_ERRNO());        return PR_FAILURE;    }    if (inheritable)      flags &= ~OPEN_FLAGS_NOINHERIT;    else      flags |= OPEN_FLAGS_NOINHERIT;    rv = DosSetFHState((HFILE)fd->secret->md.osfd, flags);    if (rv != 0) {        PR_SetError(PR_UNKNOWN_ERROR, _MD_ERRNO());        return PR_FAILURE;    }    return PR_SUCCESS;}