Commit graph

5 commits

Author SHA1 Message Date
Jaroslav Kysela
ad5a1c0c88 axfer: fix the verbose compilation warnings for latest gcc
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-08-30 12:35:57 +02:00
Takashi Sakamoto
1c17128410 axfer: fix to return error code when a call of select(2) fails
A call of select(2) returns negative code and report errors via errno
local variable, howver current waiter implementation for select(2)
returns the negative code instead of errno.

This commit fixes it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-10-30 13:13:22 +01:00
Takashi Sakamoto
178a1f187c axfer: return the number of file descriptors for I/O events from select(2) waiter
A call of select(2) returns error code at failure, the number of file
descriptors available I/O at success. Current implementation of
waiter abstraction for select(2) returns 0 at success and callers
can't get the number.

This commit fixes it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2019-10-30 13:13:22 +01:00
Takashi Sakamoto
257be19c47 axfer: allow to be compiled with glibc-2.11 or former
The program, axfer, was developed in userspace with glibc-2.28. This
userspace is mostly compliant to POSIX:2008 and some additional macros
for poll event are officially available. The glibc supports them as a
default since its v2.12 release. It will be failed to be compiled with
old glibc or the other libraries for C standard APIs.

One of the purpose of axfer is an better alternative of aplay. In a
point of the purpose, it's preferable to be compiled with the old
libraries.

This commit adds conditional macros to be compiled with libraries for
old compliance level of POSIX.

Reported-by: Jay Foster <jay@systech.com>
Fixes: fce16d9279 ('axfer: add an implementation of waiter for select(2)')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-01-29 16:45:51 +01:00
Takashi Sakamoto
fce16d9279 axfer: add an implementation of waiter for select(2)
This commit adds support of waiter for select(2) system call.

Below lines are examples to use this option:
$ axfer transfer --waiter-type=select -M -P -d 2 -D hw:0,3 /dev/urandom -f dat -vvv
$ axfer transfer --waiter-type=select -M -C -d 2 -D hw:1,0 /dev/null -r 48000 -vvv

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-13 12:04:50 +01:00