From mboxrd@z Thu Jan 1 00:00:00 1970 From: mindentropy@gmail.com (mindentropy) Date: Mon, 2 May 2011 23:32:15 +0530 Subject: Clarification regarding design of a device. In-Reply-To: References: <201105022253.27438.mindentropy@gmail.com> Message-ID: <201105022332.15319.mindentropy@gmail.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Monday 02 May 2011 10:58:45 PM Mulyadi Santosa wrote: > > I am not keen regarding char/block device management, but I think you > should separate those streams. > > How? Well, same thing like you open a same file twice, right? You're > given two different file descriptor. After all, the "open", "read" and > "write" handler of device IMHO always assume that we wanna achieve > such different stream, right? Although given two file descriptors when I write some content it will be on the same file right? Shouldn't the same file analogy apply? I thought about using file descriptors to separate streams, but have to take care of ensuring completion of processing the buffer when closed. This I feel should be done if the descriptor gets reused.