#define DBG(...)
#endif /* MEMIF_DBG */
+#ifndef HAS_LIB_BSD
+static inline size_t
+strlcpy (char *dest, const char *src, size_t len)
+{
+ const char *s = src;
+ size_t n = len;
+
+ while (--n > 0)
+ {
+ if ((*dest++ = *s++) == '\0')
+ break;
+ }
+
+ if (n == 0)
+ {
+ if (len != 0)
+ *dest = '\0';
+ while (*s++)
+ ;
+ }
+
+ return (s - src - 1);
+}
+#else
+#include <bsd/string.h>
+#endif
+
typedef enum
{
MEMIF_SOCKET_TYPE_NONE = 0, /* unassigned, not used by any interface */
int int_fd;
uint64_t int_count;
- uint32_t alloc_bufs;
+ uint32_t next_buf; /* points to next free buffer */
} memif_queue_t;
typedef struct memif_msg_queue_elt
/* if region doesn't contain shared memory, mmap region, check ring cookie */
int memif_connect1 (memif_connection_t * c);
-/* memory map region, initalize rings and queues */
+/* memory map region, initialize rings and queues */
int memif_init_regions_and_queues (memif_connection_t * c);
int memif_disconnect_internal (memif_connection_t * c);