2 Dec
2011
2 Dec
'11
8:12 a.m.
At Fri, 02 Dec 2011 12:24:41 +0530, Vinod Koul wrote:
Hi Takashi,
For alsa pcm we have two ways to write data, either we use write() system call or use ioctl SNDRV_PCM_IOCTL_WRITEI_FRAMES.
Is there any specific reason why we have two methods and which one is preferred and why?
Well, I only remember vaguely. IIRC, ioctl is used since it can pass the error code more directly without using errno. Maybe Jaroslav knows more exact reason.
But, honestly speaking, I don't like this implementation. For a new interface, I'd suggest to stick with the normal read/write. Otherwise you'll get a mess of 32bit compat layer again.
Takashi