--- /dev/null
+https://bugs.gentoo.org/580052
+https://sourceforge.net/p/hdparm/patches/44/
+
+--- a/geom.c
++++ b/geom.c
+@@ -15,6 +15,7 @@
+ #include <errno.h>
+ #include <dirent.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/ioctl.h>
+ #include <linux/types.h>
+ #include <linux/fs.h>
+--- a/sysfs.c
++++ b/sysfs.c
+@@ -15,6 +15,7 @@
+ #include <dirent.h>
+ #include <limits.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <linux/types.h>
+
+ #include "hdparm.h"
EAPI="4"
-inherit toolchain-funcs flag-o-matic
+inherit toolchain-funcs flag-o-matic eutils
DESCRIPTION="Utility to change hard drive performance parameters"
HOMEPAGE="http://sourceforge.net/projects/hdparm/"
IUSE="static"
src_prepare() {
+ epatch "${FILESDIR}"/${P}-sysmacros.patch #580052
use static && append-ldflags -static
sed -i \
-e "/^CFLAGS/ s:-O2:${CFLAGS}:" \