-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial import of <linux/rtc.h> related stuff #965
Conversation
For future FFI shenanigans ;)
}; | ||
static const int RTC_WKALM_SET = 1076391951; | ||
static const int RTC_WKALM_RD = 2150133776; | ||
typedef long int time_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might have been tricky (Y2K38 stuff), but apparently is accurate on Kobo:
echo | arm-kobo-linux-gnueabihf-gcc -E -xc -include 'time.h' - | grep time_t
__extension__ typedef long int __time_t;
typedef __time_t time_t;
__time_t tv_sec;
extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
extern double difftime (time_t __time1, time_t __time0)
extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
extern struct tm *gmtime_r (__const time_t *__restrict __timer,
extern struct tm *localtime_r (__const time_t *__restrict __timer,
extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
extern char *ctime_r (__const time_t *__restrict __timer,
extern int stime (__const time_t *__when) __attribute__ ((__nothrow__ , __leaf__));
extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
Plus, it didn't blow up at runtime on my H2O :D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll still pcall it of course. :-p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ultimately we use it as a pointer, so it wouldn't matter too much, I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
Best to include a link. ;-) https://gitter.im/koreader/koreader?at=5d7138eac5939027201a53c9 |
Depends on koreader/koreader-base#963. Also includes Initial import of <linux/rtc.h> related stuff koreader/koreader-base#965
Depends on koreader/koreader-base#963. Also includes Initial import of <linux/rtc.h> related stuff koreader/koreader-base#965
Follow-up to <koreader#965>. Normally Linux RTC should only be in UTC.
Follow-up to <#965>. Normally Linux RTC should only be in UTC.
Depends on koreader/koreader-base#963. Also includes Initial import of <linux/rtc.h> related stuff koreader/koreader-base#965
For future FFI shenanigans ;)
(c.f., today's gitter for background).