[Git][java-team/jnr-ffi][upstream] New upstream version 2.3.1

Jérôme Charaoui (@lavamind) gitlab at salsa.debian.org
Thu Aug 27 05:52:24 BST 2026



Jérôme Charaoui pushed to branch upstream at Debian Java Maintainers / jnr-ffi


Commits:
208a6dd3 by Jérôme Charaoui at 2026-08-26T21:29:29-04:00
New upstream version 2.3.1
- - - - -


16 changed files:

- .github/workflows/ci.yml
- − .travis.yml
- README.md
- docs/FAQ.md
- pom.xml
- src/main/java/jnr/ffi/Pointer.java
- src/main/java/jnr/ffi/annotations/IgnoreError.java
- src/main/java/jnr/ffi/annotations/Out.java
- src/main/java/jnr/ffi/provider/jffi/platform/aarch64/freebsd/TypeAliases.java
- + src/main/java/jnr/ffi/provider/jffi/platform/aarch64/openbsd/TypeAliases.java
- src/main/java/jnr/ffi/provider/jffi/platform/i386/freebsd/TypeAliases.java
- src/main/java/jnr/ffi/provider/jffi/platform/i386/openbsd/TypeAliases.java
- src/main/java/jnr/ffi/provider/jffi/platform/ppc64/freebsd/TypeAliases.java
- + src/main/java/jnr/ffi/provider/jffi/platform/ppc64/openbsd/TypeAliases.java
- src/main/java/jnr/ffi/provider/jffi/platform/x86_64/freebsd/TypeAliases.java
- src/main/java/jnr/ffi/provider/jffi/platform/x86_64/openbsd/TypeAliases.java


Changes:

=====================================
.github/workflows/ci.yml
=====================================
@@ -17,47 +17,19 @@ jobs:
 
     strategy:
       matrix:
-        os: [ubuntu-latest, macos-latest, [self-hosted, macos, aarch64]]
-        java-version: ['8', '11']
+        os: [ubuntu-latest, macos-latest]
+        java-test-version: ['8', '11', '17', '21', '25']
       fail-fast: false
 
     steps:
     - uses: actions/checkout at v2
-    - name: Cache dependencies
-      uses: actions/cache at v2
-      with:
-        path: ~/.m2
-        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
-        restore-keys: ${{ runner.os }}-m2
-    - name: Set up JDK ${{ matrix.java-version }}
-      uses: actions/setup-java at v1.4.3
-      with:
-        java-version: ${{ matrix.java-version }}
-    - name: Build with Maven
-      run: mvn -B package --file pom.xml
-
-  mvn-test-macos-aarch64:
-
-    runs-on: [self-hosted, macos, aarch64]
-
-    name: mvn test on Apple M1
-
-    strategy:
-      fail-fast: false
-
-    steps:
-    - uses: actions/checkout at v2
-    - name: Cache dependencies
-      uses: actions/cache at v2
-      with:
-        path: ~/.m2
-        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
-        restore-keys: ${{ runner.os }}-m2
-    - name: Set up JDK 11
-      uses: actions/setup-java at v2
+    - name: Set up JDK toolchains
+      uses: actions/setup-java at v5
       with:
+        java-version: |
+          ${{ matrix.java-test-version }}
+          17
+        cache: maven
         distribution: 'zulu'
-        java-version: 11
-        architecture: arm
     - name: Build with Maven
-      run: mvn -B package --file pom.xml
+      run: mvn -B package --file pom.xml -Djnr.test.toolchain=${{ matrix.java-test-version }}


=====================================
.travis.yml deleted
=====================================
@@ -1,20 +0,0 @@
-language: java
-notifications:
-  irc:
-    channels:
-      - "irc.freenode.org#jnr"
-    on_success: change
-    on_failure: always
-    template:
-      - "%{repository} (%{branch}:%{commit} by %{author}): %{message} (%{build_url})"
-matrix:
-  include:
-    - os: osx
-    - os: linux
-      jdk: oraclejdk8
-    - os: linux
-      jdk: openjdk7
-sudo: false
-cache:
-  directories:
-  - $HOME/.m2


=====================================
README.md
=====================================
@@ -50,6 +50,22 @@ public class HelloWorld {
 
 View more details in [our user documentation](./docs/README.md).
 
+## Releasing
+
+Deploy artifacts to Sonatype Central with the following command:
+
+```text
+mvn clean deploy
+```
+
+Deploy release artifacts to Maven Central by updating the release version to remove `-SNAPSHOT` and running the following command:
+
+```text
+mvn clean deploy -Prelease
+```
+
+Update the release version to the next snapshot after the release artifacts have been published.
+
 ## LICENSE
 
 ```


=====================================
docs/FAQ.md
=====================================
@@ -52,5 +52,13 @@ Before sending a pull request, please file an issue ([see the previous section](
 with the details of what you have changed or are going to change. This way, your time is not wasted if the change does
 not meet our goals, and we can discuss the changes in depth within the issue.
 
+## Why am I getting EINVAL for a pointer passed to native (e.g. getsockopt's len pointer)
+
+Length pointers passed to native functions are often read and also written back by the function to indicate how much
+data was actually returned. If you specify only @In OR @Out the native memory allocated for the pointer may not be
+set up correctly for two-way synchronization. Remove the annotation or specify both (which is the default when neither
+are specified.
+
+
 If you are adding new functionality, ensure that you add unit tests that will test the behavior of your new code and, if
-it is a public API, add descriptive javadoc comments for the new code.
\ No newline at end of file
+it is a public API, add descriptive javadoc comments for the new code.


=====================================
pom.xml
=====================================
@@ -1,15 +1,16 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
+
   <parent>
-    <groupId>org.sonatype.oss</groupId>
-    <artifactId>oss-parent</artifactId>
-    <version>7</version>
+    <groupId>com.github.jnr</groupId>
+    <artifactId>jnr-parent</artifactId>
+    <version>0.0.1</version>
+    <relativePath/>
   </parent>
 
-  <groupId>com.github.jnr</groupId>
   <artifactId>jnr-ffi</artifactId>
   <packaging>jar</packaging>
-  <version>2.2.15</version>
+  <version>2.3.1</version>
   <name>jnr-ffi</name>
   <description>A library for invoking native functions from java</description>
   <url>http://github.com/jnr/jnr-ffi</url>
@@ -43,11 +44,9 @@
   </developers>
 
   <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <maven.compiler.source>8</maven.compiler.source>
-    <maven.compiler.target>8</maven.compiler.target>
     <github.global.server>github</github.global.server>
-    <asm.version>9.2</asm.version>
+    <asm.version>9.10.1</asm.version>
+    <junit.version>5.14.4</junit.version>
     <make>make</make>
   </properties>
 
@@ -55,19 +54,19 @@
     <dependency>
       <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
-      <version>5.7.2</version>
+      <version>${junit.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>com.github.jnr</groupId>
       <artifactId>jffi</artifactId>
-      <version>1.3.12</version>
+      <version>1.4.0</version>
       <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>com.github.jnr</groupId>
       <artifactId>jffi</artifactId>
-      <version>1.3.12</version>
+      <version>1.4.0</version>
       <scope>runtime</scope>
       <classifier>native</classifier>
     </dependency>
@@ -116,11 +115,6 @@
   </dependencies>
   <build>
     <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.8.1</version>
-      </plugin>
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
         <version>1.1</version>
@@ -142,25 +136,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <version>2.3.7</version>
-        <configuration>
-          <instructions>
-            <_nouses>true</_nouses>
-          </instructions>
-        </configuration>
-        <executions>
-          <execution>
-            <id>bundle-manifest</id>
-            <phase>process-classes</phase>
-            <goals>
-              <goal>manifest</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
@@ -175,9 +150,7 @@
         </configuration>
       </plugin>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.22.2</version>
         <configuration>
           <forkCount>1</forkCount>
           <reuseForks>false</reuseForks>
@@ -247,18 +220,33 @@
           </execution>
         </executions>
       </plugin>
-      <!--
       <plugin>
-        <groupId>org.sonatype.plugins</groupId>
-        <artifactId>nexus-staging-maven-plugin</artifactId>
-        <version>1.4.4</version>
+        <groupId>org.sonatype.central</groupId>
+        <artifactId>central-publishing-maven-plugin</artifactId>
+        <version>0.7.0</version>
         <extensions>true</extensions>
         <configuration>
-          <serverId>sonatype-nexus-staging</serverId>
-          <nexusUrl>https://oss.sonatype.org</nexusUrl>
+          <publishingServerId>central</publishingServerId>
         </configuration>
       </plugin>
-      -->
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <_nouses>true</_nouses>
+          </instructions>
+        </configuration>
+        <executions>
+          <execution>
+            <id>bundle-manifest</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>manifest</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <profiles>
@@ -287,48 +275,21 @@
       </properties>
     </profile>
     <profile>
-      <id>release-sign-artifacts</id>
-      <activation>
-        <property>
-          <name>performRelease</name>
-          <value>true</value>
-        </property>
-      </activation>
+      <id>release</id>
       <build>
         <plugins>
           <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-gpg-plugin</artifactId>
-            <version>1.4</version>
-            <executions>
-              <execution>
-                <id>sign-artifacts</id>
-                <phase>verify</phase>
-                <goals>
-                  <goal>sign</goal>
-                </goals>
-              </execution>
-            </executions>
           </plugin>
         </plugins>
       </build>
     </profile>
-    <profile>
-      <id>java9</id>
-      <activation>
-        <jdk>[9,)</jdk>
-      </activation>
-      <properties>
-        <maven.compiler.release>8</maven.compiler.release>
-      </properties>
-    </profile>
   </profiles>
   <reporting>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
-        <version>2.8</version>
         <configuration>
           <excludePackageNames>jnr.ffi.provider:jnr.ffi.util</excludePackageNames>
         </configuration>


=====================================
src/main/java/jnr/ffi/Pointer.java
=====================================
@@ -411,7 +411,7 @@ abstract public class Pointer {
      *
      * @param offset the offset from the start of the memory this {@code Pointer} represents at which the first value will be written.
      * @param src the array to get values from.
-     * @param idx the start index in the {@code dst} array to begin reading values.
+     * @param idx the start index in the {@code src} array to begin reading values.
      * @param len the number of values to be written.
      */
     abstract public void put(long offset, byte[] src, int idx, int len);
@@ -437,7 +437,7 @@ abstract public class Pointer {
      *
      * @param offset the offset from the start of the memory this {@code Pointer} represents at which the first value will be written.
      * @param src the array to get values from.
-     * @param idx the start index in the {@code dst} array to begin reading values.
+     * @param idx the start index in the {@code src} array to begin reading values.
      * @param len the number of values to be written.
      */
     abstract public void put(long offset, short[] src, int idx, int len);
@@ -463,7 +463,7 @@ abstract public class Pointer {
      *
      * @param offset the offset from the start of the memory this {@code Pointer} represents at which the first value will be written.
      * @param src the array to get values from.
-     * @param idx the start index in the {@code dst} array to begin reading values.
+     * @param idx the start index in the {@code src} array to begin reading values.
      * @param len the number of values to be written.
      */
     abstract public void put(long offset, int[] src, int idx, int len);
@@ -489,7 +489,7 @@ abstract public class Pointer {
      *
      * @param offset the offset from the start of the memory this {@code Pointer} represents at which the first value will be written.
      * @param src the array to get values from.
-     * @param idx the start index in the {@code dst} array to begin reading values.
+     * @param idx the start index in the {@code src} array to begin reading values.
      * @param len the number of values to be written.
      */
     abstract public void put(long offset, long[] src, int idx, int len);
@@ -515,7 +515,7 @@ abstract public class Pointer {
      *
      * @param offset the offset from the start of the memory this {@code Pointer} represents at which the first value will be written.
      * @param src the array to get values from.
-     * @param idx the start index in the {@code dst} array to begin reading values.
+     * @param idx the start index in the {@code src} array to begin reading values.
      * @param len the number of values to be written.
      */
     abstract public void put(long offset, float[] src, int idx, int len);
@@ -541,7 +541,7 @@ abstract public class Pointer {
      *
      * @param offset the offset from the start of the memory this {@code Pointer} represents at which the first value will be written.
      * @param src the array to get values from.
-     * @param idx the start index in the {@code dst} array to begin reading values.
+     * @param idx the start index in the {@code src} array to begin reading values.
      * @param len the number of values to be written.
      */
     abstract public void put(long offset, double[] src, int idx, int len);


=====================================
src/main/java/jnr/ffi/annotations/IgnoreError.java
=====================================
@@ -37,7 +37,7 @@ import java.util.Map;
  * function call - even for the ones that succeed.  This can have a significant
  * performance impact, so for those functions which either don't fail, or for which
  * the errno value can be ignored, can be annotated with {@code @IgnoreError} to
- * avoid unneccessary saving of the errno value.
+ * avoid unnecessary saving of the errno value.
  *
  * @see SaveError
  * @see LibraryLoader#saveError(Map, boolean, boolean)


=====================================
src/main/java/jnr/ffi/annotations/Out.java
=====================================
@@ -36,7 +36,7 @@ import java.lang.annotation.Target;
  * <p>As this extra copying can be expensive, for native functions which only
  * write to the passed in memory block and do not use the existing contents, 
  * parameters can be annotated with {@code @Out} so there is only copied {@code OUT} 
- * from native memory to java memory after the call, and the unneccessary copy {@code IN}
+ * from native memory to java memory after the call, and the unnecessary copy {@code IN}
  * from java to native memory before the call can be avoided.
  *
  * <p>Parameters with neither a {@code @In} nor a {@code @Out} annotation will copy both ways.


=====================================
src/main/java/jnr/ffi/provider/jffi/platform/aarch64/freebsd/TypeAliases.java
=====================================
@@ -34,25 +34,25 @@ public final class TypeAliases {
         m.put(TypeAlias.u_int16_t, NativeType.USHORT);
         m.put(TypeAlias.int32_t, NativeType.SINT);
         m.put(TypeAlias.u_int32_t, NativeType.UINT);
-        m.put(TypeAlias.int64_t, NativeType.SLONGLONG);
-        m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.int64_t, NativeType.SLONG);
+        m.put(TypeAlias.u_int64_t, NativeType.ULONG);
         m.put(TypeAlias.intptr_t, NativeType.SLONG);
         m.put(TypeAlias.uintptr_t, NativeType.ULONG);
         m.put(TypeAlias.caddr_t, NativeType.ADDRESS);
-        m.put(TypeAlias.dev_t, NativeType.SINT);
+        m.put(TypeAlias.dev_t, NativeType.ULONG);
         m.put(TypeAlias.blkcnt_t, NativeType.SLONG);
-        m.put(TypeAlias.blksize_t, NativeType.SLONG);
+        m.put(TypeAlias.blksize_t, NativeType.SINT);
         m.put(TypeAlias.gid_t, NativeType.UINT);
         m.put(TypeAlias.in_addr_t, NativeType.UINT);
         m.put(TypeAlias.in_port_t, NativeType.USHORT);
-        m.put(TypeAlias.ino_t, NativeType.UINT);
-        m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.ino_t, NativeType.ULONG);
+        m.put(TypeAlias.ino64_t, NativeType.ULONG);
         m.put(TypeAlias.key_t, NativeType.SLONG);
-        m.put(TypeAlias.mode_t, NativeType.UINT);
-        m.put(TypeAlias.nlink_t, NativeType.UINT);
-        m.put(TypeAlias.id_t, NativeType.UINT);
+        m.put(TypeAlias.mode_t, NativeType.USHORT);
+        m.put(TypeAlias.nlink_t, NativeType.ULONG);
+        m.put(TypeAlias.id_t, NativeType.SLONG);
         m.put(TypeAlias.pid_t, NativeType.SINT);
-        m.put(TypeAlias.off_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.off_t, NativeType.SLONG);
         m.put(TypeAlias.swblk_t, NativeType.SINT);
         m.put(TypeAlias.uid_t, NativeType.UINT);
         m.put(TypeAlias.clock_t, NativeType.SINT);
@@ -63,7 +63,7 @@ public final class TypeAliases {
         m.put(TypeAlias.fsfilcnt_t, NativeType.ULONG);
         m.put(TypeAlias.sa_family_t, NativeType.UCHAR);
         m.put(TypeAlias.socklen_t, NativeType.UINT);
-        m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.rlim_t, NativeType.SLONG);
         m.put(TypeAlias.cc_t, NativeType.UCHAR);
         m.put(TypeAlias.speed_t, NativeType.UINT);
         m.put(TypeAlias.tcflag_t, NativeType.UINT);


=====================================
src/main/java/jnr/ffi/provider/jffi/platform/aarch64/openbsd/TypeAliases.java
=====================================
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2012 Wayne Meissner
+ *
+ * This file is part of the JNR project.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package jnr.ffi.provider.jffi.platform.aarch64.openbsd;
+
+import jnr.ffi.NativeType;
+import jnr.ffi.TypeAlias;
+
+import java.util.EnumMap;
+import java.util.Map;
+
+public final class TypeAliases {
+    public static final Map<TypeAlias, jnr.ffi.NativeType> ALIASES = buildTypeMap();
+    private static Map<TypeAlias, jnr.ffi.NativeType> buildTypeMap() {
+        Map<TypeAlias, jnr.ffi.NativeType> m = new EnumMap<TypeAlias, jnr.ffi.NativeType>(TypeAlias.class);
+        m.put(TypeAlias.int8_t, NativeType.SCHAR);
+        m.put(TypeAlias.u_int8_t, NativeType.UCHAR);
+        m.put(TypeAlias.int16_t, NativeType.SSHORT);
+        m.put(TypeAlias.u_int16_t, NativeType.USHORT);
+        m.put(TypeAlias.int32_t, NativeType.SINT);
+        m.put(TypeAlias.u_int32_t, NativeType.UINT);
+        m.put(TypeAlias.int64_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.intptr_t, NativeType.SLONG);
+        m.put(TypeAlias.uintptr_t, NativeType.ULONG);
+        m.put(TypeAlias.caddr_t, NativeType.ADDRESS);
+        m.put(TypeAlias.dev_t, NativeType.SINT);
+        m.put(TypeAlias.blkcnt_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.blksize_t, NativeType.SINT);
+        m.put(TypeAlias.gid_t, NativeType.UINT);
+        m.put(TypeAlias.in_addr_t, NativeType.UINT);
+        m.put(TypeAlias.in_port_t, NativeType.USHORT);
+        m.put(TypeAlias.ino_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.key_t, NativeType.SLONG);
+        m.put(TypeAlias.mode_t, NativeType.UINT);
+        m.put(TypeAlias.nlink_t, NativeType.UINT);
+        m.put(TypeAlias.id_t, NativeType.UINT);
+        m.put(TypeAlias.pid_t, NativeType.SINT);
+        m.put(TypeAlias.off_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.swblk_t, NativeType.SINT);
+        m.put(TypeAlias.uid_t, NativeType.UINT);
+        m.put(TypeAlias.clock_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.size_t, NativeType.ULONG);
+        m.put(TypeAlias.ssize_t, NativeType.SLONG);
+        m.put(TypeAlias.time_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.fsblkcnt_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.fsfilcnt_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.sa_family_t, NativeType.UCHAR);
+        m.put(TypeAlias.socklen_t, NativeType.UINT);
+        m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.cc_t, NativeType.UCHAR);
+        m.put(TypeAlias.speed_t, NativeType.UINT);
+        m.put(TypeAlias.tcflag_t, NativeType.UINT);
+        return m;
+    }
+}


=====================================
src/main/java/jnr/ffi/provider/jffi/platform/i386/freebsd/TypeAliases.java
=====================================
@@ -39,21 +39,21 @@ public final class TypeAliases {
         m.put(TypeAlias.intptr_t, NativeType.SINT);
         m.put(TypeAlias.uintptr_t, NativeType.UINT);
         m.put(TypeAlias.caddr_t, NativeType.ADDRESS);
-        m.put(TypeAlias.dev_t, NativeType.UINT);
+        m.put(TypeAlias.dev_t, NativeType.ULONGLONG);
         m.put(TypeAlias.blkcnt_t, NativeType.SLONGLONG);
-        m.put(TypeAlias.blksize_t, NativeType.UINT);
+        m.put(TypeAlias.blksize_t, NativeType.SINT);
         m.put(TypeAlias.gid_t, NativeType.UINT);
         m.put(TypeAlias.in_addr_t, NativeType.UINT);
         m.put(TypeAlias.in_port_t, NativeType.USHORT);
-        m.put(TypeAlias.ino_t, NativeType.UINT);
+        m.put(TypeAlias.ino_t, NativeType.ULONGLONG);
         m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);
         m.put(TypeAlias.key_t, NativeType.SLONG);
         m.put(TypeAlias.mode_t, NativeType.USHORT);
-        m.put(TypeAlias.nlink_t, NativeType.USHORT);
+        m.put(TypeAlias.nlink_t, NativeType.ULONGLONG);
         m.put(TypeAlias.id_t, NativeType.SLONGLONG);
         m.put(TypeAlias.pid_t, NativeType.SINT);
         m.put(TypeAlias.off_t, NativeType.SLONGLONG);
-        m.put(TypeAlias.swblk_t, NativeType.SLONG);
+        m.put(TypeAlias.swblk_t, NativeType.SINT);
         m.put(TypeAlias.uid_t, NativeType.UINT);
         m.put(TypeAlias.clock_t, NativeType.ULONG);
         m.put(TypeAlias.size_t, NativeType.UINT);


=====================================
src/main/java/jnr/ffi/provider/jffi/platform/i386/openbsd/TypeAliases.java
=====================================
@@ -40,12 +40,12 @@ public final class TypeAliases {
         m.put(TypeAlias.uintptr_t, NativeType.ULONG);
         m.put(TypeAlias.caddr_t, NativeType.ADDRESS);
         m.put(TypeAlias.dev_t, NativeType.SINT);
-        m.put(TypeAlias.blkcnt_t, NativeType.SLONG);
-        m.put(TypeAlias.blksize_t, NativeType.SLONG);
+        m.put(TypeAlias.blkcnt_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.blksize_t, NativeType.SINT);
         m.put(TypeAlias.gid_t, NativeType.UINT);
         m.put(TypeAlias.in_addr_t, NativeType.UINT);
         m.put(TypeAlias.in_port_t, NativeType.USHORT);
-        m.put(TypeAlias.ino_t, NativeType.UINT);
+        m.put(TypeAlias.ino_t, NativeType.ULONGLONG);
         m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);
         m.put(TypeAlias.key_t, NativeType.SLONG);
         m.put(TypeAlias.mode_t, NativeType.UINT);
@@ -55,12 +55,12 @@ public final class TypeAliases {
         m.put(TypeAlias.off_t, NativeType.SLONGLONG);
         m.put(TypeAlias.swblk_t, NativeType.SINT);
         m.put(TypeAlias.uid_t, NativeType.UINT);
-        m.put(TypeAlias.clock_t, NativeType.SINT);
+        m.put(TypeAlias.clock_t, NativeType.SLONGLONG);
         m.put(TypeAlias.size_t, NativeType.ULONG);
         m.put(TypeAlias.ssize_t, NativeType.SLONG);
-        m.put(TypeAlias.time_t, NativeType.SINT);
-        m.put(TypeAlias.fsblkcnt_t, NativeType.ULONG);
-        m.put(TypeAlias.fsfilcnt_t, NativeType.ULONG);
+        m.put(TypeAlias.time_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.fsblkcnt_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.fsfilcnt_t, NativeType.ULONGLONG);
         m.put(TypeAlias.sa_family_t, NativeType.UCHAR);
         m.put(TypeAlias.socklen_t, NativeType.UINT);
         m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);


=====================================
src/main/java/jnr/ffi/provider/jffi/platform/ppc64/freebsd/TypeAliases.java
=====================================
@@ -35,36 +35,36 @@ public final class TypeAliases {
         m.put(TypeAlias.u_int16_t, NativeType.USHORT);
         m.put(TypeAlias.int32_t, NativeType.SINT);
         m.put(TypeAlias.u_int32_t, NativeType.UINT);
-        m.put(TypeAlias.int64_t, NativeType.SLONGLONG);
-        m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.int64_t, NativeType.SLONG);
+        m.put(TypeAlias.u_int64_t, NativeType.ULONG);
         m.put(TypeAlias.intptr_t, NativeType.SLONG);
         m.put(TypeAlias.uintptr_t, NativeType.ULONG);
         m.put(TypeAlias.caddr_t, NativeType.ADDRESS);
-        m.put(TypeAlias.dev_t, NativeType.SINT);
+        m.put(TypeAlias.dev_t, NativeType.ULONG);
         m.put(TypeAlias.blkcnt_t, NativeType.SLONG);
-        m.put(TypeAlias.blksize_t, NativeType.SLONG);
+        m.put(TypeAlias.blksize_t, NativeType.SINT);
         m.put(TypeAlias.gid_t, NativeType.UINT);
         m.put(TypeAlias.in_addr_t, NativeType.UINT);
         m.put(TypeAlias.in_port_t, NativeType.USHORT);
-        m.put(TypeAlias.ino_t, NativeType.UINT);
-        m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.ino_t, NativeType.ULONG);
+        m.put(TypeAlias.ino64_t, NativeType.ULONG);
         m.put(TypeAlias.key_t, NativeType.SLONG);
-        m.put(TypeAlias.mode_t, NativeType.UINT);
-        m.put(TypeAlias.nlink_t, NativeType.UINT);
-        m.put(TypeAlias.id_t, NativeType.UINT);
+        m.put(TypeAlias.mode_t, NativeType.USHORT);
+        m.put(TypeAlias.nlink_t, NativeType.ULONG);
+        m.put(TypeAlias.id_t, NativeType.SLONG);
         m.put(TypeAlias.pid_t, NativeType.SINT);
-        m.put(TypeAlias.off_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.off_t, NativeType.SLONG);
         m.put(TypeAlias.swblk_t, NativeType.SINT);
         m.put(TypeAlias.uid_t, NativeType.UINT);
-        m.put(TypeAlias.clock_t, NativeType.SINT);
+        m.put(TypeAlias.clock_t, NativeType.UINT);
         m.put(TypeAlias.size_t, NativeType.ULONG);
         m.put(TypeAlias.ssize_t, NativeType.SLONG);
-        m.put(TypeAlias.time_t, NativeType.SINT);
+        m.put(TypeAlias.time_t, NativeType.SLONG);
         m.put(TypeAlias.fsblkcnt_t, NativeType.ULONG);
         m.put(TypeAlias.fsfilcnt_t, NativeType.ULONG);
         m.put(TypeAlias.sa_family_t, NativeType.UCHAR);
         m.put(TypeAlias.socklen_t, NativeType.UINT);
-        m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.rlim_t, NativeType.SLONG);
         m.put(TypeAlias.cc_t, NativeType.UCHAR);
         m.put(TypeAlias.speed_t, NativeType.UINT);
         m.put(TypeAlias.tcflag_t, NativeType.UINT);


=====================================
src/main/java/jnr/ffi/provider/jffi/platform/ppc64/openbsd/TypeAliases.java
=====================================
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2012 Wayne Meissner
+ * Copyright (C) 2021 Justin Hibbits
+ *
+ * This file is part of the JNR project.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package jnr.ffi.provider.jffi.platform.ppc64.openbsd;
+
+import jnr.ffi.NativeType;
+import jnr.ffi.TypeAlias;
+
+import java.util.EnumMap;
+import java.util.Map;
+
+public final class TypeAliases {
+    public static final Map<TypeAlias, jnr.ffi.NativeType> ALIASES = buildTypeMap();
+    private static Map<TypeAlias, jnr.ffi.NativeType> buildTypeMap() {
+        Map<TypeAlias, jnr.ffi.NativeType> m = new EnumMap<TypeAlias, jnr.ffi.NativeType>(TypeAlias.class);
+        m.put(TypeAlias.int8_t, NativeType.SCHAR);
+        m.put(TypeAlias.u_int8_t, NativeType.UCHAR);
+        m.put(TypeAlias.int16_t, NativeType.SSHORT);
+        m.put(TypeAlias.u_int16_t, NativeType.USHORT);
+        m.put(TypeAlias.int32_t, NativeType.SINT);
+        m.put(TypeAlias.u_int32_t, NativeType.UINT);
+        m.put(TypeAlias.int64_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.intptr_t, NativeType.SLONG);
+        m.put(TypeAlias.uintptr_t, NativeType.ULONG);
+        m.put(TypeAlias.caddr_t, NativeType.ADDRESS);
+        m.put(TypeAlias.dev_t, NativeType.SINT);
+        m.put(TypeAlias.blkcnt_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.blksize_t, NativeType.SINT);
+        m.put(TypeAlias.gid_t, NativeType.UINT);
+        m.put(TypeAlias.in_addr_t, NativeType.UINT);
+        m.put(TypeAlias.in_port_t, NativeType.USHORT);
+        m.put(TypeAlias.ino_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.key_t, NativeType.SLONG);
+        m.put(TypeAlias.mode_t, NativeType.UINT);
+        m.put(TypeAlias.nlink_t, NativeType.UINT);
+        m.put(TypeAlias.id_t, NativeType.UINT);
+        m.put(TypeAlias.pid_t, NativeType.SINT);
+        m.put(TypeAlias.off_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.swblk_t, NativeType.SINT);
+        m.put(TypeAlias.uid_t, NativeType.UINT);
+        m.put(TypeAlias.clock_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.size_t, NativeType.ULONG);
+        m.put(TypeAlias.ssize_t, NativeType.SLONG);
+        m.put(TypeAlias.time_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.fsblkcnt_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.fsfilcnt_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.sa_family_t, NativeType.UCHAR);
+        m.put(TypeAlias.socklen_t, NativeType.UINT);
+        m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.cc_t, NativeType.UCHAR);
+        m.put(TypeAlias.speed_t, NativeType.UINT);
+        m.put(TypeAlias.tcflag_t, NativeType.UINT);
+        return m;
+    }
+}


=====================================
src/main/java/jnr/ffi/provider/jffi/platform/x86_64/freebsd/TypeAliases.java
=====================================
@@ -34,36 +34,36 @@ public final class TypeAliases {
         m.put(TypeAlias.u_int16_t, NativeType.USHORT);
         m.put(TypeAlias.int32_t, NativeType.SINT);
         m.put(TypeAlias.u_int32_t, NativeType.UINT);
-        m.put(TypeAlias.int64_t, NativeType.SLONGLONG);
-        m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.int64_t, NativeType.SLONG);
+        m.put(TypeAlias.u_int64_t, NativeType.ULONG);
         m.put(TypeAlias.intptr_t, NativeType.SLONG);
         m.put(TypeAlias.uintptr_t, NativeType.ULONG);
         m.put(TypeAlias.caddr_t, NativeType.ADDRESS);
-        m.put(TypeAlias.dev_t, NativeType.SINT);
+        m.put(TypeAlias.dev_t, NativeType.ULONG);
         m.put(TypeAlias.blkcnt_t, NativeType.SLONG);
-        m.put(TypeAlias.blksize_t, NativeType.SLONG);
+        m.put(TypeAlias.blksize_t, NativeType.SINT);
         m.put(TypeAlias.gid_t, NativeType.UINT);
         m.put(TypeAlias.in_addr_t, NativeType.UINT);
         m.put(TypeAlias.in_port_t, NativeType.USHORT);
-        m.put(TypeAlias.ino_t, NativeType.UINT);
-        m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.ino_t, NativeType.ULONG);
+        m.put(TypeAlias.ino64_t, NativeType.ULONG);
         m.put(TypeAlias.key_t, NativeType.SLONG);
-        m.put(TypeAlias.mode_t, NativeType.UINT);
-        m.put(TypeAlias.nlink_t, NativeType.UINT);
-        m.put(TypeAlias.id_t, NativeType.UINT);
+        m.put(TypeAlias.mode_t, NativeType.USHORT);
+        m.put(TypeAlias.nlink_t, NativeType.ULONG);
+        m.put(TypeAlias.id_t, NativeType.SLONG);
         m.put(TypeAlias.pid_t, NativeType.SINT);
-        m.put(TypeAlias.off_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.off_t, NativeType.SLONG);
         m.put(TypeAlias.swblk_t, NativeType.SINT);
         m.put(TypeAlias.uid_t, NativeType.UINT);
         m.put(TypeAlias.clock_t, NativeType.SINT);
         m.put(TypeAlias.size_t, NativeType.ULONG);
         m.put(TypeAlias.ssize_t, NativeType.SLONG);
-        m.put(TypeAlias.time_t, NativeType.SINT);
+        m.put(TypeAlias.time_t, NativeType.SLONG);
         m.put(TypeAlias.fsblkcnt_t, NativeType.ULONG);
         m.put(TypeAlias.fsfilcnt_t, NativeType.ULONG);
         m.put(TypeAlias.sa_family_t, NativeType.UCHAR);
         m.put(TypeAlias.socklen_t, NativeType.UINT);
-        m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.rlim_t, NativeType.SLONG);
         m.put(TypeAlias.cc_t, NativeType.UCHAR);
         m.put(TypeAlias.speed_t, NativeType.UINT);
         m.put(TypeAlias.tcflag_t, NativeType.UINT);


=====================================
src/main/java/jnr/ffi/provider/jffi/platform/x86_64/openbsd/TypeAliases.java
=====================================
@@ -40,12 +40,12 @@ public final class TypeAliases {
         m.put(TypeAlias.uintptr_t, NativeType.ULONG);
         m.put(TypeAlias.caddr_t, NativeType.ADDRESS);
         m.put(TypeAlias.dev_t, NativeType.SINT);
-        m.put(TypeAlias.blkcnt_t, NativeType.SLONG);
-        m.put(TypeAlias.blksize_t, NativeType.SLONG);
+        m.put(TypeAlias.blkcnt_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.blksize_t, NativeType.SINT);
         m.put(TypeAlias.gid_t, NativeType.UINT);
         m.put(TypeAlias.in_addr_t, NativeType.UINT);
         m.put(TypeAlias.in_port_t, NativeType.USHORT);
-        m.put(TypeAlias.ino_t, NativeType.UINT);
+        m.put(TypeAlias.ino_t, NativeType.ULONGLONG);
         m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);
         m.put(TypeAlias.key_t, NativeType.SLONG);
         m.put(TypeAlias.mode_t, NativeType.UINT);
@@ -55,12 +55,12 @@ public final class TypeAliases {
         m.put(TypeAlias.off_t, NativeType.SLONGLONG);
         m.put(TypeAlias.swblk_t, NativeType.SINT);
         m.put(TypeAlias.uid_t, NativeType.UINT);
-        m.put(TypeAlias.clock_t, NativeType.SINT);
+        m.put(TypeAlias.clock_t, NativeType.SLONGLONG);
         m.put(TypeAlias.size_t, NativeType.ULONG);
         m.put(TypeAlias.ssize_t, NativeType.SLONG);
-        m.put(TypeAlias.time_t, NativeType.SINT);
-        m.put(TypeAlias.fsblkcnt_t, NativeType.ULONG);
-        m.put(TypeAlias.fsfilcnt_t, NativeType.ULONG);
+        m.put(TypeAlias.time_t, NativeType.SLONGLONG);
+        m.put(TypeAlias.fsblkcnt_t, NativeType.ULONGLONG);
+        m.put(TypeAlias.fsfilcnt_t, NativeType.ULONGLONG);
         m.put(TypeAlias.sa_family_t, NativeType.UCHAR);
         m.put(TypeAlias.socklen_t, NativeType.UINT);
         m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);



View it on GitLab: https://salsa.debian.org/java-team/jnr-ffi/-/commit/208a6dd36bf339b2685440ed971bd69c5a8655d6

-- 
View it on GitLab: https://salsa.debian.org/java-team/jnr-ffi/-/commit/208a6dd36bf339b2685440ed971bd69c5a8655d6
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20260827/2ea6a303/attachment.htm>


More information about the pkg-java-commits mailing list