Date: Mon, 5 Jan 2009 21:46:59 +0100 From: Patrick =?ISO-8859-15?Q?Lamaizi=E8re?= <patfbsd@davenulle.org> To: freebsd-questions@freebsd.org, Edward King <zhangsc@neusoft.com> Subject: Re: why printf() don't work? Message-ID: <20090105214659.125f55a2@baby-jane-lamaiziere-net.local> In-Reply-To: <022201c96f07$553b65a0$3f83a8c0@user863c0bf569> References: <022201c96f07$553b65a0$3f83a8c0@user863c0bf569>
next in thread | previous in thread | raw e-mail | index | archive | help
Le Mon, 05 Jan 2009 15:29:23 +0800, Edward King <zhangsc@neusoft.com> a écrit : > I use FreeBSD7.0,and use signal,like follows: > signal(SIGHUP,sig_hup); > signal(SIGIO,sig_io); > > when I run call following code,it can run,but I find a puzzled > question,it should print some information,such as printf("execute > main()") will print execute main(),but in fact,printf fuction print > none!!! Why printf function do not go work? Just to be sure : You should not use printf() in a signal handler, it is not considered 'signal safe'. (See man sigaction) Regards.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090105214659.125f55a2>