From owner-freebsd-questions@FreeBSD.ORG Sat Sep 6 16:00:10 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDA761065670 for ; Sat, 6 Sep 2008 16:00:10 +0000 (UTC) (envelope-from kr.lekha@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.224]) by mx1.freebsd.org (Postfix) with ESMTP id 800888FC12 for ; Sat, 6 Sep 2008 16:00:10 +0000 (UTC) (envelope-from kr.lekha@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1180605rvf.43 for ; Sat, 06 Sep 2008 09:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=wuRZTq7TuXLdbubcPEuQqeJtm/nA7+oElng1q/e7E+0=; b=wpBrw1u080e7H74o5Tw534q19nCt9yt6RyTGJQtTUyI1XtgH6MTM64GaQowAeFEMra 4aBxeIM/0gyQJ4K44iV+XMNjDbSGP1R7/smzsiKEawUaBnyGhZF6VGwIP3d3KHd2Vkcr CwLvq4m/zmblFAXSTI+ggTpsj8uTaO79XrQz8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=lK7shsX6KIq0GvwNNfZls4Ar9aPE/h7QOUPCIyNFuRe173mMgOVfmO6vNOLFwM2CBj cklGY3qerIR6n6ZQvs4ladfqSRdsu+uGw+3XZ3q6cHaIIy6RABOHXuShrDPsY7z8KnSb x9jmhzMR5on96bYXHZNiLkIakfv4FpT2DOvPU= Received: by 10.140.185.1 with SMTP id i1mr7518606rvf.102.1220715445370; Sat, 06 Sep 2008 08:37:25 -0700 (PDT) Received: by 10.141.212.11 with HTTP; Sat, 6 Sep 2008 08:37:25 -0700 (PDT) Message-ID: <96b2ec350809060837w33353e00ja741d6e0077b4ab0@mail.gmail.com> Date: Sat, 6 Sep 2008 16:37:25 +0100 From: "kr Lekha" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: How to Catch Signals in kernel threads X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Sep 2008 16:00:10 -0000 Hi, I wanted to kill my kernel threads created in a kernel module gracefully . I tired psignal(kthread, SIGKILL); this signal reschedules the thread. But how can this thread know that SIGKILL was called and i can exit from the thread? I tired to register a signal handler for SIGABRT / any other signal for a kthread. Can we register a signal handler for kthreads? I would appreciate if anyone can share information as to how to catch signals in kernel threads. I am developing my kernel module in FreeBSD 6.2 where kthread_create creates a proc. Thanks and best regards, Lekha