From nobody Sat Apr 09 21:48:24 2022 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 0FC321A8AFF3; Sat, 9 Apr 2022 21:48:25 +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 4KbTJS4gvdz4dZM; Sat, 9 Apr 2022 21:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649540904; 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=iu4BzvJ93bk5CU2AqU8H8n4DgoiwFwAxyQIDeZl4qSE=; b=bc+s/LDLKkxTyZGWQGmGY16dEdoFRf1wFKhe7KaFb5AdKaEoZBi9ncbh0DJjfZiwaVcTUG tOKqVoLnhiwaZ0+DeU1mX7vHKRfmgIC98hVY8DsySC7Smk/IymiS4ppmJLMK/PTxnAlVF1 p9Uzdx0CH4VbddpZyHIuK/ANolfaYCYv2RXESuakQuHY97wOxCu3ehDdMrZPlUUKd7Bse/ IQ75W6NNZUP1rB5jY81G0pof68FVn1XsEonBazR6hDN0SEuTN+l6/tq4fWCVqLphOS/H5U bKfcW+c9x7clQZIL1HDGeSswBZSQl9s1cyGDl3pbbSrC0uk8Z8qEuRjiNVnOiA== 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 2C330217F8; Sat, 9 Apr 2022 21:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 239LmOrR093139; Sat, 9 Apr 2022 21:48:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 239LmOv4093138; Sat, 9 Apr 2022 21:48:24 GMT (envelope-from git) Date: Sat, 9 Apr 2022 21:48:24 GMT Message-Id: <202204092148.239LmOv4093138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 50d3c72558f2 - main - libprocstat: document procstat_getadvlock(3) 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50d3c72558f2d0c0ae0a037813a9af420935b538 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649540904; 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=iu4BzvJ93bk5CU2AqU8H8n4DgoiwFwAxyQIDeZl4qSE=; b=w1+5hPRIHHqacP3pZynWAq7uYNYvw7aYbFCIa8AnR1suSTx0fVLe5e/c9zV9BRoODt3CLw YQgo4vlShEJ0wNSh9vSHqGmIQpdpzKKrAnBvsiNCyJinpsGjxQsZGtCuetxF9bnV4fioDG 5e8y4ZBnATH9mTR5iL+gf50jYXhw9I+gv7tYAomCWSCN30G39RmDbRcuvvup62nfGFkbGN yHXSGcL5twwW6xzx+P7CSeG8vOixWPr1lM+sKt40ipDjuEimksz0SjXySiDwHyz6eQkdRd +lWM2pyqX9+d28fM5mqIzciZHIwSS3QohzFxiL1q7OpGWk3tSVbW/SSKMOyu5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649540904; a=rsa-sha256; cv=none; b=ZgXqjKlMddkZ12DssV84TR0i3D2m0haO114CGPZSyVbClma8vUsEA0JWNi3Dw7UMv7caWa 8w3IWe6E/jEaTj2UeTcgnqf+bFKtvSUqrErxqptSu7uzJcQKgfuhDHmb7EDc5NLrOmHcr0 W2CUYxMbRBPEkNorbcWcG7aWvFzgPhw5MMYCaicLkibdhMsZnSvCGwWFSz9Q/aDC7I1c9b ymFSorSKFbFeowZwyEjg0Q/lNQ88sT63223cdVbXWGJSHXgkxAh2IUZuy3rastG71URq8C q+Gv22Bspmn47B2s3Tn07IXek5N6Zj96wmR9xmJ3USn7SBSzwO/Fzpi2zLsNpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=50d3c72558f2d0c0ae0a037813a9af420935b538 commit 50d3c72558f2d0c0ae0a037813a9af420935b538 Author: Konstantin Belousov AuthorDate: 2022-04-03 14:54:27 +0000 Commit: Konstantin Belousov CommitDate: 2022-04-09 21:47:49 +0000 libprocstat: document procstat_getadvlock(3) Reviewed by: markj, rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34756 --- lib/libprocstat/libprocstat.3 | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/libprocstat/libprocstat.3 b/lib/libprocstat/libprocstat.3 index 20d86a57217c..89ccdb245617 100644 --- a/lib/libprocstat/libprocstat.3 +++ b/lib/libprocstat/libprocstat.3 @@ -24,11 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2020 +.Dd April 3, 2022 .Dt LIBPROCSTAT 3 .Os .Sh NAME .Nm procstat_close , +.Nm procstat_freeadvlock , .Nm procstat_freeargv , .Nm procstat_freeauxv , .Nm procstat_freeenvv , @@ -44,6 +45,7 @@ .Nm procstat_get_shm_info , .Nm procstat_get_socket_info , .Nm procstat_get_vnode_info , +.Nm procstat_getadvlock , .Nm procstat_getargv , .Nm procstat_getauxv , .Nm procstat_getenvv , @@ -71,6 +73,8 @@ .Ft void .Fn procstat_close "struct procstat *procstat" .Ft void +.Fn procstat_freeadvlock "struct procstat *procstat" "struct advlock_list *list" +.Ft void .Fo procstat_freeargv .Fa "struct procstat *procstat" .Fc @@ -152,6 +156,10 @@ .Fa "struct vnstat *vn" .Fa "char *errbuf" .Fc +.Ft "struct advlock_list *" +.Fo procstat_getadvlock +.Fa "struct procstat *procstat" +.Fc .Ft "char **" .Fo procstat_getargv .Fa "struct procstat *procstat" @@ -495,6 +503,25 @@ The caller is responsible to free the allocated memory with a subsequent function call. .Pp The +.Fn procstat_getadvlock +function returns a dynamically allocated list of +.Va struct advlock +structures, providing a snapshot of the currently +acquired advisory locks in the system. +Both locally acquired POSIX ( +.Xr fcntl 2 ) +and BSD-style ( +.Xr flock 2 ) +locks are reported, as well as locks established by remote file +system protocols. +For each lock, unique identifiers for the locked file and its mount point +are guaranteed to be provided. +If a path for the locked file can be reconstructed, it is provided as well. +The returned list must be freed with the +.Fn procstat_freeadvlock +function. +.Pp +The .Fn procstat_get_pipe_info , .Fn procstat_get_pts_info , .Fn procstat_get_sem_info ,