From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from 1.mo51.mail-out.ovh.net (1.mo51.mail-out.ovh.net [178.32.121.110]) by sourceware.org (Postfix) with ESMTPS id 7651439F6C64 for ; Mon, 12 Apr 2021 06:39:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7651439F6C64 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=jwilk.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jwilk@jwilk.net Received: from mxplan6.mail.ovh.net (unknown [10.108.4.92]) by mo51.mail-out.ovh.net (Postfix) with ESMTPS id 8517E280BDD; Mon, 12 Apr 2021 08:39:13 +0200 (CEST) Received: from jwilk.net (37.59.142.106) by DAG4EX2.mxp6.local (172.16.2.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 12 Apr 2021 08:39:11 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-106R0068b89e94c-f195-4fac-97b3-f2c61658baa7, 18521782582EAEABF162AF4FB3A53674F3987C6F) smtp.auth=jwilk@jwilk.net X-OVh-ClientIp: 5.173.88.234 Date: Mon, 12 Apr 2021 08:39:09 +0200 From: Jakub Wilk To: CC: , Alejandro Colomar , Michael Kerrisk Subject: Re: [PATCH v5 00/35] SYNOPSIS: Use syscall(SYS_...); and fix '#include's Message-ID: <20210412063909.lzkwp5jotejbes75@jwilk.net> References: <20210403194026.102818-1-alx.manpages@gmail.com> <20210404115847.78166-1-alx.manpages@gmail.com> <4298cc3c-8f24-5a3c-3c54-b24ca804d373@gmail.com> <87y2doni1m.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Content-Disposition: inline In-Reply-To: <87y2doni1m.fsf@oldenburg.str.redhat.com> User-Agent: NeoMutt/20180716 X-Originating-IP: [37.59.142.106] X-ClientProxiedBy: DAG8EX2.mxp6.local (172.16.2.72) To DAG4EX2.mxp6.local (172.16.2.32) X-Ovh-Tracer-GUID: dd6ef7d5-1802-4fca-9f8d-af4eaf6b18ba X-Ovh-Tracer-Id: 16938319676749502432 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrudekiedguddtlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhepfffhvffukfhfgggtuggjfghisehttdertddtredvnecuhfhrohhmpeflrghkuhgsucghihhlkhcuoehjfihilhhksehjfihilhhkrdhnvghtqeenucggtffrrghtthgvrhhnpefhfedvfeehvefhkeeltdejgeelteefvdefvdduvdefgfduueeitdeitedvtdehgfenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehmgihplhgrnheirdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepjhifihhlkhesjhifihhlkhdrnhgvthdprhgtphhtthhopehmthhkrdhmrghnphgrghgvshesghhmrghilhdrtghomh X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2021 06:39:17 -0000 * Florian Weimer , 2021-04-12, 08:17: >> SYNOPSIS >> #include /* Definition of ARCH_* constants */ >> #include /* Definition of SYS_* constants */ >> #include >> >> int syscall(SYS_arch_prctl, int code, unsigned long addr); >> int syscall(SYS_arch_prctl, int code, unsigned long *addr); >> >> Note: glibc provides no wrapper for arch_prctl(), necessitating >> the use of syscall(2). >> >> Without something like this, the reader may be puzzled at the use of >> syscall(). >> >> What do you think? > >Would it be possible to use real C syntax? Seconded. > int code; > unsigned long addr; > int result; > result = syscall (SYS_arch_prctl, code, addr); > result = syscall (SYS_arch_prctl, code, &addr); > >Or perhaps omit the result variable: > > int code; > unsigned long addr; > syscall (SYS_arch_prctl, code, addr); Or, more succinctly, put the types in comments: syscall(SYS_arch_prctl, /* int */ code, /* unsigned long */ addr); -- Jakub Wilk