On Fri 07 Sep 2007 at 04:40PM, Dan McDonald wrote:
> On Fri, Sep 07, 2007 at 01:34:15PM -0700, Seth Goldberg wrote:
> > > You'll also want to ensure that you have some consumers for this
> > > functionality-- the obvious thing would be to rip out the various
> > > other strdup's which exist.
> > 
> >    The obvious question is-- how does one specify whether
> >    KM_SLEEP/KM_NOSLEEP is used for the underlying allocation (for
> >    kernel applications).
> The first-cut "obvious" answer is KM_NOSLEEP, since strdup() CAN return NULL
> on failure.

The "obvious" answer to me is that you would survey all the kernel code
which has implemented strdup()-like functionality and then make a
decision based on this requirements gathering exercise.

FWIW, I had simply assumed that the interface would mimic most other
memory allocating interface: strdup(mystr, KM_SLEEP) (or if we're
worried that people will make mistakes if it is called "strdup" then
call it kstrdup).  But again, I think this issue is for the implementor
to decide.

Probably this belongs on osol-code... :/


Daniel Price - Solaris Kernel Engineering - dp at eng.sun.com - blogs.sun.com/dp

Reply via email to