Re: cvs: php-src / NEWS /ext/standard basic_functions.c basic_functions.h
| From: | Joe Orton | Date: | Wed, 12 Nov 2003 23:07:47 +0000 |
| Subject: | Re: cvs: php-src / NEWS /ext/standard basic_functions.c basic_functions.h | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-24510@lists.php.net to get a copy of this message | ||
On Wed, Nov 12, 2003 at 10:02:38PM -0000, Ilia Alshanetsky wrote:
> iliaa Wed Nov 12 17:02:38 2003 EDT
>
> Modified files:
> /php-src NEWS
> /php-src/ext/standard basic_functions.c basic_functions.h
> Log:
> Added nanosleep(), in addition to allowing setting of very short states.
> This function is signal safe.
nanosleep() does not exist on all Unixes at least, this will need an
autoconf check...
> +/* {{{ proto mixed nanosleep(long seconds, long nanoseconds)
> + Delay for a number of seconds and nano seconds */
> +PHP_FUNCTION(nanosleep)
> +{
> + long tv_sec, tv_nsec;
> + struct timespec php_req, php_rem;
> +
> + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &tv_sec,
> &tv_nsec)) {
> + WRONG_PARAM_COUNT;
> + }
> +
> + php_req.tv_sec = (time_t) tv_sec;
> + php_req.tv_nsec = tv_nsec;
> + if (!nanosleep(&php_req, &php_rem)) {
> + RETURN_TRUE;
> + } else if (errno == EINTR) {