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
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 callfirstVariadicArg— 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumSpecifies whether a critical downcall allows the native function to access Java heap objects during execution. -
Constructor Summary
ConstructorsConstructorDescriptionFfmDowncallBuildItem(FfmType returnType, FfmType... parameterTypes) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic FfmDowncallBuildItem.BuilderCreates a builder for a downcall registration.booleanThe critical option for this downcall, ornullif not set.intThe index of the first variadic argument, or-1if not set.inthashCode()booleanWhether any linker options are set on this downcall.booleanWhether this downcall captures native error state (e.g.Methods inherited from class io.quarkus.deployment.builditem.nativeimage.FfmCallBuildItem
getParameterTypes, getReturnType
-
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.Usebuilder(FfmType, FfmType...)insteadCreates a downcall registration without any linker options.- Parameters:
returnType- the return typeparameterTypes- the parameter types
-
-
Method Details
-
builder
Creates a builder for a downcall registration.- Parameters:
returnType- the return typeparameterTypes- 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-1if not set. -
getCritical
The critical option for this downcall, ornullif not set. -
hasOptions
public boolean hasOptions()Whether any linker options are set on this downcall. -
equals
- Overrides:
equalsin classFfmCallBuildItem
-
hashCode
public int hashCode()- Overrides:
hashCodein classFfmCallBuildItem
-
builder(FfmType, FfmType...)instead