summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-03-06 12:07:32 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-03-06 12:09:54 +0100
commit18a623e5b2acc9eff2c2b6ca54041cfa74862a6c (patch)
tree720df01fa213cd8d84e5b13d071f2db7aba8ea42
parent08f48819f7d31b612aa1f4caba52fa59514e3c43 (diff)
downloadrtems-libbsd-18a623e5b2acc9eff2c2b6ca54041cfa74862a6c.tar.bz2
Provide strtoq() and strtouq()
-rw-r--r--freebsd/sys/sys/systm.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/freebsd/sys/sys/systm.h b/freebsd/sys/sys/systm.h
index 2f781e9e..3512c49e 100644
--- a/freebsd/sys/sys/systm.h
+++ b/freebsd/sys/sys/systm.h
@@ -276,8 +276,27 @@ int sscanf(const char *, char const *, ...) __nonnull(1) __nonnull(2) __scanflik
int vsscanf(const char *, char const *, __va_list) __nonnull(1) __nonnull(2) __scanflike(2, 0);
long strtol(const char *, char **, int) __nonnull(1);
u_long strtoul(const char *, char **, int) __nonnull(1);
+#ifndef __rtems__
quad_t strtoq(const char *, char **, int) __nonnull(1);
u_quad_t strtouq(const char *, char **, int) __nonnull(1);
+#else /* __rtems__ */
+long long strtoll(const char *, char **, int);
+unsigned long long strtoull(const char *, char **, int);
+
+static inline quad_t __nonnull(1)
+strtoq(const char *nptr, char **endptr, int base)
+{
+
+ return (strtoll(nptr, endptr, base));
+}
+
+static inline u_quad_t __nonnull(1)
+strtouq(const char *nptr, char **endptr, int base)
+{
+
+ return (strtoull(nptr, endptr, base));
+}
+#endif /* __rtems__ */
void tprintf(struct proc *p, int pri, const char *, ...) __printflike(3, 4);
void vtprintf(struct proc *, int, const char *, __va_list) __printflike(3, 0);
void hexdump(const void *ptr, int length, const char *hdr, int flags);