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.129.124]) by sourceware.org (Postfix) with ESMTPS id 0099C3858D3C for ; Thu, 10 Nov 2022 12:03:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0099C3858D3C 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=1668081825; 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=fqWvPw9LYEzg6d0N9yGVwbzJtRFTOaNE/OGU1UhVE2g=; b=JXw/OPMDEKSHxu8I3XrqTeFlPZilhZYocubleyzfyRug02f5VIKj0gDBU7m62Uk8lOFnm+ inQx3idkc0HEwhzO/QBN2nrTwVUHusJJIrsf+5yyiWtS9Sa6rTpbdqpBOhGFAGAfzT05H6 XehoOjt46l4p5bZjh8i8+tlDCx2TceI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-265-ucdWe0wwNv2OX4koJjpbMg-1; Thu, 10 Nov 2022 07:03:41 -0500 X-MC-Unique: ucdWe0wwNv2OX4koJjpbMg-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 DEDFE1C004F7; Thu, 10 Nov 2022 12:03:40 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D30032166B29; Thu, 10 Nov 2022 12:03:39 +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> Date: Thu, 10 Nov 2022 13:03:37 +0100 In-Reply-To: <183d6add-a82f-8d3e-6669-b5f9f78c2d45@linaro.org> (Adhemerval Zanella Netto's message of "Thu, 10 Nov 2022 08:49:24 -0300") Message-ID: <875yfnuicm.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=-5.0 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: > 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 before including , but that's quite ugly. Do you still want me to proceed with the C version? Thanks, Florian