Skip to content

Fix variable-size type mappings in mac SystemB and XAttr - #1724

Merged
dbwiddis merged 1 commit into
java-native-access:masterfrom
dbwiddis:fix-variable-size-mappings
May 12, 2026
Merged

dbwiddis merged 1 commit into
java-native-access:masterfrom
dbwiddis:fix-variable-size-mappings

Conversation

@dbwiddis

Copy link
Copy Markdown
Contributor

Fix incorrect use of long/LongByReference for pointer-sized native types in macOS bindings.

SystemB.host_page_size: The vm_size_t * parameter was mapped as LongByReference (always 64-bit). Added correct NativeLongByReference overload; deprecated the old signature.

XAttr.getxattr/setxattr/listxattr: The size_t parameters and ssize_t return values were mapped as long (always 64-bit). Added correct NativeLong overloads; deprecated the old signatures. Updated XAttrUtil to use the new methods.

These types are pointer-sized (unsigned long in C) and should be 4 bytes on 32-bit and 8 bytes on 64-bit. While macOS is effectively 64-bit-only today, JNA still supports 32-bit macOS and the mappings should be correct.

@dbwiddis
dbwiddis force-pushed the fix-variable-size-mappings branch from 8c45049 to 4ab4109 Compare May 12, 2026 03:51
@dbwiddis
dbwiddis force-pushed the fix-variable-size-mappings branch from 4ab4109 to 4450bf9 Compare May 12, 2026 18:27
host_page_size used LongByReference for vm_size_t* which is
pointer-sized. Add correct NativeLongByReference overload and
deprecate the old one.

XAttr getxattr/setxattr/listxattr used long for size_t/ssize_t
parameters and return values. Add correct NativeLong overloads
and deprecate the old ones. Update XAttrUtil to use the new
methods.
@dbwiddis
dbwiddis force-pushed the fix-variable-size-mappings branch from 4450bf9 to 95d793e Compare May 12, 2026 18:30

@matthiasblaesing matthiasblaesing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dbwiddis
dbwiddis merged commit 7897cc7 into java-native-access:master May 12, 2026
12 checks passed
@dbwiddis
dbwiddis deleted the fix-variable-size-mappings branch May 12, 2026 18:55
markharding pushed a commit to futo-org/Harbor that referenced this pull request Oct 23, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [net.java.dev.jna:jna](https://github.com/java-native-access/jna) | `5.18.1` → `5.19.1` | ![age](https://developer.mend.io/api/mc/badges/age/maven/net.java.dev.jna:jna/5.19.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/net.java.dev.jna:jna/5.18.1/5.19.1?slim=true) |

---

### Release Notes

<details>
<summary>java-native-access/jna (net.java.dev.jna:jna)</summary>

### [`v5.19.1`](https://github.com/java-native-access/jna/blob/HEAD/CHANGES.md#Release-5191)

[Compare Source](java-native-access/jna@5.19.0...5.19.1)

\==============

## Bug Fixes

- [#&#8203;1730](java-native-access/jna#1730): Replace usage of `MethodHandle` with reflection to restore support for older Android releases - [@&#8203;matthiasblaesing](https://github.com/matthiasblaesing).

### [`v5.19.0`](https://github.com/java-native-access/jna/blob/HEAD/CHANGES.md#Release-5190)

[Compare Source](java-native-access/jna@5.18.1...5.19.0)

\==============

## Features

- [#&#8203;1696](java-native-access/jna#1696): Add `LARGE_INTEGER.ByValue` to `LARGE_INTEGER` in `WinNT.java` - [@&#8203;baier233](https://github.com/baier233).
- [#&#8203;1697](java-native-access/jna#1697): Add WlanApi module - [@&#8203;eranl](https://github.com/eranl).
- [#&#8203;1718](java-native-access/jna#1718): Add `Cups` to `c.s.j.p.unix` providing CUPS printing system bindings for destinations, jobs, options, and server configuration - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1720](java-native-access/jna#1720): Add `groupCount` and `groupMasks` fields to `CACHE_RELATIONSHIP` in `c.s.j.p.win32.WinNT`, matching the updated Windows struct layout - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1719](java-native-access/jna#1719): Add `CoreGraphics` to `c.s.j.p.mac` with Quartz Window Services and Display Services bindings; implement `getAllWindows()` in `MacWindowUtils` - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1723](java-native-access/jna#1723): Add `ProcFdInfo`, `InSockInfo`, `TcpSockInfo`, `proc_pidfdinfo`, `statfs64`, and `vm_deallocate` to `c.s.j.p.mac.SystemB` - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1725](java-native-access/jna#1725): Add `BluetoothApis` to `c.s.j.p.win32` providing Bluetooth device and radio enumeration via `BluetoothFindFirstRadio`, `BluetoothFindFirstDevice`, and related functions - [@&#8203;dbwiddis](https://github.com/dbwiddis).

## Bug Fixes

- [#&#8203;1644](java-native-access/jna#1644): Fix bug in VARDESC and TYPEDESC causing an illegal memory access - [@&#8203;lwahonen](https://github.com/lwahonen)
- [#&#8203;1715](java-native-access/jna#1715): Fix `UdevDevice.getSysname()` calling `udev_device_get_syspath` instead of `udev_device_get_sysname` - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1721](java-native-access/jna#1721): Fix switched `serverName`/`domainName` arguments in `Netapi32Util#getDCName` - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1722](java-native-access/jna#1722): Fix `Advapi32#RegisterServiceCtrlHandler` using wrong `Handler` type - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1636](java-native-access/jna#1636): Drop hard dependency on java.lang.SecurityManager/java.security.AccessController - [@&#8203;matthiasblaesing](https://github.com/matthiasblaesing).
- [#&#8203;1724](java-native-access/jna#1724): Fix `host_page_size` in `c.s.j.p.mac.SystemB` and `getxattr`/`setxattr`/`listxattr` in `c.s.j.p.mac.XAttr` using `long` instead of pointer-sized types for `size_t`/`ssize_t` parameters - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1727](java-native-access/jna#1727): Include DragonFlyBSD in `NativeLibrary` versioned library resolution, libc special-case loading, and 64-bit search paths - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1709](java-native-access/jna#1709): Rebuild native library for OpenBSD 7.9 x86-64, drop OpenBSD x86 - [@&#8203;matthiasblaesing](https://github.com/matthiasblaesing).

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 9am on tuesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzMuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE3NS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://code.futo.org/harbor/harbor/pulls/1820
Reviewed-by: Mark Harding <[email protected]>
markharding pushed a commit to futo-org/Harbor that referenced this pull request Oct 29, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [net.java.dev.jna:jna](https://github.com/java-native-access/jna) | `5.18.1` → `5.19.1` | ![age](https://developer.mend.io/api/mc/badges/age/maven/net.java.dev.jna:jna/5.19.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/net.java.dev.jna:jna/5.18.1/5.19.1?slim=true) |

---

### Release Notes

<details>
<summary>java-native-access/jna (net.java.dev.jna:jna)</summary>

### [`v5.19.1`](https://github.com/java-native-access/jna/blob/HEAD/CHANGES.md#Release-5191)

[Compare Source](java-native-access/jna@5.19.0...5.19.1)

\==============

## Bug Fixes

- [#&#8203;1730](java-native-access/jna#1730): Replace usage of `MethodHandle` with reflection to restore support for older Android releases - [@&#8203;matthiasblaesing](https://github.com/matthiasblaesing).

### [`v5.19.0`](https://github.com/java-native-access/jna/blob/HEAD/CHANGES.md#Release-5190)

[Compare Source](java-native-access/jna@5.18.1...5.19.0)

\==============

## Features

- [#&#8203;1696](java-native-access/jna#1696): Add `LARGE_INTEGER.ByValue` to `LARGE_INTEGER` in `WinNT.java` - [@&#8203;baier233](https://github.com/baier233).
- [#&#8203;1697](java-native-access/jna#1697): Add WlanApi module - [@&#8203;eranl](https://github.com/eranl).
- [#&#8203;1718](java-native-access/jna#1718): Add `Cups` to `c.s.j.p.unix` providing CUPS printing system bindings for destinations, jobs, options, and server configuration - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1720](java-native-access/jna#1720): Add `groupCount` and `groupMasks` fields to `CACHE_RELATIONSHIP` in `c.s.j.p.win32.WinNT`, matching the updated Windows struct layout - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1719](java-native-access/jna#1719): Add `CoreGraphics` to `c.s.j.p.mac` with Quartz Window Services and Display Services bindings; implement `getAllWindows()` in `MacWindowUtils` - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1723](java-native-access/jna#1723): Add `ProcFdInfo`, `InSockInfo`, `TcpSockInfo`, `proc_pidfdinfo`, `statfs64`, and `vm_deallocate` to `c.s.j.p.mac.SystemB` - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1725](java-native-access/jna#1725): Add `BluetoothApis` to `c.s.j.p.win32` providing Bluetooth device and radio enumeration via `BluetoothFindFirstRadio`, `BluetoothFindFirstDevice`, and related functions - [@&#8203;dbwiddis](https://github.com/dbwiddis).

## Bug Fixes

- [#&#8203;1644](java-native-access/jna#1644): Fix bug in VARDESC and TYPEDESC causing an illegal memory access - [@&#8203;lwahonen](https://github.com/lwahonen)
- [#&#8203;1715](java-native-access/jna#1715): Fix `UdevDevice.getSysname()` calling `udev_device_get_syspath` instead of `udev_device_get_sysname` - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1721](java-native-access/jna#1721): Fix switched `serverName`/`domainName` arguments in `Netapi32Util#getDCName` - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1722](java-native-access/jna#1722): Fix `Advapi32#RegisterServiceCtrlHandler` using wrong `Handler` type - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1636](java-native-access/jna#1636): Drop hard dependency on java.lang.SecurityManager/java.security.AccessController - [@&#8203;matthiasblaesing](https://github.com/matthiasblaesing).
- [#&#8203;1724](java-native-access/jna#1724): Fix `host_page_size` in `c.s.j.p.mac.SystemB` and `getxattr`/`setxattr`/`listxattr` in `c.s.j.p.mac.XAttr` using `long` instead of pointer-sized types for `size_t`/`ssize_t` parameters - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1727](java-native-access/jna#1727): Include DragonFlyBSD in `NativeLibrary` versioned library resolution, libc special-case loading, and 64-bit search paths - [@&#8203;dbwiddis](https://github.com/dbwiddis).
- [#&#8203;1709](java-native-access/jna#1709): Rebuild native library for OpenBSD 7.9 x86-64, drop OpenBSD x86 - [@&#8203;matthiasblaesing](https://github.com/matthiasblaesing).

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 9am on tuesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzMuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE3NS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://code.futo.org/harbor/harbor/pulls/1820
Reviewed-by: Mark Harding <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants