<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Include a lot more headers and remove a bunch of braindead __linux__ checks

--- a/dump.c
+++ b/dump.c
@@ -30,10 +30,8 @@
  */
 
 #include &lt;stdio.h&gt;
-#ifndef __linux__
 #include &lt;stdlib.h&gt;
 #include &lt;unistd.h&gt;
-#endif
 #include &lt;string.h&gt;
 #include &lt;errno.h&gt;
 #include &lt;fcntl.h&gt;
--- a/errors.c
+++ b/errors.c
@@ -26,9 +26,7 @@
  */
 
 #include &lt;stdio.h&gt;
-#ifndef __linux__
 #include &lt;stdlib.h&gt;
-#endif
 #include &lt;string.h&gt;
 #include &lt;stdarg.h&gt;
 
@@ -115,8 +113,8 @@
     va_end(ap);
 
 #ifdef __linux__
-    if (value &gt; 0 &amp;&amp; value &lt; sys_nerr) {
-	fprintf(stderr, "  (%s)\n", sys_errlist[value]);
+    if (value &gt; 0) {
+	fprintf(stderr, "  (%s)\n", strerror(value));
     } else {
 	fprintf(stderr, "\n");
     }
@@ -144,8 +142,8 @@
     va_end(ap);
 
 #ifdef __linux__
-    if (value &gt; 0 &amp;&amp; value &lt; sys_nerr) {
-	fprintf(stderr, "  (%s)\n", sys_errlist[value]);
+    if (value &gt; 0) {
+	fprintf(stderr, "  (%s)\n", strerror(value));
     } else {
 	fprintf(stderr, "\n");
     }
--- a/fdisk.c
+++ b/fdisk.c
@@ -62,6 +62,7 @@
 #include &lt;unistd.h&gt;
 #include &lt;stdio.h&gt;
 #include &lt;stdlib.h&gt;
+#include &lt;string.h&gt;
 #include &lt;fcntl.h&gt;
 #include &lt;ctype.h&gt;
 #include &lt;setjmp.h&gt;
--- a/fdisklabel.c
+++ b/fdisklabel.c
@@ -38,6 +38,7 @@
 #include &lt;unistd.h&gt;
 #include &lt;stdio.h&gt;
 #include &lt;stdlib.h&gt;
+#include &lt;string.h&gt;
 #include &lt;fcntl.h&gt;
 #include &lt;ctype.h&gt;
 #include &lt;setjmp.h&gt;
--- a/io.c
+++ b/io.c
@@ -26,9 +26,9 @@
  */
 
 #include &lt;stdio.h&gt;
-#ifndef __linux__
 #include &lt;stdlib.h&gt;
 #include &lt;fcntl.h&gt;
+#ifndef __linux__
 #include &lt;SCSI.h&gt;
 #else
 #ifdef __GLIBC__
--- a/partition_map.c
+++ b/partition_map.c
@@ -26,10 +26,9 @@
  */
 
 #include &lt;stdio.h&gt;
-#ifndef __linux__
+#include &lt;string.h&gt;
 #include &lt;stdlib.h&gt;
 #include &lt;unistd.h&gt;
-#endif
 #include &lt;errno.h&gt;
 
 #include &lt;fcntl.h&gt;
--- a/pdisk.c
+++ b/pdisk.c
@@ -32,10 +32,11 @@
 #include &lt;getopt.h&gt;
 #include &lt;stddef.h&gt;
 #else
-#include &lt;stdlib.h&gt;
-#include &lt;unistd.h&gt;
 #include &lt;SIOUX.h&gt;
 #endif
+#include &lt;stdlib.h&gt;
+#include &lt;unistd.h&gt;
+#include &lt;string.h&gt;
 #include &lt;errno.h&gt;
 
 #ifdef __linux__
</pre></body></html>