Bug 216568 - [pcm] SNDCTL_DSP_GETERROR always fails with -m32 on 64bit system
Summary: [pcm] SNDCTL_DSP_GETERROR always fails with -m32 on 64bit system
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-multimedia (Nobody)
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2017-01-29 07:32 UTC by Jan Beich
Modified: 2018-06-18 22:53 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2017-01-29 07:32:26 UTC
$ cat >a.c
#include <sys/soundcard.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <err.h>

int main()
{
    int fd = open("/dev/dsp", O_RDWR, 0);
    audio_errinfo ei;

    if (ioctl(fd, SNDCTL_DSP_GETERROR, &ei) < 0)
	err(1, "SNDCTL_DSP_GETERROR");

    return 0;
}

$ cc -o foo a.c
$ cc -m32 -o bar a.c
$ ./foo
$ ./bar
bar: SNDCTL_DSP_GETERROR: Invalid argument
Comment 1 Konstantin Belousov freebsd_committer freebsd_triage 2017-01-29 09:56:07 UTC
The issue is not limited to DSP_GETERROR only; the sys/dev/sound code lacks COMPAT32 shims at all. The task to add them is not technically complicated but requires patience and understanding what to test.