git: deb674c402c8 - stable/13 - sys/user.h: Add kinfo_lockf structure to report advisory locks

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sat, 16 Apr 2022 02:18:42 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=deb674c402c8e9161988f6032e0b966393df8927

commit deb674c402c8e9161988f6032e0b966393df8927
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-04-01 21:19:35 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-04-16 02:18:18 +0000

    sys/user.h: Add kinfo_lockf structure to report advisory locks
    
    (cherry picked from commit 6ead1379fd42d96b57d58d338dae10b2e73fd8d8)
---
 sys/sys/user.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/sys/sys/user.h b/sys/sys/user.h
index 14471c91572f..aa1b02ad6192 100644
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -452,6 +452,28 @@ struct kinfo_file {
 	char		kf_path[PATH_MAX];	/* Path to file, if any. */
 };
 
+struct kinfo_lockf {
+	int		kl_structsize;		/* Variable size of record. */
+	int		kl_rw;
+	int		kl_type;
+	int		kl_pid;
+	int		kl_sysid;
+	int		kl_pad0;
+	uint64_t	kl_file_fsid;
+	uint64_t	kl_file_rdev;
+	uint64_t	kl_file_fileid;
+	off_t		kl_start;
+	off_t		kl_len;			/* len == 0 till the EOF */
+	char		kl_path[PATH_MAX];
+};
+
+#define	KLOCKF_RW_READ		0x01
+#define	KLOCKF_RW_WRITE		0x02
+
+#define	KLOCKF_TYPE_FLOCK	0x01
+#define	KLOCKF_TYPE_PID		0x02
+#define	KLOCKF_TYPE_REMOTE	0x03
+
 /*
  * The KERN_PROC_VMMAP sysctl allows a process to dump the VM layout of
  * another process as a series of entries.