From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30863 invoked by alias); 24 Jul 2019 10:01:10 -0000 Mailing-List: contact libc-help-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: libc-help-owner@sourceware.org Received: (qmail 30852 invoked by uid 89); 24 Jul 2019 10:01:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=3.6 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.3.1 spammy=H*UA:3.1.11, H*UA:1.9.2.18, H*u:1.9.2.18, H*u:3.1.11 X-HELO: heian.cn.fujitsu.com Received: from mail.cn.fujitsu.com (HELO heian.cn.fujitsu.com) (183.91.158.132) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 Jul 2019 10:01:08 +0000 Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 24 Jul 2019 18:01:05 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id AC7044CDE88F for ; Wed, 24 Jul 2019 18:01:05 +0800 (CST) Received: from [10.167.215.46] (10.167.215.46) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.439.0; Wed, 24 Jul 2019 18:01:00 +0800 Message-ID: <5D382C5F.6020806@cn.fujitsu.com> Date: Wed, 24 Jul 2019 10:01:00 -0000 From: Yang Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: Subject: question about prctl return value type Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit X-yoursite-MailScanner-ID: AC7044CDE88F.AF6D7 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: xuyang2018.jy@cn.fujitsu.com X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00021.txt.bz2 Hi All Since kernel syscall use long value for return, why we set int in sys/prctl.h(glibc). as below: /include/sys/prctl.h 1 #ifndef _SYS_PRCTL_H 2 #include_next 3 4 # ifndef _ISOMAC 5 6 extern int __prctl (int __option, ...); 7 8 # endif /* !_ISOMAC */ 9 #endif If we calling prctl(PR_SET_TIMERSLACK, ULONG_MAX) and then calling prctl(PR_GET_TIMERSLACK), the value will be truncated into INT_MAX(or convered into unsinged,it is UINT_MAX) on 64bit machine. Or, this is a glibc limitation for prctl interfaces? ps:After kernel commit da8b44d5a9f ("timer: convert timer_slack_ns from unsigned long to u64"), we limit under ULONG_MAX when calling PR_GET_TIMERSLACK. I think we can use long instead of int in sys/prctl.h. Thanks Yang Xu