From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4443 Path: news.gmane.org!not-for-mail From: Raphael Cohn Newsgroups: gmane.linux.lib.musl.general Subject: musl & strndupa? Date: Wed, 1 Jan 2014 19:42:47 +0000 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c1d6a8aa56f004eeede1c3 X-Trace: ger.gmane.org 1388605374 7237 80.91.229.3 (1 Jan 2014 19:42:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jan 2014 19:42:54 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4447-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 01 20:43:02 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1VyRh0-00067Y-0V for gllmg-musl@plane.gmane.org; Wed, 01 Jan 2014 20:43:02 +0100 Original-Received: (qmail 7784 invoked by uid 550); 1 Jan 2014 19:43:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7773 invoked from network); 1 Jan 2014 19:43:00 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=Fln4PedCtPFcX8j/fNxPFINk6s+lUFIArS0lhoygITw=; b=dgfpKBHsvlyh4Z3KYOXFIfRyhXmzX48E2fVPQ/4e41wozRsoiXH/9SzqToD+ZZTipu aI07JYVNIe9Ew9Ry4mle6JXyQAm6dCtjgcrYgj0p8cnqcpTCbhD5h7aqRD3FGcxaQeVM f6jHGvux5ICTMrU5NoLmdnYzAZOxosG5g+RmFhWDEnpBC8dGy4Czd/0rAjtqdSzBtO7h QKCcwAL2NObQsFuwm2x4wKOP5UlgfINUIYjTq/BpG9ym2tMhIpco36dqfIJlnWY+b2Ug H5SN1u8MzUn/FM8yG9cqqj4KeLNxMeOg0hA10WkI+B2yPoRUazbY8ZpT5qZ2H/VguwRG TcAQ== X-Gm-Message-State: ALoCoQmvTfMXuI+bCh/guA2172P8e5rbjU4FoIMYg+PmA0EWG35ZgBu3JIlPmqjBCMDU26X3XBsD X-Received: by 10.60.65.5 with SMTP id t5mr53076398oes.19.1388605367533; Wed, 01 Jan 2014 11:42:47 -0800 (PST) X-Originating-IP: [2001:8b0:862:b944:4124:b77b:3c6f:cb27] Xref: news.gmane.org gmane.linux.lib.musl.general:4443 Archived-At: --001a11c1d6a8aa56f004eeede1c3 Content-Type: text/plain; charset=UTF-8 Hi, I'm trying to compile 'audit' (aka libaudit, auditd, etc - from http://people.redhat.com/sgrubb/audit/index.html version 2.3.2). Using musl 0.9.14. The file 'src/ausearch-lol.c' uses a reference to 'strndupa', which I presume is an alloca version of strndup, and presumably a _GNU_SOURCE feature. I can't seem to see a definition for it in musl, although strdupa exists in string.h (Indeed, http://linux.die.net/man/3/strdup suggests as much). Is this intentional? If so, what would anyone suggest as a work around? My guess would be #define strndupa(x, t) strncpy(alloca(strlen(x)+1),x,t) but I'd like a second opinion... Raph --001a11c1d6a8aa56f004eeede1c3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Is this intentional? If so, what would anyone suggest as a work a= round? My guess would be=C2=A0 #define strndupa(x, t) strncpy(alloca(strlen= (x)+1),x,t)=C2=A0 but I'd like a second opinion...
Raph

--001a11c1d6a8aa56f004eeede1c3--