[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <18234.58380.400222.329961@cargo.ozlabs.ibm.com>
Date: Wed, 14 Nov 2007 23:03:24 +1100
From: Paul Mackerras <paulus@...ba.org>
To: David Miller <davem@...emloft.net>
Cc: hch@...radead.org, akpm@...ux-foundation.org, gregkh@...e.de,
mucci@...utk.edu, eranian@....hp.com, wcohen@...hat.com,
robert.richter@....com, linux-kernel@...r.kernel.org,
andi@...stfloor.org
Subject: Re: [perfmon] Re: [perfmon2] perfmon2 merge news
David Miller writes:
> The same way we handle some of the multicast "getsockopt()"
> calls. The parameters passed in are both inputs and outputs.
For a read??!!!
> For the above example:
>
> struct pmd_info {
> int *pmd_numbers;
> u64 *pmd_values;
> int n;
> } *p;
>
> buffer_size = N;
> p = malloc(buffer_size);
> p->pmd_numbers = p + foo;
> p->pmd_values = p + bar;
> p->n = whatever(N);
> err = read(fd, p, N);
You're suggesting that the behaviour of a read() should depend on what
was in the buffer before the read? Gack! Surely you have better
taste than that?
Or are you saying that a read (or write) has a side-effect of altering
some other area of memory besides the buffer you give to read()? That
seems even worse to me.
> Another alternative is to use generic netlink.
Then you end up with two system calls to get the data rather than one
(one to send the request and another to read the reply). For
something that needs to be quick that is a suboptimal interface.
Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists