[PATCH 09/18] ptpd: Add malloc definitions for RTEMS
Gabriel Moyano
gabriel.moyano at dlr.de
Wed Apr 12 13:54:13 UTC 2023
From: Chris Johns <chrisj at rtems.org>
---
freebsd/contrib/ptpd/src/dep/sys.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/freebsd/contrib/ptpd/src/dep/sys.c b/freebsd/contrib/ptpd/src/dep/sys.c
index b5831701..6c93bf4c 100644
--- a/freebsd/contrib/ptpd/src/dep/sys.c
+++ b/freebsd/contrib/ptpd/src/dep/sys.c
@@ -2668,3 +2668,19 @@ int setCpuAffinity(int cpu) {
return -1;
}
+
+#if __rtems__
+void *malloc (size_t n);
+
+/* Allocate an N-byte block of memory from the heap.
+ If N is zero, allocate a 1-byte block. */
+
+void *
+rpl_malloc (size_t n)
+{
+ if (n == 0)
+ n = 1;
+ return malloc (n);
+}
+
+#endif /* __rtems__ */
--
2.25.1
More information about the devel
mailing list