From owner-freebsd-questions@FreeBSD.ORG Mon May 24 07:53:00 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B63CC16A4CE for ; Mon, 24 May 2004 07:53:00 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47D1E43D31 for ; Mon, 24 May 2004 07:53:00 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i4OEpnj6059491; Mon, 24 May 2004 09:51:49 -0500 (CDT) (envelope-from dan) Date: Mon, 24 May 2004 09:51:49 -0500 From: Dan Nelson To: Arne Dirks Message-ID: <20040524145148.GD72502@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-questions@freebsd.org Subject: Re: sigset_t X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2004 14:53:00 -0000 In the last episode (May 24), Arne Dirks said: > I have just coded something on my Mac with signal funcionalities. On > my machine (OS X 10.3) it compiles without problems, but on a FreeBSD > 5.2.1 machine I get an error. The compiler says: > > main.c:10: error: invalid initializer > *** Error code 1 > > > My Code was: > > 10: sigset_t sig = SIGALRM; sigset_t is a signal set, which I believe is a bitmap internally. SIGALRM is just a number. You must use the functions listed in the sigsetops manpage to manipulate signal sets. The correct code for your case would be something like: sigset_t sig; sigemptyset(&sig); sigaddset(&sig, SIGALRM); -- Dan Nelson dnelson@allantgroup.com