PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) { if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) { return phpdbg_consume_bytes(sock, ptr, len, tmo); } return read(sock, ptr, len); }
VOID SigIoWatcherThread(VOID *p) { zend_uchar sig; struct win32_sigio_watcher_data *swd = (struct win32_sigio_watcher_data *)p; top: (void)phpdbg_consume_bytes(swd->fd, &sig, 1, -1); if (3 == sig) { /* XXX completely not sure it is done right here */ if (*swd->flags & PHPDBG_IS_INTERACTIVE) { if (raise(sig)) { goto top; } } if (*swd->flags & PHPDBG_IS_SIGNALED) { phpdbg_set_sigsafe_mem(&sig); zend_try { phpdbg_force_interruption(); } zend_end_try(); phpdbg_clear_sigsafe_mem(); goto end; } if (!(*swd->flags & PHPDBG_IS_INTERACTIVE)) { *swd->flags |= PHPDBG_IS_SIGNALED; } end: /* XXX set signaled flag to the caller thread, question is - whether it's needed */ ExitThread(sig); } else {
PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) { int ret; if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) { return phpdbg_consume_bytes(sock, ptr, len, tmo); } do { ret = read(sock, ptr, len); } while (ret == -1 && errno == EINTR); return ret; }