From owner-freebsd-questions Mon Jan 10 22:39:25 2000 Delivered-To: freebsd-questions@freebsd.org Received: from alpha.pit.adelphia.net (alpha.pit.adelphia.net [24.48.44.2]) by hub.freebsd.org (Postfix) with ESMTP id D8AF515415 for ; Mon, 10 Jan 2000 22:39:21 -0800 (PST) (envelope-from evstiounin@adelphia.net) Received: from evstiouninadelphia (surf15-211.pit.adelphia.net [24.48.53.211]) by alpha.pit.adelphia.net (8.9.2/8.9.2) with SMTP id BAA09288; Tue, 11 Jan 2000 01:38:59 -0500 (EST) Message-ID: <010c01bf5bfe$f0ac2ea0$d3353018@evstiouninadelphia.net.pit.adelphia.net> From: "Mikhail Evstiounin" To: "Laurence Berland" , Subject: Re: Giving a sighandler more information Date: Tue, 11 Jan 2000 01:41:42 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----Original Message----- From: Laurence Berland To: freebsd-questions@FreeBSD.ORG Date: Monday, January 10, 2000 10:22 PM Subject: Re: Giving a sighandler more information > > >Oliver Fromme wrote: > >> >> I'm afraid there is no other way than using global variables. >> Be sure to declare them as ``volatile sig_atomic_t''. >> >What does this do as compared to declaring them normally? > about volatile - quote from "C++ programming Language, third edition" by Bjarne Stroustrup: ----------------------------- A volatile specifier is a hint to a compiler that an object may change its value in ways not specified by the language so that aggresive optimiation must be avoided. For example, a real time clock might be declared: extern const volatile clock; ------------------------------ I don't think that for regular sighandler you need to declare a variable with specifier "volatile". Usually, if you are in handler, you can mask all other signals which can change your global variable and you don't need sig_atomic_t, but it's safe to use it (in my mind). >-- >Laurence Berland, Stuyvesant HS Debate ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> >Windows 98: n. > useless extension to a minor patch release for > 32-bit extensions and a graphical shell for a > 16-bit patch to an 8-bit operating system > originally coded for a 4-bit microprocessor, > written by a 2-bit company that can't stand for > 1 bit of competition. >http://stuy.debate.net >icq #7434346 aol imer E1101 >The above email Copyright (C) 1999 Laurence Berland >All rights reserved > > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message