From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10243 Path: news.gmane.org!not-for-mail From: Raphael Cohn Newsgroups: gmane.linux.lib.musl.general Subject: Re: RUSAGE_THREAD Date: Tue, 28 Jun 2016 17:58:22 +0100 Message-ID: References: <20160628165215.GK10893@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114faf1c769b1f0536598bca X-Trace: ger.gmane.org 1467133128 15514 80.91.229.3 (28 Jun 2016 16:58:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jun 2016 16:58:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10256-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jun 28 18:58:39 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1bHwLO-0003J8-La for gllmg-musl@m.gmane.org; Tue, 28 Jun 2016 18:58:38 +0200 Original-Received: (qmail 30115 invoked by uid 550); 28 Jun 2016 16:58:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30088 invoked from network); 28 Jun 2016 16:58:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stormmq-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=qsmzT8nyxLoSMNrvBIvibEfcgpOYNlMA6Ir4NKV9Td0=; b=my3Fkoxa9b6DWE9tHgsi5xWtTbXD42qfkNIRrCNT9hZ7jdgf03imDFcRP+gGdq/6xc Qu2gZmrdMxXFwHHaaMTFKmd/RvkWAH5VC8VZ6pYvtJWkdOS4W4PoiwqY+JcDieJyvrz6 nC2QaMKrcxeH+kXSFc5FHHmE5ZP+RIYdQHUroKMcexpTafJN+5wAu7262afkF+yiFrea 7khyT9g9LkZBPOj1qkngEZU7iz76YFNnJK6RhVJZ2ACTbiTdzavfsF3h0hRQF1ZNj+8Y tg74iOjqiDQAvAYS2xz+3HgYJ6DomDnB8vdIpmFVNdgWoOlY4Ar1MNmESX3oLnRReMD8 7dvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=qsmzT8nyxLoSMNrvBIvibEfcgpOYNlMA6Ir4NKV9Td0=; b=H6+dmfQ6P3WACWH/08Tiem2AsNi2+RX7WHGrsNkf9EtypqljH/u56/Jqmjl9Dg1/Jn VVh6icVrDn+nHYEuJ+xSmKwJPwVm2ymwvhpoTIZHdgkaHjoPKszA6KrYfyyl11OFQ6mG V8mOePb4UrYCVU3k+spADyY4iM7A96XnrK3l06gnm+3gIk0uQeqxrJmIeJuFhIxhki9E OZPGW3TPxws5sI3m0BIPlHXeB/leprUaq6zinHH112fDEDD6uKpOKJkBIGZchwB/+nnL BjbRUVdO7b9aSzw4x/XJ+F6ALE3ipXF16P1CnLIqjzs7+AS9rIh5vX8ULcv61REqs9Pl 2Qdw== X-Gm-Message-State: ALyK8tK6M+5Jzeppn3uhMa1ZPNo+ea60oNH9lbHgf36q8yo9FcZAYs6ie+Z6RavREcdaDpEENxFwdOjGQF4bPQ== X-Received: by 10.176.68.167 with SMTP id n36mr1230585uan.44.1467133103341; Tue, 28 Jun 2016 09:58:23 -0700 (PDT) X-Originating-IP: [2001:8b0:862:b944:717f:4824:a0cd:f3b8] In-Reply-To: <20160628165215.GK10893@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:10243 Archived-At: --001a114faf1c769b1f0536598bca Content-Type: text/plain; charset=UTF-8 On 28 June 2016 at 17:52, Rich Felker wrote: > On Tue, Jun 28, 2016 at 04:00:45PM +0100, Raphael Cohn wrote: > > Hi, > > > > I'm in the process of compiling ZFS on Linux against musl. ZFS seems to > > make a few slightly glibc-like assumptions, one of which is the use of > > RUSAGE_THREAD. Musl seems to lack a definition of this in sys/resource.h. > > Is this deliberate? > > > > Glibc defines RUSAGE_THREAD as 1, but musl already uses this value for > > RUSAGE_CHILDREN (glibc sets this as -1). What would be the correct value > > for RUSAGE_THREAD with musl? > > Maybe this is incorrect in musl then. Can anyone confirm? The values > are determined by (i.e. have to match) the kernel. > > Rich > I've grabbed the 4.6 linux kernel sources. A quick grep suggests include/uapi/linux/resource.h defines it as 1. Additionally, in this file:- RUSAGE_SELF is 0 (I believe this is also the value musl uses). RUSAGE_CHILDREN is -1 RUSAGE_BOTH is -2 (not in glibc; not mentioned in the getrusage man pages I have). What does anyone else think? --001a114faf1c769b1f0536598bca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 28 June 2016 at 17:52, Rich Felker &l= t;dalias@libc.org&= gt; wrote:
=
On Tue, = Jun 28, 2016 at 04:00:45PM +0100, Raphael Cohn wrote:
> Hi,
>
> I'm in the process of compiling ZFS on Linux against musl. ZFS see= ms to
> make a few slightly glibc-like assumptions, one of which is the use of=
> RUSAGE_THREAD. Musl seems to lack a definition of this in sys/resource= .h.
> Is this deliberate?
>
> Glibc defines RUSAGE_THREAD as 1, but musl already uses this value for=
> RUSAGE_CHILDREN (glibc sets this as -1). What would be the correct val= ue
> for RUSAGE_THREAD with musl?

Maybe this is incorrect in musl then. Can anyone confirm? The values=
are determined by (i.e. have to match) the kernel.

Rich

I've grabbed the 4.= 6 linux kernel sources. A quick grep=20 suggests=C2=A0 include/uapi/linux/resource.h=C2=A0 defines it as 1. Additio= nally,=20 in this file:-

RUSAGE_SELF is 0 (I believe this is also the va= lue musl uses).
RUSAGE_CHILDREN is -1
RUSAGE_BOTH is -2 (not in= glibc; not mentioned in the getrusage man pages I have).

What= does anyone else think?
--001a114faf1c769b1f0536598bca--