ioctl crash in mpg123

JonY 10walls@gmail.com
Fri May 2 11:16:00 GMT 2014


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);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140502/a0d880ce/attachment.sig>


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /