From owner-freebsd-questions@FreeBSD.ORG Mon Apr 14 23:27:44 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99245106566B for ; Mon, 14 Apr 2008 23:27:44 +0000 (UTC) (envelope-from bahamasfranks@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 50DCE8FC26 for ; Mon, 14 Apr 2008 23:27:44 +0000 (UTC) (envelope-from bahamasfranks@gmail.com) Received: by an-out-0708.google.com with SMTP id c14so503947anc.13 for ; Mon, 14 Apr 2008 16:27:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=boeeV15OKLsX3Qy1ZOKs2MSOFVvVxncXgqiIUPw7hdM=; b=ExnBMSvlzcjDUuhOL4X5AjyKmKPKi+5s2NQ70oSPad+dXnKX/yvNxuLbQ0iP6w5cl8dUmO3+1B6o3oIHL8fyGJmYULQlhW2WQxxG4TeusNQUwHy7PYOk03Wg9sLk53JO12EQG0WtW2pli+NqEVb+731WJSMFZqibp0CdGR3Athg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=EgcLO8k0ULkUjW41tYrKFTnx+s2EMZx1vod2Lctn5McpMITxyiPNR42HoTfSDJ3aUxH+HZTIDmUyVczdtdwZQnEBgQf0+kVeEh2aGJpe5a2J5NOtkWrBEhaVubE7/BVKIr3xvlIzn0ZVnhspGCsQKpBb1jr7lYTuwXboNQuHcCU= Received: by 10.100.251.13 with SMTP id y13mr6716381anh.131.1208215663632; Mon, 14 Apr 2008 16:27:43 -0700 (PDT) Received: by 10.100.253.13 with HTTP; Mon, 14 Apr 2008 16:27:42 -0700 (PDT) Message-ID: <539c60b90804141627r502ec7eeudd5b3112cd891ed@mail.gmail.com> Date: Mon, 14 Apr 2008 16:27:42 -0700 From: "Steve Franks" Sender: bahamasfranks@gmail.com To: "Giorgos Keramidas" In-Reply-To: <877if0qbnz.fsf@kobe.laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <539c60b90804141543h29b3c2f4y8c38694821d67d95@mail.gmail.com> <877if0qbnz.fsf@kobe.laptop> X-Google-Sender-Auth: 90074314e1bea40a Cc: FreeBSD Mailing List Subject: Re: [?OT?] strndup exists in FreeBSD? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: stevefranks@ieee.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2008 23:27:44 -0000 > While it seems like a cool function name, what's the point of having it? > If you know how much you want to copy, it's trivial to allocate a buffer > large enough and strlcpy() into it. If you don't know how much you want > to copy, then strdup() is ok anyway :) Granted. It's just one more thing to hack when porting linux code (which I'm getting rather tired of doing, I must admit - they seem to assume everyone likes to include every new api ever concieved, then they go off and use them...) Steve