From patchwork Sun Mar 29 04:16:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 38652 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by sourceware.org (Postfix) with ESMTPS id 3FB0A385E44C for ; Sun, 29 Mar 2020 04:16:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3FB0A385E44C Received: from mailhost.synopsys.com (sv1-mailhost2.synopsys.com [10.205.2.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 56F8D40570; Sun, 29 Mar 2020 04:16:19 +0000 (UTC) Received: from vineetg-Latitude-E7450.internal.synopsys.com (unknown [10.13.182.230]) by mailhost.synopsys.com (Postfix) with ESMTP id 43D4AA0077; Sun, 29 Mar 2020 04:16:13 +0000 (UTC) From: Vineet Gupta To: libc-alpha@sourceware.org Cc: Alistair Francis , Lukasz Majewski , Stepan Golosunov , linux-snps-arc@lists.infradead.org, Vineet Gupta Subject: [PATCH] provide y2038 safe socket constants Date: Sat, 28 Mar 2020 21:16:12 -0700 Message-Id: <20200329041612.4071-1-vgupta@synopsys.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Spam-Status: No, score=-20.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2020 04:16:38 -0000 These will be used by upcoming RV32 and ARC ports and any future ports Signed-off-by: Vineet Gupta --- sysdeps/unix/sysv/linux/bits/socket-constants.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/bits/socket-constants.h b/sysdeps/unix/sysv/linux/bits/socket-constants.h index 9dcc19cd5380..8a48ae7d0ca2 100644 --- a/sysdeps/unix/sysv/linux/bits/socket-constants.h +++ b/sysdeps/unix/sysv/linux/bits/socket-constants.h @@ -20,6 +20,8 @@ # error "Never include directly; use instead." #endif +#include + #define SOL_SOCKET 1 #define SO_ACCEPTCONN 30 #define SO_BROADCAST 6 @@ -30,9 +32,17 @@ #define SO_OOBINLINE 10 #define SO_RCVBUF 8 #define SO_RCVLOWAT 18 -#define SO_RCVTIMEO 20 +#if __TIMESIZE == 64 && __WORDSIZE == 32 +# define SO_RCVTIMEO 66 +#else +# define SO_RCVTIMEO 20 +#endif #define SO_REUSEADDR 2 #define SO_SNDBUF 7 #define SO_SNDLOWAT 19 -#define SO_SNDTIMEO 21 +#if __TIMESIZE == 64 && __WORDSIZE == 32 +# define SO_SNDTIMEO 67 +#else +# define SO_SNDTIMEO 21 +#endif #define SO_TYPE 3