From nobody Tue Dec 13 04:47:28 2022 X-Original-To: dev-commits-src-all@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 4NWQw03QkDz4jnvF; Tue, 13 Dec 2022 04:47:28 +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 4NWQw02pJJz47WV; Tue, 13 Dec 2022 04:47:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670906848; 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=gGnRKEVqIMtk1a/JUEscg+hPRDd+YSpiheSMu4uccSw=; b=Vw8evTQTHDgd9V7v1z7ui0Ddex3coj2yzVq4DUEEpizIG5xk/Bc1jfX7p43nHvlFN/LslA tYiNGL1NDre4dddpLY6YwsEyNr/Qaw+QDblGDkazDgYXIVEF3HX9CgG9QFuvSITTGqlpQf I8l1a/dDiPXW3igJq7KI1lj3Ke6Cv6ITlMAYz6x+k8+63+7fJoGd1FcV/QtYF3VzPtlE9U kUfAGQQ4FqeOJ+N8My8yHZuyDu9SJ4S/K412d7zbJnnmzTo3gzxFvsRQX91CIRVGYhmbuH dGSJwUoOwwTzCbgOb3DkfdOLz6glk1KF3xyG3zBOXtaFntpDEwvcZN+Qc+1s8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670906848; 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=gGnRKEVqIMtk1a/JUEscg+hPRDd+YSpiheSMu4uccSw=; b=T/RiluH8B/v3J9L2OPwHe2/qAQG717wvW4Bk3Z50VMpGrSKgWlW13drlV37SgcvewLjJrI aZnjpCxe/2j0SNfh62c/9tGIdNHJjKxsWxeZgt4TeJiyZBPRopBB7sKUlcHEyP5xj9IjKw 9+FoD0CyKIRbxDdpnWkwrmuq5lg4q3byI5oMNwbIhGmgt2mGZK4HPX9KnnKmqoZCDnDLUN sJzbWfq/DhHtxov9NlCpygjdtjicFZHKgp1u28VQzPJUk+GZpKoveJ/foEMgr0Z6O/mEpw ATMtS5eK1T7UAnVXtNqPeI6FpCmJkNal2tCCUAqkR6Up2slWXBmw1LUQGg1tOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670906848; a=rsa-sha256; cv=none; b=LgzgLeIPmi4wSysj+GpP4xvznGPaZcdO/ipDFNJjcAmz0wAqStspvMYaCBPIxjqMTIZZT5 Zr3N11iuvMAXGmv3UxaCJRg6CNaTvC+4VJ/poYNKr57vpkaUzUOOWLO7Z6y8uXVBBzOuRW tZlOUd4I7hY6McQMQz18dM5W4BqXFfrG7hrWi140ifBEnWFOA31PcJD81Q2iepve6xwSQq lpdYB29ZNmMTWu4Fado8YC2E5z93OXkLwzgwnVGidW1Oiug/SLPOMa4nLmPS/IHDEYz9Ei XVpCjmll5OL7KK/mWlQTxe5sps+nX6GNQSO4t6/djbKgL0xd287z/YVsMBuYDQ== 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 4NWQw01syDz11jb; Tue, 13 Dec 2022 04:47:28 +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 2BD4lS0a090375; Tue, 13 Dec 2022 04:47:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BD4lSDf090374; Tue, 13 Dec 2022 04:47:28 GMT (envelope-from git) Date: Tue, 13 Dec 2022 04:47:28 GMT Message-Id: <202212130447.2BD4lSDf090374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2e1e68cbaee3 - main - stand: Make ioctl declaration consistent List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 2e1e68cbaee3e74a89e9b63fdb180974a2bf4292 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2e1e68cbaee3e74a89e9b63fdb180974a2bf4292 commit 2e1e68cbaee3e74a89e9b63fdb180974a2bf4292 Author: Warner Losh AuthorDate: 2022-12-13 04:46:05 +0000 Commit: Warner Losh CommitDate: 2022-12-13 04:46:34 +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 --- 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