On Aug 5, 2009, at 9:34 AM, Robert P. J. Day wrote:
I pulled this from fs/proc/devices.c, I hope it's version compatible with your query: static void *devinfo_start(struct seq_file *f, loff_t *pos) 27 { 28 if (*pos < (BLKDEV_MAJOR_HASH_SIZE + CHRDEV_MAJOR_HASH_SIZE)) 29 return pos; 30 return NULL; 31 } This example does not assume (*pos) is initialized to zero. Digging further back into the sequence of events that occurs before the start() is called, I can't find anything that explicitly sets the (*pos) to zero, unless it follows philosophy of setting (*pos) to zero when open() is called (this is probably buried in the more generic file I/O layers). |