From nobody Tue Mar 19 23:15:49 2024 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 4Tzndf0YrYz5Fk64; Tue, 19 Mar 2024 23:15:50 +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 4Tzndf02htz4J0V; Tue, 19 Mar 2024 23:15:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710890150; 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=OFlvVIro0EWEe3mQcYwt5fD49Vo0CNSnIctk1/HDDBk=; b=xvzAG8V0e3ackM55kKFUCCCBxQjcHepfbmSPGSzuC5tTXHFX/5aCl8BvezMmoAJ+7H5Kk2 1MDpyZEaW2d9KIdNqayOGaAhJTnUfryuDZwOOgc9hti+tYM4xEilBNJA5p0qTna49zT5Sn EuvK2IP6sTCJ2PlcPN78nl5Z0unWb+bPAyNuApUBRH6a2udHiGX/Iprn5U57zQfFJaOClP qgRmCbw8/NeTtydy4xW8OrlI+YY26GL/2x9VvG5j/Dlfs0t/C6TYln9bRhpF6XkcjxldSz 7Dc6yx4YJHxqoJq7EckIrqJrjDEArWWvARIas107zuhVg2u6w4BobESJEBhirg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710890150; a=rsa-sha256; cv=none; b=vupTxXNG1GvuQbHY32EX9n87r/QmfIQuiAYwz4ZSniokbouLhWQG8DjcYAqJvbP7bYmMq0 /Erm+w4ZwkrTAPW074Oa6RqW2BIRw8TxaO5vp9+ZoN+mpz8eijMEi2B5opEaQYbwR6LPKC 7iX6XLVMDpcZfMilKDBSkBS+uRwod4d8XtewTTfhbiI7nTrGSCxfS8enFrzN0e9Vz8+ygI LsNb4+NR/FD5OrJGVCn2Pzz9vR7ejVnWA3+zyR8Cw9vAOw24Y/pbLRVE5Ww9UGg+roawfx nXUOLfS0+Cpi0guI9ev72b9UNDOHwGNaI8gDnrUX6zrTWJAW1KJMC8rZVDj50w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710890150; 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=OFlvVIro0EWEe3mQcYwt5fD49Vo0CNSnIctk1/HDDBk=; b=V+2IzdCx+0xQQ9NmjXbmm7E7vC2pnqj4EDKTo4Vp45tjvNZMSdRt/dW6W9B4i5WifUwTGU X2jqPc2Gq2IDyvkjjVmwmYn+6isNwjhZwGCUo23PZVD93ZCe7eq6Qmz9mUMOWdyAeqec2f 5MOjJQEkKdxkJi2vAzKF0kIFWgJiCF7XxfembMoGjwIxom6h1gdW1jqnmot5GRnspClEYq m5yH8HseLYhis73XjFgEWFqB1SevZJmUZg/eN2XPL1hWaYDIdI17dbxUX/5pmZ6054n96F 5vXeGNKhJpw6Mlb63zPvpL9lpz3lA0d1I8lMvzu8NOrbDzgO4SQ4msRwBSgoJw== 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 4Tzndd6lwDzRJ7; Tue, 19 Mar 2024 23:15:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42JNFnJY078909; Tue, 19 Mar 2024 23:15:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42JNFn0X078906; Tue, 19 Mar 2024 23:15:49 GMT (envelope-from git) Date: Tue, 19 Mar 2024 23:15:49 GMT Message-Id: <202403192315.42JNFn0X078906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: fba329a195e8 - main - Define stack_t in sys/_sigaltstack.h 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: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fba329a195e8cfd52a0c59314d40f0143f32af10 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=fba329a195e8cfd52a0c59314d40f0143f32af10 commit fba329a195e8cfd52a0c59314d40f0143f32af10 Author: Brooks Davis AuthorDate: 2024-03-19 00:24:37 +0000 Commit: Brooks Davis CommitDate: 2024-03-19 23:13:25 +0000 Define stack_t in sys/_sigaltstack.h The sigaltstack(2) definition needs this type so make it available without all of sys/signal.h. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44383 --- sys/sys/_sigaltstack.h | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/signal.h | 24 +------------------ 2 files changed, 66 insertions(+), 23 deletions(-) diff --git a/sys/sys/_sigaltstack.h b/sys/sys/_sigaltstack.h new file mode 100644 index 000000000000..d1378eeeec4f --- /dev/null +++ b/sys/sys/_sigaltstack.h @@ -0,0 +1,65 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1982, 1986, 1989, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS__SIGALTSTACK_H_ +#define _SYS__SIGALTSTACK_H_ + +#include + +#if __XSI_VISIBLE +#if __BSD_VISIBLE +#define __stack_t sigaltstack +#endif +typedef struct __stack_t stack_t; + +#define SS_ONSTACK 0x0001 /* take signal on alternate stack */ +#define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ +#define MINSIGSTKSZ __MINSIGSTKSZ /* minimum stack size */ +#define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ +#endif + +/* + * Structure used in sigaltstack call. Its definition is always + * needed for __ucontext. If __BSD_VISIBLE is defined, the structure + * tag is actually sigaltstack. + */ +struct __stack_t { + void *ss_sp; /* signal stack base */ + __size_t ss_size; /* signal stack length */ + int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ +}; + +#endif /* !_SYS__SIGALTSTACK_H_ */ diff --git a/sys/sys/signal.h b/sys/sys/signal.h index 0ab2a205a92c..6112b69886f3 100644 --- a/sys/sys/signal.h +++ b/sys/sys/signal.h @@ -40,6 +40,7 @@ #include #include #include +#include #include /* __MINSIGSTKSZ */ #include /* sig_atomic_t; trap codes; sigcontext */ @@ -426,29 +427,6 @@ typedef __sighandler_t *sig_t; /* type of pointer to a signal function */ typedef void __siginfohandler_t(int, struct __siginfo *, void *); #endif -#if __XSI_VISIBLE -#if __BSD_VISIBLE -#define __stack_t sigaltstack -#endif -typedef struct __stack_t stack_t; - -#define SS_ONSTACK 0x0001 /* take signal on alternate stack */ -#define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ -#define MINSIGSTKSZ __MINSIGSTKSZ /* minimum stack size */ -#define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ -#endif - -/* - * Structure used in sigaltstack call. Its definition is always - * needed for __ucontext. If __BSD_VISIBLE is defined, the structure - * tag is actually sigaltstack. - */ -struct __stack_t { - void *ss_sp; /* signal stack base */ - __size_t ss_size; /* signal stack length */ - int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ -}; - #if __BSD_VISIBLE /* * 4.3 compatibility: