git: d72316320b97 - stable/15 - getfhat: Add missing 'const' to path argument

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Thu, 08 Oct 2026 20:43:53 UTC
The branch stable/15 has been updated by jhb:

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

commit d72316320b97bbd29d1cf94e97ac24164821c0b0
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-07-27 18:09:03 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-10-08 20:42:31 +0000

    getfhat: Add missing 'const' to path argument
    
    This matches the documented prototype and avoids spurious
    -Wincompatible-pointer-types-discards-qualifiers warnings when passing
    a constant pathname.
    
    Sponsored by:   AFRL, DARPA
    
    (cherry picked from commit 09da0899551a63ce3eb841e4ce4385b6e48dd4ec)
---
 sys/kern/syscalls.master | 2 +-
 sys/sys/mount.h          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 5a93ee43b00f..0ff92940bfbb 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -3158,7 +3158,7 @@
 564	AUE_NULL	STD {
 		int getfhat(
 		    int fd,
-		    _In_z_ char *path,
+		    _In_z_ const char *path,
 		    _Out_ struct fhandle *fhp,
 		    int flags
 		);
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 8636443226e7..89f712836dda 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -1245,7 +1245,7 @@ int	fhstat(const struct fhandle *, struct stat *);
 int	fhstatfs(const struct fhandle *, struct statfs *);
 int	fstatfs(int, struct statfs *);
 int	getfh(const char *, fhandle_t *);
-int	getfhat(int, char *, struct fhandle *, int);
+int	getfhat(int, const char *, struct fhandle *, int);
 int	getfsstat(struct statfs *, long, int);
 int	getmntinfo(struct statfs **, int);
 int	lgetfh(const char *, fhandle_t *);