Skip to content

Conversation

@Giperboloid
Copy link

Hi,
Several minor changes are proposed that could improve portability in the future.

@CLAassistant
Copy link

CLAassistant commented Oct 19, 2025

CLA assistant check
All committers have signed the CLA.

@Giperboloid Giperboloid force-pushed the platform_specific_fixes branch from a701d25 to dd5a0eb Compare October 20, 2025 07:55
polar_monitor extension with no functional changes for Linux.

In particular:

- Removed inclusion of <linux/limits.h> from procstat.h and related sources.
Verified that no constants (e.g., PATH_MAX, NAME_MAX) from <linux/limits.h>
are used in procstat.h, procstat.c, or polar_monitor_io.c.

- Wrapped usage of <linux/sockios.h>, TCP_INFO, SOL_TCP, SIOCOUTQ, and
SIOCINQ with #ifdef __linux__ in polar_network_stats.c
Provided safe fallbacks: set values to 0 or skip updates.
polar_vfs.

In particular:

- Gate .vfs_posix_fallocate behind HAVE_POSIX_FALLOCATE across VFS managers.
Wrap .vfs_posix_fallocate assignments with HAVE_POSIX_FALLOCATE and set to
NULL when the platform does not provide posix_fallocate.
In particular:

- an early return is added when open() fails to avoid calling
fadvise()/close() on an invalid fd.

- platform specific posix_fadvise() call was replaced with
appropriate polar_posix_fadvise() call. The invocation is
guarded with directives USE_POSIX_FADVISE and POSIX_FADV_DONTNEED.
Falls back to no-op when the call is unavailable. This aligns
the function's behavior with existing PolarDB practice in fd.c,
xlog.c, etc.

- the polar_fd.h header file was included to make the
polar_posix_fadvise() function available.
@Giperboloid Giperboloid force-pushed the platform_specific_fixes branch from dd5a0eb to c35f1c2 Compare October 20, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants