From owner-freebsd-ports Sat Dec 7 19:46:58 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id TAA23712 for ports-outgoing; Sat, 7 Dec 1996 19:46:58 -0800 (PST) Received: from seagull.rtd.com (seagull.rtd.com [198.102.68.2]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id TAA23707; Sat, 7 Dec 1996 19:46:56 -0800 (PST) Received: (from dgy@localhost) by seagull.rtd.com (8.7.5/8.7.3) id UAA00214; Sat, 7 Dec 1996 20:46:54 -0700 (MST) From: Don Yuniskis Message-Id: <199612080346.UAA00214@seagull.rtd.com> Subject: signal stack? To: freebsd-hackers@freefall.FreeBSD.org (FreeBSD hackers), freebsd-ports@freefall.FreeBSD.org (FreeBSD ports) Date: Sat, 7 Dec 1996 20:46:54 -0700 (MST) X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-ports@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Greetings! I'm digging through the gcl port and a bit stumped by the role of sigaltstack(2) and the mechanisms by which the stack is created and manipulated. Some annotated code fragments... double estack_buf[SIG_STACK_SIZE]; Presumably, this is the actual stack space. Apparently, it is defined as an array of doubles (instead of chars) to force alignment on 8 byte boundaries (or so the commentary indicates)? static sigaltstack estack; estack.ss_sp = estack_buf; Aside from adding a cast to (char *) to silence pointer warning, why do ports for *other* OS's (e.g., NetBSD) explicitly reference the *end* of the "stack" in this assignment? (e.g., &estack_buf[SIG_STACK_SIZE-1]) The sigaltstack(2) man page seems to imply that this is unnecessary. Perhaps stacks are handled in a more rudimentary form in some of these other ports? estack.ss_size = SIGSTKSZ; Shouldn't this be sizeof(estack_buf)? Or, SIGSTKSZ * sizeof(double) as a hack...? estack.ss_flags = 0; if (sigaltstack(&estack, (struct sigaltstack *)0) < 0)... Sorry if these seem like no-brainers. Maybe Santa will bring me a brain for XMAS! :> Thanx! --don