From 136b5ded015d2a8d0b550f48fd0e2d2817435c01 Mon Sep 17 00:00:00 2001 From: Pierre Gimalac <23154723+pgimalac@users.noreply.github.com> Date: Mon, 6 Jul 2026 13:47:58 +0000 Subject: [PATCH] fix(mlock): add AIX support and tighten unavail build constraints mlock_unix.go: add aix to supported platforms (mlockall(2) and MCL_CURRENT/ MCL_FUTURE are available on AIX, and golang.org/x/sys/unix exports Mlockall for aix/ppc64). Also add the modern //go:build tag alongside the legacy // +build comment. mlock_unavail.go: switch from enumerating unsupported platforms to negating supported ones, so new platforms (like aix) are covered automatically once added to mlock_unix.go rather than requiring a separate change here. --- mlock/mlock_unavail.go | 4 ++-- mlock/mlock_unix.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mlock/mlock_unavail.go b/mlock/mlock_unavail.go index 29c927e..b2b9e01 100644 --- a/mlock/mlock_unavail.go +++ b/mlock/mlock_unavail.go @@ -1,8 +1,8 @@ // Copyright IBM Corp. 2020, 2025 // SPDX-License-Identifier: MPL-2.0 -//go:build darwin || nacl || netbsd || plan9 || windows || js -// +build darwin nacl netbsd plan9 windows js +//go:build !aix && !dragonfly && !freebsd && !linux && !openbsd && !solaris +// +build !aix,!dragonfly,!freebsd,!linux,!openbsd,!solaris package mlock diff --git a/mlock/mlock_unix.go b/mlock/mlock_unix.go index e0f6ca0..4e50e1a 100644 --- a/mlock/mlock_unix.go +++ b/mlock/mlock_unix.go @@ -1,7 +1,8 @@ // Copyright IBM Corp. 2020, 2025 // SPDX-License-Identifier: MPL-2.0 -// +build dragonfly freebsd linux openbsd solaris +//go:build aix || dragonfly || freebsd || linux || openbsd || solaris +// +build aix dragonfly freebsd linux openbsd solaris package mlock