From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#53191: 29.0.50; file-notify-add-watch fails for socket files on MacOS Date: Wed, 12 Jan 2022 10:01:55 +0100 Message-ID: <87mtk1pbss.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24944"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 53191@debbugs.gnu.org To: "Troy de Freitas" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 12 10:07:58 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7Zbo-0006Hq-U5 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Jan 2022 10:07:56 +0100 Original-Received: from localhost ([::1]:49090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7Zbn-0000tw-T7 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Jan 2022 04:07:55 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7ZXG-00044o-4B for bug-gnu-emacs@gnu.org; Wed, 12 Jan 2022 04:03:14 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n7ZX3-000758-Lx for bug-gnu-emacs@gnu.org; Wed, 12 Jan 2022 04:03:13 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n7ZX3-0004E8-JQ for bug-gnu-emacs@gnu.org; Wed, 12 Jan 2022 04:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Jan 2022 09:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53191 X-GNU-PR-Package: emacs Original-Received: via spool by 53191-submit@debbugs.gnu.org id=B53191.164197813216172 (code B ref 53191); Wed, 12 Jan 2022 09:03:01 +0000 Original-Received: (at 53191) by debbugs.gnu.org; 12 Jan 2022 09:02:12 +0000 Original-Received: from localhost ([127.0.0.1]:56238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7ZWG-0004Cl-2L for submit@debbugs.gnu.org; Wed, 12 Jan 2022 04:02:12 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:39811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n7ZWE-0004CU-7v for 53191@debbugs.gnu.org; Wed, 12 Jan 2022 04:02:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1641978121; bh=X70y8dEUOg1P6dm+im+pKh04ErvmwaVIIXulZnWZ9MU=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=fu1D/jV5DXUVpu3D3NVFzIm03QYquIskh47NN69ZbOPpL51QzD3C64MwuLCn0mwFF Y3UspYnm7UeUOfKYtvkwo6HvY7h2W7whhXd98E4WwQpmF+FiNIDNodsPfnr5UDutYW xKicuge/lne6aTwWU50ZGFnwgQho/RYmlcnAzUcE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([213.220.149.188]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N5G9n-1mOifk2yCT-011BBp; Wed, 12 Jan 2022 10:02:01 +0100 In-Reply-To: (Troy de Freitas's message of "Tue, 11 Jan 2022 10:22:01 -0600") X-Provags-ID: V03:K1:LwgefECWdfnvleUm02RZhgfiHEURg7co3wdoiv+lDwaEd7LU+GW naNM/IPByKS6Me/yKa9PaQN35lqUDX4FyYIYrxV2peZiZ4y180rfgJk/BjEKvJ24GAkDWbH 9ExeWPy4T/52TXKVFDYzQl/YJCwgzzoEM1s1C1pypXgzj+MW0vYOSrfzT4dvSQkNOe+JpJu cR/N+zQaGliGcdyCQH6Pg== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZckTfKWSrNk=:SeE08j3IJbfSru+7x6IANB azZ+g77feb8bZ4ZCt7FWt7Ias3/a2yijx4IJsJ+GW3y5vY0tYbzqqWtlZa82Keh9W8fULBSFq vGtsk5q3R9Ndk9eHCRV520ZTw6cPh5jO+nYNTcyTBlbiVWswWyhDav+WlqzPisSRiARiuwpgv x0drQ3S0BbhQ9bPcNzczFnsioor1v4dwvHjpscyomChe75Yn9ucwg40LbcjVgTfEJjAg9N4hy dy7LnIuLFtUKqrQ0LCVdbzYGCJVi7EX/XfdXnZbyMtMLdccXHvliemfA4gh+yT+nRziaXJLQ4 fsT6yaYv5nSSaYws6zpZxL6Vy58fuYlhdg9wePRvc9F/vZ+nrFyy3fdRgWOBrEybttxa0bQ4m VFXrirJLir6O9PeydDPdexoHrWDnvOLp46PIXw0E5yZl6OopCMUtD6fz5kv8K1aTbXKvJgJ0k ZX46HslgfZXD0yuPczeSDcAiDkqMwbptzdYPMJem/3VtwOlcNJiJP0sokQ2lFZGFIsgACv+ho xj3FEA9AeIehonFrN3Abf5bh//3vZIb8w9yuGcUWqc1h58F70nKgW/LC9vX+iEaaIYMuNj4kT YhG6eAMyduaN6AedtvyiuaQiGiGpwipocfyLs3u0StaIGsKmuJmU4UIrI6dfsWX1wjv4dfbdp UZB1aGPmhGKkVS3gSIrso2kqjwu/AHzkCvTr0Rud3dae7fZxgQeQ7Fu8J4V7VIkqTfh7vZJlQ oGd/T7xeNWFAlzpPZzl+5yRyZH2RwaO9USjZdldc/XrTh954zqxPZQLL7/BGYLdUFEgWwuka X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:223991 Archived-At: "Troy de Freitas" writes: Hi Troy, > This bug affects MacOS (and most likely FreeBSD and OpenBSD as well). > On MacOS running `file-notify-add-watch' throws an error when attached to a UNIX socket > file but works fine on Linux. To reproduce, using 'emacs -Q', evaluate the following elisp: > > (let* ((sock "/tmp/netproc.sock") > (p (make-network-process > :name "test" > :family 'local > :local sock > :server t))) > (unwind-protect > (file-notify-add-watch sock '(change) > (lambda (_) (message (format "%s changed." sock)))) > (delete-process p) > (delete-file sock))) > > It throws the error: > > edebug-signal: File cannot be opened: Operation not supported on > socket, /tmp/netproc.sock > > The issue appears to be in the underlying call to `kqueue-add-watch', > which uses `openat()' (by way of `emacs_open()`) to get a > file-descriptor. According to the BSD docs for `openat()', calling > `openat()' on socket files is not supported. Thanks for the report. The incrimed behavior is due to unconditional using of the EVFILT_VNODE filter, calling EV_SET in Fkqueue_add_watch. This requires a file descriptor. I'll investigate, whether another filter, like EVFILT_READ, is better suited for sockets, using a sockfd. This might take some days, though. See kqueue(2) for details, if you're interested in. > - Troy Best regards, Michael.