[Previous] [Contents] [Next]

snd_ctl_file_descriptor()

Get control file descriptor

Synopsis:

#include <sys/asoundlib.h>

int snd_ctl_file_descriptor( snd_ctl_t * handle );

Library:

libasound.so

Description:

The snd_ctl_file_descriptor() function returns the file descriptor of the connection to the sound control interface. The file descriptor may be used for the poll() or select() functions (see man 2 poll or man 2 select for more details) for determining, if something can be read or write. Applications should call snd_ctl_read() if data is waiting to be read. Calling this function is highly recommended.

Returns:

The file descriptor of the connection to the sound control interface on success, or a negative value if an error occurs.

Errors:

-EINVAL
Invalid handle argument.

Examples:

See the example in Opening the mixer in the Controlling volume and balance chapter.

Classification:

ALSA

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

snd_ctl_read()


[Previous] [Contents] [Next]