Re: [BK PATCH] One strdup() to rule them all

From: Rusty Russell
Date: Thu Sep 11 2003 - 22:04:01 EST


In message <20030911162223.GB3989@xxxxxxxxxxxxxxxxxxxx> you write:
> Andries, would you still object this function?
>
> char *strdup(const char *s, int flags)
> {
> char *rv = kmalloc(strlen(s)+1, flags);
> if (rv)
> strcpy(rv, s);
> return rv;
> }

No. We've been here. There are only around 50 users/potential users
of such a thing in the kernel, and seven implementations, but Linus
doesn't like it, so let's not waste more time on this please.

Rusty.

PS. kstrdrup is a better name since the args are different, a-la
kmalloc.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/