public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* ioctl crash in mpg123
@ 2014-05-02 11:16 JonY
  2014-05-02 15:15 ` Christopher Faylor
  0 siblings, 1 reply; 3+ messages in thread
From: JonY @ 2014-05-02 11:16 UTC (permalink / raw)
  To: The Cygwin Mailing List

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

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);
}


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 834 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-03  0:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-02 11:16 ioctl crash in mpg123 JonY
2014-05-02 15:15 ` Christopher Faylor
2014-05-03  0:14   ` JonY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).