From: hollis@andrew.cmu.edu
To: linuxppc-dev@lists.linuxppc.org
Subject: trouble with open()
Date: Sun, 03 Oct 1999 12:24:54 -0400 [thread overview]
Message-ID: <37F78356.5D7C54DF@andrew.cmu.edu> (raw)
Ok, maybe I'm just being really stupid, but the following code isn't
working for me.
I'm trying to open /dev/dsp. The file descriptor returned by open is 0,
which is supposed to be stdin, right? Anyways, a subsequent call to
ioctl doesn't like fd 0 either.
[dev->path = "/dev/dsp"]
printf("attmpting to open %s\n", dev->path);
if (dev->dev_fd = open(dev->path, O_RDWR) < 0) {
perror(dev->path);
fprintf(stderr, "Couldn't open audio device %s!\n", dev->path);
return -1;
}
printf("dev_fd = %i\n", dev->dev_fd);
When I run this code, my output is:
attempting to open /dev/dsp
dev_fd = 0
The permissions are set fine, and I get the same problem with
/dev/audio.
What am I doing wrong? I ask because I'm a little frustrated at this
point.
-Hollis
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next reply other threads:[~1999-10-03 16:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-10-03 16:24 hollis [this message]
1999-10-03 16:46 ` trouble with open() Daniel Jacobowitz
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=37F78356.5D7C54DF@andrew.cmu.edu \
--to=hollis@andrew.cmu.edu \
--cc=linuxppc-dev@lists.linuxppc.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.