Re: [PATCH 6/8] socket: Add struct sock_timeval

From
Deepa Dinamani <hidden>
Date
2018-11-25 04:52:22
Also in
lkml
Reply to
Willem de Bruijn, 2018-11-24
On Sat, Nov 24, 2018 at 11:38 AM Willem de Bruijn
[off-list ref] wrote:
On Sat, Nov 24, 2018 at 4:00 AM Deepa Dinamani [off-list ref] wrote:
quoted
The new type is meant to be used as a y2038 safe structure
to be used as part of cmsg data.
Presently the SO_TIMESTAMP socket option uses struct timeval
for timestamps. This is not y2038 safe.
Subsequent patches in the series add new y2038 safe socket
option to be used in the place of SO_TIMESTAMP_OLD.
struct sock_timeval will be used as the timestamp format
at that time.

struct sock_timeval also maintains the same layout across
32 bit and 64 bit ABIs.

Signed-off-by: Deepa Dinamani <redacted>
---
 include/uapi/linux/time.h | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/include/uapi/linux/time.h b/include/uapi/linux/time.h
index 04d5587f30d3..106f9398c285 100644
--- a/include/uapi/linux/time.h
+++ b/include/uapi/linux/time.h
@@ -70,6 +70,11 @@ struct __kernel_old_timeval {
 };
 #endif

+struct sock_timeval {
+       long long tv_sec;
+       long long tv_usec;
should these use fixed-width type __u64?
We have avoided using __u64/__s64 types for time types in uapi.
I think we did this for portability reasons.
Although this new type might not be required to be interpreted in
libc, I would prefer for this to be long long.
If there is a strong preference then I can change it.

-Deepa
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038
Thread (35 messages) 35 messages, 4 authors, last reply 2018-11-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help