Skip to content

Commit

Permalink
linux.c: don't use pread64
Browse files Browse the repository at this point in the history
Starting with musl-1.2.4 all LFS64 APIs have been removed since musl is
always 64-bit and yara now fails with implicit function declarations for
pread64.

However configure.ac already sets AC_SYS_LARGEFILE so changing them all
to pread will work with both glibc and musl.
  • Loading branch information
orbea committed Feb 26, 2024
1 parent 2e2cd20 commit 39ee304
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libyara/proc/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ YR_API const uint8_t* yr_process_fetch_memory_block_data(YR_MEMORY_BLOCK* block)
// target process VM.
if (fd == -1)
{
if (pread64(
if (pread(
proc_info->mem_fd,
(void*) context->buffer,
block->size,
Expand All @@ -265,7 +265,7 @@ YR_API const uint8_t* yr_process_fetch_memory_block_data(YR_MEMORY_BLOCK* block)
{
goto _exit;
}
if (pread64(
if (pread(
proc_info->pagemap_fd,
pagemap,
sizeof(uint64_t) * block->size / page_size,
Expand All @@ -284,7 +284,7 @@ YR_API const uint8_t* yr_process_fetch_memory_block_data(YR_MEMORY_BLOCK* block)
// swap-backed and if it differs from our mapping.
uint8_t buffer[page_size];

if (pread64(
if (pread(
proc_info->mem_fd,
buffer,
page_size,
Expand Down

0 comments on commit 39ee304

Please sign in to comment.