From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B12CB1F461 for ; Fri, 19 Jul 2019 11:49:46 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=YaBbZ reE5xpS9nTstXP68ZPl9/dkXlWnuD45zIMyLIdAiXr/Cg9jp1C+JXmTWR602l3el o5Pq8Vahx+BVxTxJZaxAdGmQeBaKieidsKZ+6xjjNVAvDFFh1tR1XrTyRuWKu8Zt 9QEphJqi9t53iQdxWl9hUTZ/mdRwxx3E82JHMM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=cQYimnQbkpA e9M5CWfpYZcS83cQ=; b=EEq6G2yQxYJatov8Dcyn7wRQEDnTSqSPlT478HyeFOW 4BRfCEviAxu6jdFjdoak0+6lJ1mU0EsmRwFCBt0DQ5F3D9O+uyO8cEAv038J7IkQ Q0QI4qWWi5LVltSRfg0ue0Qw4GlxZQymO7LM5eWKIVSmhpaULbLDX4X+fret4e7o = Received: (qmail 109048 invoked by alias); 19 Jul 2019 11:49:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 108920 invoked by uid 89); 19 Jul 2019 11:49:32 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com From: Florian Weimer To: Paul Eggert Cc: Maciej Rozycki , GNU C Library Subject: Re: glibc at the Toolchains microconference at LPC 2019 References: <87o92kibdz.fsf@oldenburg2.str.redhat.com> <87y318r8eb.fsf@oldenburg2.str.redhat.com> Date: Fri, 19 Jul 2019 13:49:26 +0200 In-Reply-To: (Paul Eggert's message of "Mon, 8 Jul 2019 09:06:42 -0700") Message-ID: <87lfwukzw9.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain * Paul Eggert: > Florian Weimer wrote: >> When it comes to exposes the system call, we prefer to use size_t for >> buffer sizes (even if the kernel uses int or unsigned int), purely for >> documentation purposes. > > I suggest using "ssize_t or size_t" to keep the text parallel with > "int or unsigned int". We shouldn't insist on size_t for buffer sizes > when the natural interpretation of the value is signed (as in the > return value for 'read' etc.) or is too large for malloc etc. Right. Incoming buffer sizes should be size_t (no in-band signaling). Return values tend to have in-band signaling for errors and thus need to be ssize_t. Thanks, Florian