From nobody@FreeBSD.org  Wed Jul 25 20:55:03 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7A187106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 25 Jul 2012 20:55:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 5E26D8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 25 Jul 2012 20:55:03 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6PKt21I017081
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 25 Jul 2012 20:55:02 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q6PKt2S1017065;
	Wed, 25 Jul 2012 20:55:02 GMT
	(envelope-from nobody)
Message-Id: <201207252055.q6PKt2S1017065@red.freebsd.org>
Date: Wed, 25 Jul 2012 20:55:02 GMT
From: Maxim "WGH" <wgh@torlan.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Cannot watch UNIX sockets for "vnode" events using kqueue
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         170177
>Category:       kern
>Synopsis:       Cannot watch UNIX sockets for "vnode" events using kqueue
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 25 21:00:25 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Maxim "WGH"
>Release:        FreeBSD 8.1-RELEASE-p1
>Organization:
>Environment:
FreeBSD torlan 8.1-RELEASE-p1 FreeBSD 8.1-RELEASE-p1 #8: Sat Oct 30 23:25:06 MSD 2010     wgh@torlan:/usr/obj/usr/src/sys/TORLAN  i386
>Description:
kqueue provides a facility to watch file changes (EVFILT_VNODE). UNIX sockets are also files, they have file modes [1], they can be unlinked, etc. All these things can be watched by kqueue.

In order to do so, however, one has to provide file descriptor. 

The problem is that file descriptors for UNIX socket are essentially unobtainable. open()'ing sockets is not implemented, as it's stated in manual and seen in the source code. connect()'ed sockets also don't work, kevent() just returns EINVAL for them.

1. screen and patched dtach set the "executable" bit of socket if there're clients attached. Watching for its changes in an efficient way would be useful.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
