Codebase list alsa-lib / d6d5982
pcm: add SND_PCM_EINTR open mode Add possibility to return -EINTR instead waiting for the event. The applications may want to handle -EINTR condition themselves. BugLink: https://github.com/alsa-project/alsa-lib/issues/228 Signed-off-by: Jaroslav Kysela <perex@perex.cz> Jaroslav Kysela 11 months ago
2 changed file(s) with 3 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
392392 #define SND_PCM_NONBLOCK 0x00000001
393393 /** Async notification (flag for open mode) \hideinitializer */
394394 #define SND_PCM_ASYNC 0x00000002
395 /** Return EINTR instead blocking (wait operation) */
396 #define SND_PCM_EINTR 0x00000080
395397 /** In an abort state (internal, not allowed for open) */
396398 #define SND_PCM_ABORT 0x00008000
397399 /** Disable automatic (but not forced!) rate resamplinig */
29372937 err_poll = poll(pfd, npfds, timeout);
29382938 __snd_pcm_lock(pcm->fast_op_arg);
29392939 if (err_poll < 0) {
2940 if (errno == EINTR && !PCMINABORT(pcm))
2940 if (errno == EINTR && !PCMINABORT(pcm) && !(pcm->mode & SND_PCM_EINTR))
29412941 continue;
29422942 return -errno;
29432943 }