src/ae_evport.cc
/*
 * Helper function to invoke port_associate for the given fd and mask.
 */
Helper function to invoke port_associate for the given fd and mask.
Helper function to invoke port_associate for the given fd and mask .
static int aeApiAssociate(const char *where, int portfd, int fd, int mask) {
  int events = 0;
  int rv, err;
  if (mask & AE_READABLE)
    events |= POLLIN;
  if (mask & AE_WRITABLE)
    events |= POLLOUT;
  if (evport_debug)
    fprintf(stderr, "%s: port_associate(%d, 0x%x) = ", where, fd, events);
  rv = port_associate(portfd, PORT_SOURCE_FD, fd, events,
                      (void *) (uintptr_t) mask);
  err = errno;
  if (evport_debug)
    fprintf(stderr, "%d (%s)\n", rv, rv == 0 ? "no error" : strerror(err));
  if (rv == -1) {
    fprintf(stderr, "%s: port_associate: %s\n", where, strerror(err));
    if (err == EAGAIN)
      fprintf(stderr, "aeApiAssociate: event port limit exceeded.");
  }
  return rv;
}
static int aeApiAssociate ( const char * where , int portfd , int fd , int mask ) { int events = 0 ; int rv , err ; if ( mask & AE_READABLE ) events |= POLLIN ; if ( mask & AE_WRITABLE ) events |= POLLOUT ; if ( evport_debug ) fprintf ( stderr , " " , where , fd , events ) ; rv = port_associate ( portfd , PORT_SOURCE_FD , fd , events , ( void * ) ( uintptr_t ) mask ) ; err = errno ; if ( evport_debug ) fprintf ( stderr , " \n " , rv , rv == 0 ? " " : strerror ( err ) ) ; if ( rv == -1 ) { fprintf ( stderr , " \n " , where , strerror ( err ) ) ; if ( err == EAGAIN ) fprintf ( stderr , " " ) ; } return rv ; }
Helper function to invoke port_associate for the given fd and mask.
Helper function to invoke port_associate for the given fd and mask .