From nobody Tue Jan 24 22:14:09 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P1h8K3H86z3bgqS; Tue, 24 Jan 2023 22:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1h8K2GSJz3KgZ; Tue, 24 Jan 2023 22:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCWLaJ9C1WYKKc0Ev4IHxe8GdH15aMm+vPDbGKekmOs=; b=C6kFj88e2hyf1UKZG1qNN+xVpc9HdviTtMuoiryWHQ4r0GBqfV7aPpkeG6YLsMb4BxA0PM 7rP6GKj5lWxAcSVloLe1usdzrw9yTYorWkEgetaeUiDzPXpSVUdPKg4uAaHXQ7/TyOUWIl NXl/T+tAVOsDI+fFF3eksATwe+lBufuhFJ9zVf3FVpC1oGf0NKdhpdeXOMO1b1mhEj5UGv 7zs8pidv6mKg12NyquW1P7ZOXN7D+CZa8tBWrTHA/H9DrMtFUF7uBV9hl1IMxPrJCvxwM8 MYyGfJ+AfFS049fGeJ4UogVsNFF7qKQWBuja4KTVmg/W9mApTyxJK0Ty5T1VYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCWLaJ9C1WYKKc0Ev4IHxe8GdH15aMm+vPDbGKekmOs=; b=C47k1h8lvzrRd+XIVSmVPOFlg/JZAnzmDe6bn+pBuhvT5r014rqTWtXav/aP/H8PGI/+q+ sbwrudKzUmLNPlSKInTeQnDdNxWWnFO/aseYk9b80rzrC0iS8ya/oDKQn/V3w5eVT3Ai9c 6qVFp+jp+q5Uwev2O/zZoHnAoUBz3gcT3mTsMLiSFQ6qgzTM6xtKY6l10pNnzzQ4xyfq2j 3zU8rTSGIR4MwjUp9GO+xNULvFGNpLSjXvV4hf4FgWDbQvQuEx/E5DJXMPqHELgOsUZTxn NO3MHGIMaPFsP8+FV4nKhJIaX/SSs+cjZH2pmirDjMpJjUgtBUiDdOC7UX58Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598449; a=rsa-sha256; cv=none; b=vdSYHANl+arx+YOBvw6LT0gTjYWXbtQPfurXLmILO3WdhA/VyelV7PyvW1LlXhuU3qe8qK wlxcRFe7TuYMxXpWvW+/rAFvjHPrsuFYnL9x4BssktmcAWPCoMbCovh6lh5kihEsC2YMzw ZmA5wRwDQ1ywqKTQJ6MGLcezAS4XSEftb72CWGHlc65ah4o3Q2A7clIV/6KrYxeZMRnIRq Vz5KAj3PsTpJ42svJC+PdqwuKe8e0Id/CnFwuDO0N1GwmyA57EG3qqvxDIG6VE48Zn6E5M rK/majsyM+Wb/BI5INXFiq+XPAxE6KZy0vQ2oI989uxAR1G31ge0knPotQ+6Jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P1h8K1JrYzQmb; Tue, 24 Jan 2023 22:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30OME9SD089418; Tue, 24 Jan 2023 22:14:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OME95p089417; Tue, 24 Jan 2023 22:14:09 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:14:09 GMT Message-Id: <202301242214.30OME95p089417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 887eddca598a - stable/13 - stand: Make ioctl declaration consistent List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 887eddca598afeb678d06cb997961c248da47c6e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=887eddca598afeb678d06cb997961c248da47c6e commit 887eddca598afeb678d06cb997961c248da47c6e Author: Warner Losh AuthorDate: 2022-12-13 04:46:05 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:44 +0000 stand: Make ioctl declaration consistent It typically had two args with an optional third from the userland declaration in sys/ioccom.h. However, the funciton definition used a non-optional char * argument. This mismatch is UB behavior (but worked due to the calling convetions of all our machines). Instead, add a declaration for ioctl to stand.h, make the third arg 'void *' which is a better match to the ... declaration before. This prevents the convert int * -> char * errors as well. Make the ioctl user-space declaration truly user-space specific (omit it in the stand-alone build). No functional change intended. Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D37680 (cherry picked from commit 2e1e68cbaee3e74a89e9b63fdb180974a2bf4292) --- stand/libsa/ioctl.c | 2 +- stand/libsa/stand.h | 1 + sys/sys/ioccom.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/stand/libsa/ioctl.c b/stand/libsa/ioctl.c index 7363236ada0e..5d38d73bf106 100644 --- a/stand/libsa/ioctl.c +++ b/stand/libsa/ioctl.c @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include "stand.h" int -ioctl(int fd, u_long cmd, char *arg) +ioctl(int fd, u_long cmd, void *arg) { struct open_file *f; diff --git a/stand/libsa/stand.h b/stand/libsa/stand.h index b1c48bd88b39..c0550104bca0 100644 --- a/stand/libsa/stand.h +++ b/stand/libsa/stand.h @@ -315,6 +315,7 @@ extern int close(int); extern void closeall(void); extern ssize_t read(int, void *, size_t); extern ssize_t write(int, const void *, size_t); +extern int ioctl(int, u_long, void *); extern struct dirent *readdirfd(int); extern void preload(int); diff --git a/sys/sys/ioccom.h b/sys/sys/ioccom.h index 13faba046719..7eb5c323d886 100644 --- a/sys/sys/ioccom.h +++ b/sys/sys/ioccom.h @@ -82,7 +82,7 @@ #define _IOC_INVALID (_IOC_VOID|_IOC_INOUT) /* Never valid cmd value, use as filler */ -#else +#elif !defined(_STANDALONE) #include