Skip to content

JNRPosixAPI#fallocate method on Alpine Linx 3.19+ fails with UnsatisfiedLinkError #31

@splunk-chowiel

Description

@splunk-chowiel

On Alpine 3.19+ running on aarch64 AWS EC2 Graviton instances, the C lib api, fallocate64, is no longer available. The Posix layer should invoke fallocate in this case.

Proposed fix in the JNRPosixAPI class would be to introduce a system property that allows fallocate to always be invoked:

    @Override
    public int fallocate(int fd, int mode, long offset, long length) {
        if (Boolean.parseBoolean(System.getProperty("net.openhft.posix.internal.jnr.JNRPosixAPI.fallocate_no_shim"))) {
            return jnr.fallocate(fd, mode, offset, length);
        }
        return UnsafeMemory.IS32BIT ? jnr.fallocate(fd, mode, offset, length) : jnr.fallocate64(fd, mode, offset, length);
    }

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions