From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id UKD8Eg/Tt2Wf1AAA62LTzQ:P1 (envelope-from ) for ; Mon, 29 Jan 2024 17:32:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id UKD8Eg/Tt2Wf1AAA62LTzQ (envelope-from ) for ; Mon, 29 Jan 2024 17:32:15 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=p0U5uBnk; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706545935; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=QNYF5TSOFSpcyJoyeDLnMblRu8CE2R8Rq2xNoo8ERE0=; b=RoF17XyJoVcqbFDDxMARhz/MskcWbUYKJPttbRmyKtG8JxKaRB3B1P+Xc5sniMsSA5N/6/ mXyrWR/NQN9NGSHfJV94rAuqmFaS9SWCOsKvNLVQ96d8ueBlyhcx1gB0OgsHMx9vVj/Qrk hZW/uk+gY+MyrSoiMkMqMEd9lhq9Rx7Ew4eQ6oEMgT+9KMRrAY8/CYRDIA7qHzpCSp8YK7 pnPCFeai1u+HEc2IgYqs588e7WfgT1RBK952D0leow07rhWvJYvb5PMIfKSNW0hfoAZioW x/Vm8zBQ9Q6VUW8fpsdpoRr4A/icJILXNDcA4exI7NU6iSIVTsEkXUZ2qxpNnw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=p0U5uBnk; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706545935; a=rsa-sha256; cv=none; b=m3y67NYo/34SeIGuLimyJ8oXLZtkR87bHl7HwcElq9HJ7pGxGrW7J+5QEhjd5zlV8gnwo7 PGrUZCWxBjAtZ0bIusyblidsLjjh7wRB7Q7JkOIPstzWbgcYjtct6VHHHCLFfNrOeqlF0H TUgYfGBKxVDiEgShrC20PMfMpRgmSOkMcnPOO4k2qEe0+9I+hsHT2YYWmujJ+oUU3E+ngm NZKCxahquDJswygKOysUip1FxscrDspqFZdFuuFL2jHO45vgW8D8g/C+NGh1Uhu2caOYNn Jz+hTLwTBgwLZGDHAkpAfU7OgxKXESvIXEmdUmklZZizIAlsbXIiN2NrnavLkw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 377D41A6BD for ; Mon, 29 Jan 2024 17:32:15 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUUXs-0005G3-9B; Mon, 29 Jan 2024 11:31:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUUXp-0005CP-KF for guix-devel@gnu.org; Mon, 29 Jan 2024 11:31:39 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUUXp-0007uM-Bn for guix-devel@gnu.org; Mon, 29 Jan 2024 11:31:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=QNYF5TSOFSpcyJoyeDLnMblRu8CE2R8Rq2xNoo8ERE0=; b=p0U5uBnkDI+10EBF1+SW KK2//zOwn3BS63SYLCRc+BAZGSt+w61tO0I4xdHScKIIT63rrhCzNDGnD8OO51t9mlR8ejOg2p+FG npTI0d4pRiwZ4YoZexkJ3iSFknPEfSKe9HcOXQ0TmCPGtZmX20YpZ10HdZOFuWtobxuhXAuTDqxxv y9lgXBWwoX+08eL1Av7TDk5zROHE1uldjPYpI7dA85xfTGFbL968oS69LL0eJfwv/FlJ/tZSfR3lY 6zFFmTn5jzAkm6JLDMaN9DE2rH87438QLO4OGplQbS+8DeU3b9R7EhQSeOLtynd8M1vK93rFOhuDz TQ9LEyiXLYQIIQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: guix-devel@gnu.org Subject: Re: GNU Shepherd 0.10.3 released In-Reply-To: (Tomas Volf's message of "Thu, 11 Jan 2024 14:12:51 +0100") References: <87sf39ck1w.fsf@gnu.org> <878r4yw06f.fsf@gnu.org> <87y1cwnit8.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 10 =?utf-8?Q?Pluvi=C3=B4se?= an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de la =?utf-8?Q?Cogn=C3=A9e?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 29 Jan 2024 17:31:33 +0100 Message-ID: <87plxkm78a.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.90 X-Spam-Score: -9.90 X-Migadu-Queue-Id: 377D41A6BD X-Migadu-Scanner: mx12.migadu.com X-TUID: Co6OTtPfzjx6 Hi, Tomas Volf <~@wolfsden.cz> skribis: > Ah, that code indeed returns #f for the pid in question: > > scheme@(guix-user)> ((@@ (guix build syscalls) kernel?) 688) > $1 =3D #f > > The stat file: > > $ cat /proc/688/stat > 688 (mt76-tx phy0) S 2 0 0 0 -1 2129984 0 0 0 0 0 0 0 0 -2 0 1 0 964 = 0 0 18446744073709551615 0 0 0 0 0 0 0 2147483647 0 0 0 0 17 5 1 1 0 0 0 0 = 0 0 0 0 0 0 0 > > So the start_code is not zero (I would guess it is -1). I have no idea w= hat > that means though. What about this method (from shepherd)? --8<---------------cut here---------------start------------->8--- (define (linux-process-flags pid) "Return the process flags of @var{pid} (or'd @code{PF_} constants), assum= ing the Linux /proc file system is mounted; raise a @code{system-error} excepti= on otherwise." (call-with-input-file (string-append "/proc/" (number->string pid) "/stat") (lambda (port) (define line (get-string-all port)) ;; Parse like systemd's 'is_kernel_thread' function. (let ((offset (string-index line #\)))) ;offset past 'tcomm' field (match (and offset (string-tokenize (string-drop line (+ offset 1)))) ((state ppid pgrp sid tty-nr tty-pgrp flags . _) (or (string->number flags) 0)) (_ 0)))))) ;; Per-process flag defined in . (define PF_KTHREAD #x00200000) ;I am a kernel thread (define (linux-kernel-thread? pid) "Return true if @var{pid} is a Linux kernel thread." (=3D PF_KTHREAD (logand (linux-process-flags pid) PF_KTHREAD))) --8<---------------cut here---------------end--------------->8--- If it works better, we can use that in syscalls.scm as well. Ludo=E2=80=99. PS: Having an entry in bug-guix would ensure we don=E2=80=99t lose track of= this.