Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from sMezaOrellana/master
Browse files Browse the repository at this point in the history
Added support for compilation on glibc 2.33 and onwards
  • Loading branch information
sholtrop committed Jan 18, 2024
2 parents 0714f84 + 584415a commit 7d2cf81
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ldp_fuse/include/ldpfuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,19 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>

/*
from version GLIBC 2.32 unistd.h contains constant definitions that we need, but also `close_range`
This causes conflicts as symbols with those names are also
necessarily defined here. We therefore overwrite them using #define.
*/
#if (__GLIBC__ > 1 && __GLIBC_MINOR__ > 32)
#define close_range __renamed_close_range
#include <unistd.h>
#undef close_range
#else
#include <unistd.h>
#endif

// Include `cwalk` directly as this lib is header-only
#include "./cwalk.c"
Expand Down Expand Up @@ -418,7 +430,15 @@ static char* resolve_fd(int fd) {

#define LDP_FUSE_PATH_MAX_LEN 256

/*
from version 2.32 glibc does not have the _STAT_VER macro
defined in "sys/stat.h"
*/
#if (__GLIBC__ > 1 && __GLIBC_MINOR__ > 32)
#define STAT_VER 0
#else
#define STAT_VER _STAT_VER
#endif

// Whether `path` is in the LDP_FUSE filesystem. The LDP_FUSE filesystem is
// mounted under the LDP_FUSE_PATH env variable.
Expand Down

0 comments on commit 7d2cf81

Please sign in to comment.