On 12/3/24 6:48 AM, Samuel Thibault wrote:
Zhaoming Luo, le mar. 03 déc. 2024 06:42:07 +0800, a ecrit:
On 12/2/24 10:12 AM, Samuel Thibault wrote:
Please factorize these with the linux port, by putting them into a
shared file that is linked-in in both ports cases.
Do you mean having the following structure?
          /----- hurd-hwlock-rtc.c \
hwclock.c                           hwclock-rtc.c
          \----- linux-hwlock-rtc.c /

hwclock-rtc.c contains close_rtc, open_rtc, etc.

Yes.
I think another of supporting hwclock in Hurd is implementing more ioctl calls (RTC_UIE_ON, RTC_PARAM_GET, etc) for rtc. The current compile errors seem to be mainly due to the lack of RTC ioctl macros (i.e. RTC_UIE_ON, etc). The issues with __u64, __s64, and __u32 (they seem to be Linux-specific) can be solved by using:

```
#ifdef __gnu_hurd__
typedef unsigned long long __u64;
typedef signed long long __s64;
typedef unsigned int __u32;
#endif
```

Providing a rtc ioctl interface similar to Linux can avoid large change on util-linux upstream. Maybe I should go this way?

--
Zhaoming Luo


Reply via email to