<html>Hi, Filip.<br /><br />This is a very unclear way to set the structure elements:<br /><br />+    struct rtc_time rtc_set_time = {0, 15, 13, 26, 8, 119, 0, 0, 0};<br /><br />Simple setting structure elements separately would be much better.<br /><br />Also, why do you use such numbers: 15, 13,...? Is it just a random choice?<br /><br />Thanks,<br />Aleksandar<br /><br />-------- Original Message --------<br />Subject: [LTP] [PATCH 1/3] testcases/kernel/syscalls/ioctl: Add test for RTC ioctls used to read and set RTC time<br />Date: Wednesday, April 22, 2020 17:28 CEST<br />From: Filip Bozuta <fbozuta1@gmail.com><br />To: ltp@lists.linux.it<br />CC: pvorel@suse.cz, Aleksandar.Markovic@rt-rk.com, laurent@vivier.eu<br />References: <20200422152841.13432-1-fbozuta1@gmail.com><br /><br /><br /> <blockquote type="cite" cite="20200422152841.13432-2-fbozuta1@gmail.com"><br />This patch tests functionalities of following ioctls:<br /><br />RTC_RD_TIME - Getting RTC time<br /><br />Returns this RTC's time in the following structure:<br /><br />struct rtc_time {<br />int tm_sec;<br />int tm_min;<br />int tm_hour;<br />int tm_mday;<br />int tm_mon;<br />int tm_year;<br />int tm_wday; /* unused */<br />int tm_yday; /* unused */<br />int tm_isdst; /* unused */<br />};<br /><br />The fields in this structure have the same meaning and<br />ranges as the tm structure described in gmtime man page.<br />A pointer to this structure should be passed as the third<br />ioctl argument.<br /><br />RTC_SET_TIME - Setting RTC time<br /><br />Sets this RTC's time to the time specified by the rtc_time<br />structure pointed to by the third ioctl argument. To set the<br />RTC's time the process must be privileged (i.e., have the<br />CAP_SYS_TIME capability).<br /><br />Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com><br />---<br />runtest/syscalls | 2 +<br />testcases/kernel/syscalls/ioctl/.gitignore | 1 +<br />testcases/kernel/syscalls/ioctl/ioctl_rtc01.c | 112 ++++++++++++++++++<br />3 files changed, 115 insertions(+)<br />create mode 100644 testcases/kernel/syscalls/ioctl/ioctl_rtc01.c<br /> </blockquote><br /><br /><br /> </html>