Skip to content

hwclock: use RTC_PARAM_GET and RTC_VL_READ for ifdefs - #4532

Merged
karelzak merged 1 commit into
util-linux:masterfrom
karelzak:PR/hwclock-rtc-ifdefs
Aug 11, 2026
Merged

hwclock: use RTC_PARAM_GET and RTC_VL_READ for ifdefs#4532
karelzak merged 1 commit into
util-linux:masterfrom
karelzak:PR/hwclock-rtc-ifdefs

Conversation

@karelzak

@karelzak karelzak commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Replace broad #ifndef __GNU__ guards with feature-specific #ifdef RTC_PARAM_GET and #ifdef RTC_VL_READ to guard the code that depends
on these ioctls.

Move the fallback definitions for RTC_PARAM_GET, RTC_PARAM_SET,
RTC_VL_READ, and RTC_VL_CLR from hwclock-rtc.c to hwclock.h under
#ifdef __linux__, so both hwclock.c and hwclock-rtc.c can use the
feature macros consistently.

This also makes it straightforward for PR #4513 to add new RTC
parameters — the new RTC_PARAM_BATTERY_LOW_DETECT define and
hwclock_params[] entry will naturally sit inside the existing
#ifdef RTC_PARAM_GET guards.

Replace broad #ifndef __GNU__ guards with feature-specific #ifdef
RTC_PARAM_GET and #ifdef RTC_VL_READ to guard the code that depends
on these ioctls.

Move the fallback definitions for RTC_PARAM_GET, RTC_PARAM_SET,
RTC_VL_READ, and RTC_VL_CLR from hwclock-rtc.c to hwclock.h under
feature macros consistently.

Signed-off-by: Karel Zak <kzak@redhat.com>
@karelzak
karelzak force-pushed the PR/hwclock-rtc-ifdefs branch from b0d9d9a to f089382 Compare August 6, 2026 16:23
@karelzak
karelzak merged commit 53e4421 into util-linux:master Aug 11, 2026
48 of 61 checks passed
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.

1 participant