Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2860159imu; Sun, 11 Nov 2018 02:31:17 -0800 (PST) X-Google-Smtp-Source: AJdET5dw0cyx91CHcDMrH25fJxTa8iNps6t2+0iO6UmF83oEDj3D5tsEmKPY+o9KLgqN8XeKZZzR X-Received: by 2002:a17:902:74c4:: with SMTP id f4-v6mr16058532plt.52.1541932277711; Sun, 11 Nov 2018 02:31:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541932277; cv=none; d=google.com; s=arc-20160816; b=BRa4cmrWoNXZslaCQrzhy2bnNlGwhzRS0LBC4kl66iXGXulbd3tpDFfUQY/sXXRq5T exa2+0vDp3Op0RmOvVjx5hDY4/Fys0rL1DDt60u5GmWwnb0UgzpAiUL/gjF3drBI1JWA d0B0vaQna6UMKeLcEZCwANVGsb7BvhHnQMkm9ztaV+TCpt5EA0oAGDF9YbpxLo+Cj6Ai /WQViQdrFkrAG0NBx0MgVUPSGDMiBXhNqHyMbzbUTSNLuCYv2uu8aucvhdS47ev1+4qY QMUOhvRqoRdwX+TUsXc4eRljs+uPR5hM4k+uNWcSUoHXdYBXNNz9/10IfZfBwxTHXh3q RDDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=n2wLt4lkx4WvuUj12DFIkn6gJvG5zoEWBM3ca2YFp/k=; b=BHRvnXw70aapVgL1kTJT7afzAvV+r3jM4XcT86fhd/7b8B6x3U3qnVEMgQKjXLQCmX MjEQtSnJ2swkMHZTNzq/ztHduqAlh+OwleqjDrRYSds+QQqpIxR4ANyLCKZSz0geGR3+ t2i43PRqje+nBUmt2TlxhGql5cW9qMQUooXzIhf5xprJpocK2M0fVErISNSePTqVhT3g hZqFDUQWX3m8VtV2Y5tRMbVZ1Z019YJ/lR33y/2qhrnn4n3MudmEA1UIZn7lQhrTJWPf /a5+S076rXH93uKunT1g1KUiZZxtKf5bTz47SycVBUsqBf6W2GPhINmCTIDkk3xVkMkJ tITw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n33si12229733pgl.336.2018.11.11.02.31.02; Sun, 11 Nov 2018 02:31:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727734AbeKKUSp (ORCPT + 99 others); Sun, 11 Nov 2018 15:18:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55204 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727344AbeKKUSp (ORCPT ); Sun, 11 Nov 2018 15:18:45 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15C5431256A5; Sun, 11 Nov 2018 10:30:35 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4F2C5D736; Sun, 11 Nov 2018 10:30:30 +0000 (UTC) From: Florian Weimer To: Willy Tarreau Cc: "Michael Kerrisk \(man-pages\)" , Daniel Colascione , linux-kernel , Joel Fernandes , Linux API , Vlastimil Babka , "Carlos O'Donell" , "libc-alpha\@sourceware.org" Subject: Re: Official Linux system wrapper library? References: <20181111081725.GA30248@1wt.eu> Date: Sun, 11 Nov 2018 11:30:25 +0100 In-Reply-To: <20181111081725.GA30248@1wt.eu> (Willy Tarreau's message of "Sun, 11 Nov 2018 09:17:25 +0100") Message-ID: <87y39zx5xa.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Sun, 11 Nov 2018 10:30:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Willy Tarreau: > On Sun, Nov 11, 2018 at 07:55:30AM +0100, Michael Kerrisk (man-pages) wrote: >> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=6399 is a >> longstanding example. > > This one was a sad read and shows that applications will continue to > suffer from glibc's prehistorical view on operating systems and will > continue to have to define their own syscall wrappers to exploit the > full potential of the modern operating systems they execute on. What's modern about a 15-bit thread identifier? I understand that using this interface is required in some cases (which includes some system calls for which glibc does provide wrappers), but I assumed that it was at least understood that these reusable IDs for tasks were an extremely poor interface. Aren't the resulting bugs common knowledge? > This reminds me when one had to write their own spinlocks and atomics > many years ago. Seeing comments suggesting an application should open > /proc/$PID makes me really wonder if people actually want to use slow > and insecure applications designed this way. I don't understand. If you want a non-reusable identifier, you have to go through the /proc interface anyway. I think the recommendation is to use the PID/start time combination to get a unique process identifier or something like that. I wanted to add gettid to glibc this cycle, but your comments suggest to me that if we did this, we'd likely never get a proper non-reusable thread identifier from the kernel. So I'm not sure what do anymore. Thanks, Florian