From owner-freebsd-arch@freebsd.org Sun Apr 30 09:56:18 2017 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06264D569D9 for ; Sun, 30 Apr 2017 09:56:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) 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 91795A58 for ; Sun, 30 Apr 2017 09:56:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v3U9uAhW010802 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 30 Apr 2017 12:56:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v3U9uAhW010802 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v3U9uAKl010801; Sun, 30 Apr 2017 12:56:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 30 Apr 2017 12:56:10 +0300 From: Konstantin Belousov To: Drake Talley Cc: freebsd-arch@freebsd.org Subject: Re: sysctl for named posix semaphores Message-ID: <20170430095610.GS1622@kib.kiev.ua> References: <20170429154018.GA3703@kunai.nyc.rr.com> <20170430091638.GR1622@kib.kiev.ua> <20170430014100.GA30802@kunai.nyc.rr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170430014100.GA30802@kunai.nyc.rr.com> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 09:56:18 -0000 On Sat, Apr 29, 2017 at 09:41:00PM -0400, Drake Talley wrote: > Ah thanks for cleaing that up; sorry for coming at it from left field. > Really appreciate the explanation though! Note that the fact that kernel does not support 'POSIX semaphores' objects, does not make impossible to get some information about existing named semaphores for the debugging purposes. Eg. low-tech method 'ls -l /dev/SEMD*' would list files backing the named semaphores and show the ownership information. fstat(1) -m or procstat(8) -v show the processes which currently have specific semaphore open (AKA mapped). Current state of the semaphore can be inspected with any file dump tool, even with hexdump(1). Anonymous semaphores are somewhat harder to observe.