From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 18 15:21:35 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D7CD16A418 for ; Sun, 18 Nov 2007 15:21:35 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from thumbler.kulnet.kuleuven.ac.be (thumbler.kulnet.kuleuven.ac.be [134.58.240.45]) by mx1.freebsd.org (Postfix) with ESMTP id 016C613C45D for ; Sun, 18 Nov 2007 15:21:34 +0000 (UTC) (envelope-from tijl@ulyssis.org) Received: from localhost (localhost [127.0.0.1]) by thumbler.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 49AE4138558; Sun, 18 Nov 2007 15:56:33 +0100 (CET) Received: from smtps01.kuleuven.be (smtpshost01.kulnet.kuleuven.be [134.58.240.74]) by thumbler.kulnet.kuleuven.ac.be (Postfix) with ESMTP id 0A9851383AE; Sun, 18 Nov 2007 15:56:32 +0100 (CET) Received: from kalimero.kotnet.org (kalimero.kotnet.org [10.4.16.222]) by smtps01.kuleuven.be (Postfix) with ESMTP id 9368031E702; Sun, 18 Nov 2007 15:56:31 +0100 (CET) Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1]) by kalimero.kotnet.org (8.14.2/8.14.1) with ESMTP id lAIEuVQD003471; Sun, 18 Nov 2007 15:56:31 +0100 (CET) (envelope-from tijl@ulyssis.org) X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Tijl Coosemans To: kozlov_n@epitech.net Date: Sun, 18 Nov 2007 15:56:29 +0100 User-Agent: KMail/1.9.7 References: <1195315431.6172.13.camel@tonyhawk.epitech.net> <200711181334.41654.tijl@ulyssis.org> <20071118143941.bl0onxxsn4wkgg8g@webmail.epitech.net> In-Reply-To: <20071118143941.bl0onxxsn4wkgg8g@webmail.epitech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200711181556.30559.tijl@ulyssis.org> X-Virus-Scanned: by KULeuven Antivirus Cluster Cc: freebsd-hackers@freebsd.org Subject: Re: need help with sigaction and siginfo_t X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2007 15:21:35 -0000 On Sunday 18 November 2007 14:39:41 kozlov_n@epitech.net wrote: > Tijl Coosemans a =E9crit : >> On Saturday 17 November 2007 17:03:51 nikita kozlov wrote: >>> I'm a student and we are working on FreeBSD. >>> My problem is i don't understand how to use SA_SIGINFO and >>> siginfo_t. The following code caught my SIGUSR1 with a "kill -30 >>> my_server_pid" from my shell. >>> but siginfo_t is empty when i'm debugging my program with gdb. >>> my output is : >>> > pid 0 >>> and in gdb i have : >>> { >>> si_signo =3D 30, >>> si_errno =3D 0, >>> si_code =3D 0, >>> si_pid =3D 0, >>> si_uid =3D 0, >>> si_status =3D 0, >>> si_addr =3D 0x2, >>> si_value =3D {sigval_int =3D 0,sigval_ptr =3D 0x0}, >>> si_band =3D 0, >>> __spare__ =3D {0, 0, 0, 0, 0, 0, 0} >>> } >>> >>> anyone have an idea why my siginfo_t is empty please ? >> >> Well, it isn't empty. It's just that the si_pid field usually isn't >> set. It probably should be, but either way, your code should work if >> you send signals with sigqueue(2) instead of kill(2). >=20 > Thank you for the reply, > i have tried to use sigqueue but after a "undefined reference to > `sigqueue'" compilation error i have opened signal.h and found this > define :=20 >=20 > #if 0 > /* > * PR: 35924 > * XXX we don't actually have these. We set _POSIX_REALTIME_SIGNALS to= =20 > * -1 to show that we don't have them, but this symbol is not necessarily > * in scope (in the current implementation), so we can't use it here. > */ > int sigqueue(__pid_t, int, const union sigval); > #endif >=20 > I'm working on FreeBSD 5.5-RELEASE-p14, do you have any idea ? Hmm, looks like it has only been added in FreeBSD 7. If you can't upgrade, you'll have to use some more advanced IPC mechanism I'm afraid.