From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10355 invoked by alias); 7 Sep 2017 05:42:13 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 10300 invoked by uid 10080); 7 Sep 2017 05:42:13 -0000 Date: Thu, 07 Sep 2017 05:42:00 -0000 Message-ID: <20170907054213.10298.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Let RTEMS provide clock() X-Act-Checkin: newlib-cygwin X-Git-Author: Sebastian Huber X-Git-Refname: refs/heads/master X-Git-Oldrev: e18b7ffa4893aa1011bae52e6e7a8f1bfcc336d5 X-Git-Newrev: f9205f1d470ed1a214b841b6d2fd60fea14954cb X-SW-Source: 2017-q3/txt/msg00066.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f9205f1d470ed1a214b841b6d2fd60fea14954cb commit f9205f1d470ed1a214b841b6d2fd60fea14954cb Author: Sebastian Huber Date: Wed Sep 6 08:43:26 2017 +0200 Let RTEMS provide clock() Newlib uses _times_r() in clock(). The problem is that the _times_r() clock frequency is defined by sysconf(_SC_CLK_TCK). The clock frequency of clock() is the constant CLOCKS_PER_SEC. FreeBSD uses getrusage() for clock(). Since RTEMS has only one process, the implementation can be simplified. Signed-off-by: Sebastian Huber Diff: --- newlib/configure.host | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/configure.host b/newlib/configure.host index 3d967a1..ba2d8c6 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -605,7 +605,7 @@ case "${host}" in default_newlib_io_long_long="yes" default_newlib_io_c99_formats="yes" newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB" - newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC" + newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC" # turn off unsupported items in posix directory newlib_cflags="${newlib_cflags} -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT -D_NO_GETPASS -D_NO_SIGSET -D_NO_WORDEXP -D_NO_POPEN -D_NO_POSIX_SPAWN" # turn off using cli/sti in i386 setjmp/longjmp