FreeBSD Bugzilla – Attachment 88708 Details for
Bug 125542
audio/oss does not return propper SNDCTL_DSP_GETBLKSIZE size
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
getblksize.c
getblksize.c (text/plain; charset="iso-8859-1"), 808 bytes, created by
Jung-uk Kim
on 2008-07-15 17:42:50 UTC
(
hide
)
Description:
getblksize.c
Filename:
MIME Type:
Creator:
Jung-uk Kim
Created:
2008-07-15 17:42:50 UTC
Size:
808 bytes
patch
obsolete
>#include <err.h> >#include <fcntl.h> >#include <stdio.h> >#include <unistd.h> > >#include <sys/ioctl.h> > >#ifdef HAVE_OSS_SOUNDCARD_H >#include "soundcard.h" >#else >#include <sys/soundcard.h> >#endif > >#define PATH_DSP_DEVICE "/dev/dsp" > >static int >getblksize(unsigned long req) >{ > int fd, size; > > if ((fd = open(PATH_DSP_DEVICE, O_RDONLY)) < 0) > err(1, "open(\"" PATH_DSP_DEVICE "\", O_RDONLY)"); > if (ioctl(fd, req, &size) < 0) { > close(fd); > err(1, PATH_DSP_DEVICE ": SNDCTL_DSP_GETBLKSIZE(0x%lx)", req); > } > close(fd); > > return (size); >} > >int >main(void) >{ > unsigned long req; > > /* OSS API v4.0 */ > req = SNDCTL_DSP_GETBLKSIZE | IOC_IN; > printf("OSS API(0x%lx):\t%d\n", req, getblksize(req)); > > /* FreeBSD */ > req = SNDCTL_DSP_GETBLKSIZE; > printf("FreeBSD(0x%lx):\t%d\n", req, getblksize(req)); > > return (0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 125542
:
88707
| 88708