From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: newlib@sourceware.org
Subject: [PATCH] Let RTEMS provide clock()
Date: Wed, 06 Sep 2017 08:53:00 -0000 [thread overview]
Message-ID: <20170906065845.13573-1-sebastian.huber@embedded-brains.de> (raw)
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 <sebastian.huber@embedded-brains.de>
---
newlib/configure.host | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/newlib/configure.host b/newlib/configure.host
index 3d967a11b..ba2d8c6c7 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
--
2.12.3
next reply other threads:[~2017-09-06 6:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-06 8:53 Sebastian Huber [this message]
[not found] ` <20170906084123.GD14453@calimero.vinschen.de>
2017-09-06 13:06 ` Sebastian Huber
2017-09-06 14:30 ` Joel Sherrill
2017-09-06 15:25 ` Craig Howland
2017-09-07 5:52 ` Sebastian Huber
2017-09-06 13:56 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170906065845.13573-1-sebastian.huber@embedded-brains.de \
--to=sebastian.huber@embedded-brains.de \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).