Hi, I am debugging a crash in Cygwin 1.7.29-2 ioctl but I am not familiar with the OSS sounds API. I traced the ioctl calls and made this example, is it supposed to work?
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>
int main(){
int fmt = AFMT_MU_LAW;
int chan = 0;
int fd = open("/dev/dsp", O_WRONLY);
ioctl(fd, SNDCTL_DSP_RESET, NULL);
ioctl(fd, SNDCTL_DSP_RESET, NULL);
ioctl(fd, SNDCTL_DSP_RESET, NULL);
ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
ioctl(fd, SNDCTL_DSP_STEREO, &chan); /* crashes here */
close(fd);
exit(0);
}
signature.asc
Description: OpenPGP digital signature

