[Fwd: Re: [PHP-DEV] [PATCH] DIO: Flow control, Modem info, Read waiting]
| From: | Alan Knowles | Date: | Fri, 04 Feb 2005 03:40:13 +0000 |
| Subject: | [Fwd: Re: [PHP-DEV] [PATCH] DIO: Flow control, Modem info, Read waiting] | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-1878@lists.php.net to get a copy of this message | ||
Anyone got objections to adding dio_read_waiting (Frank - does this need
#ifdeffing for win32?)
Greg: - can you file it as a bug,So It doesnt get forgotton.
http://pecl.php.net/bugs/report.php?package=dio
I'll try and do it next week if no-one else has said anything.
Regards
Alan
-------- Forwarded Message --------
From: Greg MacLellan <greg@gregmaclellan.com>
To: Alan Knowles <alan@akbkhome.com>
Subject: Re: [PHP-DEV] [PATCH] DIO: Flow control, Modem info, Read
waiting
Date: Thu, 03 Feb 2005 15:50:38 -0500
Just wanted to bring this up again. I'm mostly interested in getting
dio_read_waiting() incorperated. It should still apply againt 4.3.x,
I've never tried it against 5.
>> +
>> +/* {{{ proto array dio_read_waiting(resource fd)
>> + * Get number of bytes waiting to be read from file descriptor fd */
>> +PHP_FUNCTION(dio_read_waiting)
>> +{
>> + zval *r_fd;
>> + php_fd_t *f;
>> + int bytes;
>> +
>> + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd)
>> == FAILURE) {
>> + return;
>> + }
>> + ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
>> +
>> + if (ioctl(f->fd, TIOCINQ, &bytes) != 0) {
>> + php_error(E_WARNING, "%s(): cannot ioctl(TIOCINQ) %d: %s",
>> + get_active_function_name(TSRMLS_C), f->fd,
>> strerror(errno));
>> + RETURN_FALSE;
>> + }
>> +
>> + RETURN_LONG(bytes);
>> +}
>> +/* }}} */
>>
>> /*