Fix:

error: implicit declaration of function 'do_write' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
error: implicit declaration of function 'fork' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
error: implicit declaration of function 'gettimeofday' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
error: implicit declaration of function 'ioctl' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned long)' [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'strcpy' with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'strerror' with type 'char *(int)' [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'strncpy' with type 'char *(char *, const char *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
error: implicitly declaring library function 'strrchr' with type 'char *(const char *, int)' [-Werror,-Wimplicit-function-declaration]
--- configure.orig	2005-05-12 21:02:15.000000000 -0500
+++ configure	2024-08-12 02:43:22.000000000 -0500
@@ -3779,6 +3779,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -3792,7 +3793,7 @@
 
 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int
-main ()
+main (void)
 {
   int i;
   for (i = 0; i < 256; i++)
@@ -5058,7 +5059,8 @@
   cat >conftest.$ac_ext <<_ACEOF
 /* By Ruediger Kuhlmann. */
       #include <sys/types.h>
-      #if HAVE_UNISTD_H
+      #include <stdlib.h>
+      #if 1
       # include <unistd.h>
       #endif
       /* Some systems only have a dummy stub for fork() */
--- src/rand.c.orig	2005-05-09 21:30:49.000000000 -0500
+++ src/rand.c	2024-08-12 03:38:20.000000000 -0500
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <sys/time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
--- src/sudosh.c.orig	2005-05-12 21:37:44.000000000 -0500
+++ src/sudosh.c	2024-08-12 03:40:55.000000000 -0500
@@ -24,6 +24,8 @@
 #include <unistd.h>
 #include <signal.h>
 #include <pwd.h>
+#include <string.h>
+#include <sys/ioctl.h>
 
 #include "config.h"
 
@@ -140,6 +142,7 @@
 void mysyslog(int, const char *, ...);
 void mklogdir(void);
 char *rand2str(size_t len);
+int do_write(int fd, void *buf, size_t size, char *file, unsigned int line);
 
 int main(int argc, char *argv[], char *environ[])
 {