if (_PR_PENDING_INTERRUPT(me)) { me->flags &= ~_PR_INTERRUPT; PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0); return -1; } if (_PR_IO_PENDING(me)) { PR_SetError(PR_IO_PENDING_ERROR, 0); return -1; }  if (sd->secret->nonblocking) { PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); return -1; } #if defined(WINNT) rv = _PR_MD_SENDFILE(sd, sfd, flags, timeout); if ((rv >= 0) && (flags == PR_TRANSMITFILE_CLOSE_SOCKET)) {  PR_FreeFileDesc(sd); } #else #if defined(XP_UNIX) rv = _PR_UnixSendFile(sd, sfd, flags, timeout); #else	 rv = _PR_EmulateSendFile(sd, sfd, flags, timeout); #endif	 #endif	  return rv;
if (!_pr_initialized) _PR_ImplicitInitialization(); fd = PR_AllocFileDesc(osfd, PR_GetTCPMethods()); if (fd != NULL) _PR_MD_MAKE_NONBLOCK(fd); else _PR_MD_CLOSE_SOCKET(osfd); return(fd);
PR_IMPLEMENT(PRInt32) PR_SendFile(    PRFileDesc *sd, PRSendFileData *sfd,    PRTransmitFileFlags flags, PRIntervalTime timeout){	PRInt32 rv;	PRThread *me = _PR_MD_CURRENT_THREAD();	if (_PR_PENDING_INTERRUPT(me)) {		me->flags &= ~_PR_INTERRUPT;		PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0);		return -1;	}	if (_PR_IO_PENDING(me)) {		PR_SetError(PR_IO_PENDING_ERROR, 0);		return -1;	}	/* The socket must be in blocking mode. */	if (sd->secret->nonblocking) {		PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);		return -1;	}#if defined(WINNT)	rv = _PR_MD_SENDFILE(sd, sfd, flags, timeout);	if ((rv >= 0) && (flags == PR_TRANSMITFILE_CLOSE_SOCKET)) {		/*		 * This should be kept the same as SocketClose, except		 * that _PR_MD_CLOSE_SOCKET(sd->secret->md.osfd) should		 * not be called because the socket will be recycled.		 */		PR_FreeFileDesc(sd);	}#else#if defined(XP_UNIX)	rv = _PR_UnixSendFile(sd, sfd, flags, timeout);#else	/* XP_UNIX */	rv = _PR_EmulateSendFile(sd, sfd, flags, timeout);#endif	/* XP_UNIX */#endif	/* WINNT */	return rv;}