Class FfmDowncallBuildItem

java.lang.Object
io.quarkus.builder.item.BuildItem
io.quarkus.builder.item.MultiBuildItem
io.quarkus.deployment.builditem.nativeimage.FfmCallBuildItem
io.quarkus.deployment.builditem.nativeimage.FfmDowncallBuildItem

public final class FfmDowncallBuildItem extends FfmCallBuildItem
Used to register a downcall signature for FFI/FFM runtime access.

Downcalls can optionally specify linker options that affect how GraalVM generates the native call stub:

  • captureCallState — captures native error state (e.g. errno) after the call
  • firstVariadicArg — index of the first variadic argument for variadic C functions (e.g. printf, ioctl)
  • critical — marks the call as critical (no safepoint, no GC), optionally allowing heap access

Use the builder to create downcall registrations:

 // Simple downcall without options
 FfmDowncallBuildItem.builder(FfmType.INT, FfmType.INT).build()

 // Downcall with options
 FfmDowncallBuildItem.builder(FfmType.INT, FfmType.INT, FfmType.ADDRESS)
         .captureCallState()
         .firstVariadicArg(2)
         .build()
 
See Also:
  • Constructor Details

    • FfmDowncallBuildItem

      @Deprecated(since="4.0", forRemoval=true) public FfmDowncallBuildItem(FfmType returnType, FfmType... parameterTypes)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a downcall registration without any linker options.
      Parameters:
      returnType - the return type
      parameterTypes - the parameter types
  • Method Details

    • builder

      public static FfmDowncallBuildItem.Builder builder(FfmType returnType, FfmType... parameterTypes)
      Creates a builder for a downcall registration.
      Parameters:
      returnType - the return type
      parameterTypes - the parameter types
      Returns:
      a new builder
    • isCaptureCallState

      public boolean isCaptureCallState()
      Whether this downcall captures native error state (e.g. errno).
    • getFirstVariadicArg

      public int getFirstVariadicArg()
      The index of the first variadic argument, or -1 if not set.
    • getCritical

      The critical option for this downcall, or null if not set.
    • hasOptions

      public boolean hasOptions()
      Whether any linker options are set on this downcall.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class FfmCallBuildItem
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class FfmCallBuildItem