From nobody Sat Feb 03 01:36:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRZx361H1z58kRx; Sat, 3 Feb 2024 01:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TRZx34tyqz4QgN; Sat, 3 Feb 2024 01:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706924183; h=from:from: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; bh=NOT+upekJL5sFms7Vp8Yw3qkWCmk1btbZ6QnH5ktslo=; b=HwPl1gbYbZO6f0A+17O2vMwFiHeft36Iq6AztXS1lLZsiBwl5t4GnYDJxC/UH8fyD9K4aH j6mAFkvTrNuXHHVGdGn8HoWgyeXCnHM3QOdUMqM8Bc+7TfKPxpGVWLNvqFCcASv5pypb+T Ljm7lUFHjOt6u9nolN/c8upaiRr1Q05rbt5r+Pb7an994ck6V8x4PRplIiwXMRxXcNf3T7 BXHXkUxd9SOAv3HA6pODyctsI9FmtdOspM+KOGYmwOuMS4AyWLmszO43orO1I7KUj1nNz2 JjBGjguRAdl3e5ZcOOuva2F/04liXdjZcBKv3SbICcNjdjLSS20lu24FAD9g5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706924183; h=from:from: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; bh=NOT+upekJL5sFms7Vp8Yw3qkWCmk1btbZ6QnH5ktslo=; b=pm14QzJt8ZsFBBYzJFlKtdWjLh06nplAvl2t616MGG+gljD1ARXfXcsmJFId7UPvzjYvP9 L77MpwXoEN6IBVJjDZP6tAsZpmxrtz+o77WCTzfuehr7O0zI7RaUSbocl0TprMrGnXoiLz eqWEolXSNAxMddjVw6smv7bGVT6adeX47zYCUbbf5p9gCw/xwWU2zkBRVIiGeATka26kky InMh81UkkPz/KUnVLup1quMdK/6bDGVtZebwKuWSD/L7fQh/yQoJm/xgvA/5HnKxdLwCZZ FFhe52nWWiW4eyoOC7z/oj6GbDhQbTDoZXU+dJ14kgH4JbCao4mPpXKDuRqvKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706924183; a=rsa-sha256; cv=none; b=CCqME3NTdQe+hgGuzRbVXtQ2IBHX4C7qr32OUEvc7tPiGSpk3QMNum4q+kGP/P1F1xSwFt q3pn9WcnrAkER0h8yA2louU8as34GH2RL18/Z0YRBCHhViHNwSgyhFdGflEPO4EES26Muo NWU2s/1Jgay0CuulaZ4cGb/au5d5C8NXkWsjxWM+fjsFizxgVUxJtE1xExDP1tASCKzsp1 +u7gAmiPfAtGnxTpyyLNbgZT9Ge727v7TmWvBiIRPJxnyzo89dPf6A3yL152QwVfo3DwF0 FtYUv8oHWet8+8ugkAYX7gMNZHBGVGUjVwzTaGdE2MORkgsnsrD7/eO/H7tzfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TRZx33jV6ztwf; Sat, 3 Feb 2024 01:36:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4131aNb1010843; Sat, 3 Feb 2024 01:36:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4131aNOH010840; Sat, 3 Feb 2024 01:36:23 GMT (envelope-from git) Date: Sat, 3 Feb 2024 01:36:23 GMT Message-Id: <202402030136.4131aNOH010840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b75fa3a2de0c - main - procfs: Add self & exe symlinks like NetBSD does List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b75fa3a2de0c9c0854ebd9a2adc75ce9e8d39bd4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b75fa3a2de0c9c0854ebd9a2adc75ce9e8d39bd4 commit b75fa3a2de0c9c0854ebd9a2adc75ce9e8d39bd4 Author: Ricardo Branco AuthorDate: 2024-02-03 00:17:52 +0000 Commit: Warner Losh CommitDate: 2024-02-03 01:34:59 +0000 procfs: Add self & exe symlinks like NetBSD does NetBSD calls "curproc" "self" and "exe" "file" for proc. Reduce gratuitous differnces by including them as well. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/976 --- share/man/man5/procfs.5 | 4 ++++ sys/fs/procfs/procfs.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/share/man/man5/procfs.5 b/share/man/man5/procfs.5 index d055faadf2c0..5977a8bced81 100644 --- a/share/man/man5/procfs.5 +++ b/share/man/man5/procfs.5 @@ -253,10 +253,14 @@ directory containing process information for process .Pa pid . .It Pa /proc/curproc directory containing process information for the current process +.It Pa /proc/self +directory containing process information for the current process .It Pa /proc/curproc/cmdline the process executable name .It Pa /proc/curproc/etype executable type +.It Pa /proc/curproc/exe +executable image .It Pa /proc/curproc/file executable image .It Pa /proc/curproc/fpregs diff --git a/sys/fs/procfs/procfs.c b/sys/fs/procfs/procfs.c index 97b04fa2bc06..ab60ba47f322 100644 --- a/sys/fs/procfs/procfs.c +++ b/sys/fs/procfs/procfs.c @@ -158,6 +158,8 @@ procfs_init(PFS_INIT_ARGS) pfs_create_link(root, "curproc", procfs_docurproc, NULL, NULL, NULL, 0); + pfs_create_link(root, "self", procfs_docurproc, + NULL, NULL, NULL, 0); dir = pfs_create_dir(root, "pid", procfs_attr_all_rx, NULL, NULL, PFS_PROCDEP); @@ -188,6 +190,8 @@ procfs_init(PFS_INIT_ARGS) pfs_create_link(dir, "file", procfs_doprocfile, NULL, procfs_notsystem, NULL, 0); + pfs_create_link(dir, "exe", procfs_doprocfile, + NULL, procfs_notsystem, NULL, 0); return (0); }