Hi,
In message "Ioctl problem"
on 03/12/21, Phil Callihan <pcallihan / columbus.rr.com> writes:
|
|I'm trying to use Ruby IO:ioctl on /dev/mixer. It work with c but not
|with ruby. I sure it a dumb mistake, but I can see it. Below is a ruby
|program that fails and the c program that work. Thanks ahead of time.
|pc
You mean like this?
#! /usr/bin/env ruby
SOUND_MIXER_READ_DEVMASK = 0x80044dfe
mixer = File.open("/dev/mixer", "w+")
devmask = [0].pack("i")
mixer.ioctl(SOUND_MIXER_READ_DEVMASK, devmask)
printf "devmask[%08x]\n", *devmask.unpack("i")