summaryrefslogtreecommitdiffstats
path: root/src/privsep-root.h
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-01-08 20:13:20 +0000
committerRoy Marples <roy@marples.name>2020-01-08 20:13:20 +0000
commitfa070df4e9ac982c9097fdfdbfde16ed3bd693b4 (patch)
tree4c0f27df4110076994676980475f569ae6dc155d /src/privsep-root.h
parent7c434303d65a005aca39c618e476d53039541d78 (diff)
downloaddhcpcd-fa070df4e9ac982c9097fdfdbfde16ed3bd693b4.tar.xz
ioctl: The POSIX signature differs from BSD and glibc
BSD and glibc have the signature for request as unsigned long. musl and Solaris have a signed int. As such, we need to detect this at compile time and adjust the signature of our internal ioctl functions to match. To keep the onwire format the same, memcpy the request to the unsigned long request and back again, thus preserving the signedness.
Diffstat (limited to 'src/privsep-root.h')
-rw-r--r--src/privsep-root.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/privsep-root.h b/src/privsep-root.h
index 4f6ac955..57862626 100644
--- a/src/privsep-root.h
+++ b/src/privsep-root.h
@@ -29,11 +29,13 @@
#ifndef PRIVSEP_ROOT_H
#define PRIVSEP_ROOT_H
+#include "if.h"
+
pid_t ps_root_start(struct dhcpcd_ctx *ctx);
int ps_root_stop(struct dhcpcd_ctx *ctx);
ssize_t ps_root_readerror(struct dhcpcd_ctx *);
-ssize_t ps_root_ioctl(struct dhcpcd_ctx *, unsigned long, void *, size_t);
+ssize_t ps_root_ioctl(struct dhcpcd_ctx *, ioctl_request_t, void *, size_t);
ssize_t ps_root_os(struct ps_msghdr *, struct msghdr *);
#if defined(BSD) || defined(__sun)
ssize_t ps_root_route(struct dhcpcd_ctx *, void *, size_t);