Skip to content

Initial import of <linux/rtc.h> related stuff#965

Merged
Frenzie merged 1 commit intokoreader:masterfrom
NiLuJe:master
Sep 5, 2019
Merged

Initial import of <linux/rtc.h> related stuff#965
Frenzie merged 1 commit intokoreader:masterfrom
NiLuJe:master

Conversation

@NiLuJe
Copy link
Copy Markdown
Member

@NiLuJe NiLuJe commented Sep 5, 2019

For future FFI shenanigans ;)

(c.f., today's gitter for background).

For future FFI shenanigans ;)
};
static const int RTC_WKALM_SET = 1076391951;
static const int RTC_WKALM_RD = 2150133776;
typedef long int time_t;
Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

@NiLuJe NiLuJe Sep 5, 2019

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Sep 5, 2019

Best to include a link. ;-) https://gitter.im/koreader/koreader?at=5d7138eac5939027201a53c9

@Frenzie Frenzie merged commit 89dc5d4 into koreader:master Sep 5, 2019
Frenzie added a commit to Frenzie/koreader that referenced this pull request Sep 5, 2019
Depends on koreader/koreader-base#963.

Also includes Initial import of <linux/rtc.h> related stuff koreader/koreader-base#965
Frenzie added a commit to koreader/koreader that referenced this pull request Sep 5, 2019
Depends on koreader/koreader-base#963.

Also includes Initial import of <linux/rtc.h> related stuff koreader/koreader-base#965
Frenzie added a commit to Frenzie/koreader-base that referenced this pull request Sep 6, 2019
Follow-up to <koreader#965>.

Normally Linux RTC should only be in UTC.
@Frenzie Frenzie mentioned this pull request Sep 6, 2019
Frenzie added a commit that referenced this pull request Sep 6, 2019
Follow-up to <#965>.

Normally Linux RTC should only be in UTC.
mwoz123 pushed a commit to mwoz123/koreader that referenced this pull request Mar 29, 2020
Depends on koreader/koreader-base#963.

Also includes Initial import of <linux/rtc.h> related stuff koreader/koreader-base#965
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