Skip to contentSkip to conversation

confused about kernel printk behavior...

parisc-linux Randolph Chung 2 participants 2 messages Mar 3, 2001 – Mar 4, 2001

lore
Share & tools
lore
#0 lore raw

I have a function like this in a char driver:

static ssize_t stabledev_read(struct file *file, char *buf, size_t count,
loff_t *ppos)

{
	char *kbuf;
	unsigned int size = 0;

	printk("stabledev_read: pos = %ld, count = %d\n", *ppos, count);
	printk("stabledev_read: pos = %ld\n", *ppos);
	printk("stabledev_read: count = %d\n", count);
	/* ... */
}

for some reason, the output i get from the above is:
stabledev_read: pos = 20536, count = 0
stabledev_read: pos = 1
stabledev_read: count = 4096

why is that? this is a 32-bit kernel built using xc-20010215

randolph

Signature · 4 lines
   @..@                                         http://www.TauSq.org/
  (----)
 ( >__< )
 ^^ ~~ ^^
#1 lore raw
Quoted 5 lines · Randolph Chung

stabledev_read: pos = 20536, count = 0
stabledev_read: pos = 1
stabledev_read: count = 4096

why is that? this is a 32-bit kernel built using xc-20010215

loff_t is `long long' on 32-bit parisc.

Alan Modra

Signature · 1 line
Linuxcare.  Support for the Revolution.