public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* proc file system
@ 2001-03-30 10:59 Srinivas Surabhi
  0 siblings, 0 replies; 11+ messages in thread
From: Srinivas Surabhi @ 2001-03-30 10:59 UTC (permalink / raw)
  To: linux-kernel


hi everybody,


   kindly give me a idea  how to write a file into proc filesystem.
i.e functions to be used?system calls to be be called?

adv .thanks for giving imm. reply

srinivas



^ permalink raw reply	[flat|nested] 11+ messages in thread
* proc file system
@ 2001-08-08  8:04 Dattatray Kulkarni
  0 siblings, 0 replies; 11+ messages in thread
From: Dattatray Kulkarni @ 2001-08-08  8:04 UTC (permalink / raw)
  To: linux-kernel

    
> Hi,
> Where Can I get full documentation about proc file system in linux?
> regards,
> dattatray.
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* proc file system
@ 2001-08-27 14:01 Christian Widmer
  0 siblings, 0 replies; 11+ messages in thread
From: Christian Widmer @ 2001-08-27 14:01 UTC (permalink / raw)
  To: linux-kernel

i need to report more then 4KB of data to the /proc and found a short
note in "linux device drivers 2" how to do. so i wrote some functions
that look like that one below.

static int my_read_proc(char *page, char **start, off_t offset,
                       int count, int *eof, void* data)

{
  static int  myIndex = 0, done = 0;
  int en = 0, max = count - 256;

  for(;myIndex < MAX_INDEX; myIndex++){
	len += sprintf(page+len, "hier some info of dynamic length\n");
	if(len > max){		// still data left
           (*start) = page;
            return len;
         }	
  }
  myIndex = 0;			// all data out
  *eof = 1
  done   = 1;
  return len;
}

not all of my output gets printed. looks like the data from the last 
call to my function disapiers. thats wy i thought to delay the eof
one call by:

static int my_read_proc(char *page, char **start, off_t offset,
                        int count, int *eof, void* data)

{
  static int  myIndex = 0, done = 0;
  int len = 0, count = offset - 256;
  if(done){				// now we say that we are done
    *eof = 1;
    done = 0;
    return 0;
  }
 for(;myIndex < MAX_INDEX; myIndex++){
	len += sprintf(page+len, "hier some info of dynamic length\n");
	if(len > max){			//more data left
           (*start) = page;
            return len;
         }	
 }
 (*start) = page;			//were done (but we dont say)
 myIndex = 0;
 done   = 1;
 return len;
}

it does not cut any more some of my data. but endlessly dumping my data to 
the terminal. after delaying the reset of 'done' as long as offest dont get
back to 0 it seems to work.

  if(done & offset){			// wait until linux seems to have the
					// same view of the proc-files state
    *eof = 1;
    return 0;
  }else done = 0;



can anybody tell me wats going on here - i'm confused what do i not know?


^ permalink raw reply	[flat|nested] 11+ messages in thread
* proc file system
@ 2001-10-05 22:02 llx
  2001-10-06 15:30 ` Erik Mouw
  0 siblings, 1 reply; 11+ messages in thread
From: llx @ 2001-10-05 22:02 UTC (permalink / raw)
  To: linux-kernel

i've written a prog interface for my logger utility to make it easy
to transport my logging information from kernel to userspace using
shell commands. now i want to use tail -f /prog/<mylogfile>. what
do i have to do for that to work. when using tail my loginfo gets
read form my ringbuffer, but nothing gets printed in the terminal.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-10-17 21:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-30 10:59 proc file system Srinivas Surabhi
  -- strict thread matches above, loose matches on Subject: below --
2001-08-08  8:04 Dattatray Kulkarni
2001-08-27 14:01 Christian Widmer
2001-10-05 22:02 llx
2001-10-06 15:30 ` Erik Mouw
2001-10-09 13:41   ` Jan Hudec
2001-10-09 16:49     ` Steve Brueggeman
2001-10-10 17:04       ` Jan Hudec
2001-10-14 20:06         ` Riley Williams
2001-10-15 15:02           ` Jan Hudec
2001-10-17 21:10             ` Riley Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox