public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: JonY <10walls@gmail.com>
To: The Cygwin Mailing List <cygwin@cygwin.com>
Subject: ioctl crash in mpg123
Date: Fri, 02 May 2014 11:16:00 -0000	[thread overview]
Message-ID: <53637E89.2060404@gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2014-05-02 11:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-02 11:16 JonY [this message]
2014-05-02 15:15 ` Christopher Faylor
2014-05-03  0:14   ` JonY

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53637E89.2060404@gmail.com \
    --to=10walls@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).