def writeToFD(fd, data):
 try:
  return os.write(fd, data)
 except (OSError, IOError) as io:
  if (io.errno in (errno.EAGAIN, errno.EINTR)):
   return 0
  return CONNECTION_LOST

def writeToFD ( fd , data ) : try : return os . write ( fd , data ) except ( OSError , IOError ) as io : if ( io . errno in ( errno . EAGAIN , errno . EINTR ) ) : return 0 return CONNECTION_LOST
write data to file descriptor .