Source

pecl-event / classes / event_util.c

Diff from to

File classes/event_util.c

 }
 /* }}} */
 
+/* {{{ proto bool EventUtil::getSocketFd(mixed socket)
+ *    Gets numeric file descriptor of a socket. */
+PHP_METHOD(EventUtil, getSocketFd) {
+	zval **ppzfd = NULL;
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z",
+				&ppzfd) == FAILURE) {
+		return;
+	}
+
+	RETVAL_LONG(ppzfd ? php_event_zval_to_fd(ppzfd TSRMLS_CC) : -1);
+}
+/* }}} */
+
 /*
  * Local variables:
  * tab-width: 4