From owner-freebsd-current@freebsd.org Tue Mar 12 21:49:09 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8588153FA42 for ; Tue, 12 Mar 2019 21:49:09 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0343787A22 for ; Tue, 12 Mar 2019 21:49:08 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x2CLn0W9095431 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 12 Mar 2019 23:49:03 +0200 (EET) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x2CLn0W9095431 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x2CLn0r8095430; Tue, 12 Mar 2019 23:49:00 +0200 (EET) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Tue, 12 Mar 2019 23:49:00 +0200 From: Konstantin Belousov To: Larry Rosenman Cc: Freebsd current , Aki Tuomi Subject: Re: kqueue send over unix socket? Message-ID: <20190312214900.GW2492@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2019 21:49:09 -0000 On Tue, Mar 12, 2019 at 04:10:19PM -0500, Larry Rosenman wrote: > I'm working with Aki Tuomi of Dovecot and he asks: > > I tried to ask if you could ask from some Kernel hacker why I cannot > send kqueue() fd over unix socket, I get "Operation not supported". Right, because sending kqfd to other process does not make sense. For the same reason kqueue filedescriptors are closed on fork. Issue is that kqueue operates on file descriptors, it stores events and names them by fd you use for registration. So all registered events names become meaningless when process operates on different file descriptor table, which happens after fork() or if kqfd is passed over unix socket to other process. Technically this occurs because kqueue file ops structure does not specify DFLAG_PASSABLE. > > Can anyone help me? > > > > -- > Larry Rosenman http://www.lerctr.org/~ler > Phone: +1 214-642-9640 E-Mail: ler@lerctr.org > US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106 > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"