lkml.org 
[lkml]   [2002]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: read proc entry
    Date
    After I added *eof =1, that message appears two times. How can I reduce it
    only one?

    ----- Original Message -----
    From: "Peter Wächtler" <pwaechtler@loewe-komp.de>
    To: "Anthony Chee" <anthony.chee@polyu.edu.hk>
    Cc: <linux-kernel@vger.kernel.org>
    Sent: Saturday, April 13, 2002 9:58 PM
    Subject: Re: read proc entry


    > Anthony Chee wrote:
    > >
    > > I written the following code in a module
    > >
    > > static struct proc_dir_entry *test_proc;
    > > test_proc = create_proc_read_entry(test_proc, 0444, NULL,
    read_test_proc,
    > > NULL);
    > >
    > > void show_kernel_message() {
    > > printk("\nkernel test\n");
    > > }
    > >
    > > int read_test_info(char* page, char** start, off_t off, int count, int*
    eof,
    > > void* data) {
    > > show_kernel_message();
    >
    > I think you have to signal EOF
    >
    > *eof=1;
    >
    > > }
    > >
    > > After I use "cat /proc/test_proc", it is found that there are three
    "kernel
    > > test" messages
    > > appear. Why it happened like this? I expected the message should be
    shown
    > > once.
    > >
    >

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:22    [W:0.034 / U:1.620 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site