summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/include/machine
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-09-11 10:18:30 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-09-11 10:25:49 +0200
commit7b1aea98a126e1a9f90afb7f1fb8ab0ebe2b6336 (patch)
tree2cfcf2e7b117545f4e846c5564d4c6618e85e241 /rtemsbsd/include/machine
parentrtemsbsd: remove dead code fb.c (diff)
downloadrtems-libbsd-7b1aea98a126e1a9f90afb7f1fb8ab0ebe2b6336.tar.bz2
Add wrapper for strndup()
Diffstat (limited to 'rtemsbsd/include/machine')
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-program.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/rtemsbsd/include/machine/rtems-bsd-program.h b/rtemsbsd/include/machine/rtems-bsd-program.h
index 70030517..f71ac9cd 100644
--- a/rtemsbsd/include/machine/rtems-bsd-program.h
+++ b/rtemsbsd/include/machine/rtems-bsd-program.h
@@ -107,7 +107,10 @@ void *
rtems_bsd_program_reallocf(void *ptr, size_t size);
char *
-rtems_bsd_program_strdup(const char *s1);
+rtems_bsd_program_strdup(const char *s);
+
+char *
+rtems_bsd_program_strndup(const char *s, size_t size);
int
rtems_bsd_program_vasprintf(char **strp, const char *fmt, va_list ap);
@@ -177,7 +180,11 @@ rtems_bsd_program_free(void *ptr);
#endif
#ifndef RTEMS_BSD_PROGRAM_NO_STRDUP_WRAP
- #define strdup(s1) rtems_bsd_program_strdup(s1)
+ #define strdup(s) rtems_bsd_program_strdup(s)
+#endif
+
+#ifndef RTEMS_BSD_PROGRAM_NO_STRNDUP_WRAP
+ #define strndup(s, size) rtems_bsd_program_strndup(s, size)
#endif
#ifndef RTEMS_BSD_PROGRAM_NO_VASPRINTF_WRAP