tools/sd-notify.h: Include string.h too

Alpine Linux, when using --enable-systemd to get the init files, fails with:

  tools/include/xen-sd-notify.h:69:3: error: call to undeclared library
  function 'memcpy' with type 'void *(void *, const void *, unsigned long)';
  ISO C99 and later do not support implicit function declarations
  [-Wimplicit-function-declaration]
     69 |   memcpy(socket_addr.sun.sun_path, socket_path, path_length);
        |   ^

This will be down to using musl rather than glibc.  Include the appropriate
header.

Fixes: 78510f3a15 ("tools: Import stand-alone sd_notify() implementation from systemd")
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Anthony PERARD <anthony.perard@vates.tech>
This commit is contained in:
Andrew Cooper committed 2025-12-12 03:04:48 +00:00
1 parent 6ccebacb53
commit 8efff5a69a
1 file changed
+1
+1
View File
@@ -20,6 +20,7 @@
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.