From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24396 invoked from network); 15 Oct 2020 15:50:54 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 15 Oct 2020 15:50:54 -0000 Received: (qmail 28203 invoked by uid 550); 15 Oct 2020 15:50:52 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 28185 invoked from network); 15 Oct 2020 15:50:52 -0000 MIME-Version: 1.0 Date: Thu, 15 Oct 2020 18:50:41 +0300 From: Alexey Izbyshev To: musl@lists.openwall.com In-Reply-To: <20201015085024.GR2947641@port70.net> References: <948f6fc6f3458f18152c0f8b505beec0@ispras.ru> <20201015085024.GR2947641@port70.net> User-Agent: Roundcube Webmail/1.4.4 Message-ID: X-Sender: izbyshev@ispras.ru Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [musl] Why is setrlimit() considered to have per-thread effect? On 2020-10-15 11:50, Szabolcs Nagy wrote: > note that prlimit does not have synccall in > musl: the kernel implemented the per process > rlimit setting when prlimit was added. > (i think this is linux commit > 1c1e618ddd15f69fd87ccea596769f78c8065504 ) > > but older kernels don't have that. > Ah, thank you for checking that, though the transition appear to have happened much earlier than the commit you referenced (which is not relevant), in pre-git epoch between 2.6.9 and 2.6.10[1, 2]. I was confused because Linux man pages never mention that and explicitly say "Resource limits are per-process attributes that are shared by all of the threads in a process."[3], but I should have checked old sources. >> Tangentially, setgroups() is not called via __synccall(), though it >> does >> have per-thread effect. Is this intentional? > > that may be a bug, but it's not a posix api > so not a conformance issue, but a linux issue: > if other linux libcs don't do synccall then > that's the defacto interface contract. > FWIW, glibc does synccall since 2011: https://sourceware.org/git/?p=glibc.git;a=commit;h=70181fddf14 [1] https://elixir.bootlin.com/linux/v2.6.9/source/kernel/sys.c#L1537 [2] https://elixir.bootlin.com/linux/v2.6.10/source/kernel/sys.c#L1487 [3] https://man7.org/linux/man-pages/man2/setrlimit.2.html