/* This file is part of Lcrzo.
*/


#if defined LCRZODEF_SYSTEM_Unix
int lcrzo_priv_fd_block_get(int fd, 
		       lcrzo_bool *pbeblocking)
{ int fc;
  lcrzo_bool beblocking;

  fc=fcntl(fd, F_GETFL, 0);
  if (fc<0) return(LCRZO_ERR_FUFCNTL);
  if (fc&O_NONBLOCK)
  { beblocking=LCRZO_FALSE;
  }
  else
  { beblocking=LCRZO_TRUE;
  }

  if (pbeblocking!=NULL) *pbeblocking=beblocking;
  return(LCRZO_ERR_OK);
}

/*-------------------------------------------------------------*/
#elif defined LCRZODEF_SYSTEM_Windows
  /* this function is not needed */
#else
 #error "Unknown value for LCRZODEF_SYSTEM"
#endif

