From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 05B743858D20 for ; Thu, 10 Nov 2022 13:18:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 05B743858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668086282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4QUxz6SqebU+mLIDxFWz1bhz7GMYflqhR33lv7NpZhs=; b=RtQCCzihsDfbf7CPcSiuts7a7VIK9br1JB64Cmo650lR44Tp3Y4EESmX/jd7hApBhZUa6/ Ii6MNXqGZd64b2SeUvg001JRBfFl90LfWWPQM7AcafPYXid+EZQH4lESOqxDOXaMQtmCNH /OXOT6ne+i+UAoDEJFivtupAUB8a6AA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-116-UbaxCluxN1uTxoYCJX7BIw-1; Thu, 10 Nov 2022 08:17:59 -0500 X-MC-Unique: UbaxCluxN1uTxoYCJX7BIw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1D71E101A528; Thu, 10 Nov 2022 13:17:59 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20D762166B36; Thu, 10 Nov 2022 13:17:58 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Netto Cc: "H.J. Lu via Libc-alpha" , Andreas Schwab , "H.J. Lu" Subject: Re: V3 [PATCH] Add a C wrapper for prctl [BZ #25896] References: <20200429205217.2435607-1-hjl.tools@gmail.com> <87wo5xa0yt.fsf@mid.deneb.enyo.de> <20200430130333.GA254612@gmail.com> <87h7x1gkfg.fsf@igel.home> <87mu6t84yg.fsf@mid.deneb.enyo.de> <87d07pgjz0.fsf@igel.home> <878sidgjcp.fsf@igel.home> <875yfnw6n6.fsf@oldenburg.str.redhat.com> <183d6add-a82f-8d3e-6669-b5f9f78c2d45@linaro.org> <875yfnuicm.fsf@oldenburg.str.redhat.com> Date: Thu, 10 Nov 2022 14:17:56 +0100 In-Reply-To: (Adhemerval Zanella Netto's message of "Thu, 10 Nov 2022 09:25:45 -0300") Message-ID: <871qqbuewr.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Adhemerval Zanella Netto: > On 10/11/22 09:03, Florian Weimer wrote: >> * Adhemerval Zanella Netto: >> >>> The previous syscalls.list entry marked the function as 5 argument one >>> instead of variadic, so I think it would be better to add a way each >>> ABI to use this instead of the variadic one. Something like: >>> >>> #if PRCTL_VARIADIC_OK >>> int >>> __prctl (int option, ...) >>> { >>> va_list arg; >>> va_start (arg, option); >>> unsigned long int arg2 = va_arg (arg, unsigned long int); >>> unsigned long int arg3 = va_arg (arg, unsigned long int); >>> unsigned long int arg4 = va_arg (arg, unsigned long int); >>> unsigned long int arg5 = va_arg (arg, unsigned long int); >>> va_end (arg); >>> return INLINE_SYSCALL_CALL (prctl, option, arg2, arg3, arg4, arg5); >>> } >>> #else >>> int >>> __prctl (int option, int arg1, int arg2, int arg3, int arg4, int arg5) >>> { >>> return INLINE_SYSCALL_CALL (prctl, option, arg2, arg3, arg4, arg5); >>> } >>> #endif >> >> (The arguments need to be unsigned long int.) >> >> This is not easy to do in C because the GCC aliasing machinery performs >> type checking (as it should). >> >> We can probably use >> >> #define prctl prctl_XXX >> #define __prctl __prctl_XXX > > Yes, I did not include it but we already do it for non-LFS to LFS alias. > >> >> before including , but that's quite ugly. Do you still >> want me to proceed with the C version? > > I would, although it is not the simplest solution. It's not too bad. I'm going to make the internal __prctl prototype non-variadic. Thanks, Florian