Skip to contentSkip to conversation

lseek on /proc/kmsg

DISCUSSION Robert Hancock 1 participant 1 message Mar 22, 2005 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 11 lines · linux-os
Quoted 9 lines · Jan Engelhardt

Hi,

Quoted 1 line

how am I supposed to clear the kmsg buffer since it's not a terminal??

fd = open("/proc/kmsg", O_RDONLY | O_NONBLOCK);
while(read(fd, buf, sizeof(buf)) > 0);
if(errno == EAGAIN) { printf("Clear!\n"); }

Quoted 6 lines
Quoted 2 lines

This is language (spoken-wise) neutral :p

Gawd, you are a hacker. I already have to suck on pipes because I can't seek them. Now, I can't even seek a file-system???!!

I'm not sure that seek makes any sense on that, since it is more like a pipe than a normal file..

Signature · 3 lines
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from [email protected]
Home Page: http://www.roberthancock.com/