From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 22 15:07:15 2011 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 40C97106566B for ; Thu, 22 Dec 2011 15:07:15 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 197878FC1C for ; Thu, 22 Dec 2011 15:07:15 +0000 (UTC) Received: by pbcc3 with SMTP id c3so6854602pbc.13 for ; Thu, 22 Dec 2011 07:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=g4hOevBnFpuNShWZ7T/DjFwwN/c5nCFGOoW86g7zpug=; b=ejtP5oyWHPbFX9E5ndJaqD6c6Ms6z0VJRC9D1qmQjqyzg3GSHrkToLEDjVZBZWUa6Z cciP38pzAEe7vc+hePyDkusTpr+0CH5NV19H3v81fvsm9AthUSL/BgBcsFNFosyHpc/J U02T/rgwPylHPgwaQPZJ/xGHVHNPjBS33hvvU= Received: by 10.68.74.167 with SMTP id u7mr23320312pbv.103.1324564736282; Thu, 22 Dec 2011 06:38:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.77.16 with HTTP; Thu, 22 Dec 2011 06:38:34 -0800 (PST) In-Reply-To: <1324533811.54730.YahooMailClassic@web180006.mail.gq1.yahoo.com> References: <1324533811.54730.YahooMailClassic@web180006.mail.gq1.yahoo.com> From: arrowdodger <6yearold@gmail.com> Date: Thu, 22 Dec 2011 17:38:34 +0300 Message-ID: To: Sushanth Rai Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: Using kevent for signalling user app from kernel 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: Thu, 22 Dec 2011 15:07:15 -0000 On Thu, Dec 22, 2011 at 10:03 AM, Sushanth Rai wrote: > Hi, > > I'm planning to use kqueue/kevent mechanism to notify a user application > from the kernel. Basically I set up a file descriptor for read event from > the user application by calling kevent(). Now, I would like to wake-up the > process from within the kernel. The wake-up will happen due to one of the > internal events (not due to data being available to read). I have access to > the process structure and vnode corresponding to file descriptor. Is there > a mechanism available from the kernel to trigger a wakeup and clear the > kernel break notify message ? > > Thanks, > Sushanth > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > Hi. I'm not very experienced in this stuff, but you can try to look at how EVFILT_USER is handled. Specifically, take a look at what is going on when this filter is triggered from userland.