mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-01 22:58:49 -04:00
Added snd_pcm_nonblock_mode...
This commit is contained in:
parent
85e2cde036
commit
8abf9370b5
2 changed files with 18 additions and 0 deletions
|
|
@ -159,6 +159,23 @@ int snd_pcm_file_descriptor(snd_pcm_t *pcm)
|
|||
return pcm->fd;
|
||||
}
|
||||
|
||||
int snd_pcm_nonblock_mode(snd_pcm_t *pcm, int nonblock)
|
||||
{
|
||||
long flags;
|
||||
|
||||
if (!pcm)
|
||||
return -EINVAL;
|
||||
if ((flags = fcntl(pcm->fd, F_GETFL)) < 0)
|
||||
return -errno;
|
||||
if (nonblock)
|
||||
flags |= O_NONBLOCK;
|
||||
else
|
||||
flags &= ~O_NONBLOCK;
|
||||
if (fcntl(pcm->fd, F_SETFL, flags) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
|
||||
{
|
||||
if (!pcm || !info)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue