diff --git a/lang/cem/libcc.ansi/misc/getgrent.c b/lang/cem/libcc.ansi/_dead/getgrent.c
similarity index 100%
rename from lang/cem/libcc.ansi/misc/getgrent.c
rename to lang/cem/libcc.ansi/_dead/getgrent.c
diff --git a/lang/cem/libcc.ansi/build.lua b/lang/cem/libcc.ansi/build.lua
index f6bdc8f45..ee1049d66 100644
--- a/lang/cem/libcc.ansi/build.lua
+++ b/lang/cem/libcc.ansi/build.lua
@@ -33,31 +33,31 @@ for _, plat in ipairs(vars.plats) do
 		srcs = {
 			"+ctype_files",
 			"+ctype_tab",
+			"./core/ctype/*.c",
 			"./core/errno/*.c",
-			"./core/string/*.c",
-			"./core/stdlib/*.c",
 			"./core/locale/*.c",
-			"./core/setjmp/*.c",
-			"./core/setjmp/*.e",
 			"./core/math/*.c",
 			"./core/math/*.e",
-			"./core/ctype/*.c",
 			"./core/misc/*.c",
+			"./core/setjmp/*.c",
+			"./core/setjmp/*.e",
+			"./core/stdlib/*.c",
+			"./core/string/*.c",
 			"./core/time/*.c",
-			"./sys/malloc/*.c",
 			"./sys/exit/*.c",
-			"./sys/stdio/*.c",
+			"./sys/malloc/*.c",
 			"./sys/misc/*.c",
+			"./sys/stdio/*.c",
 		},
 		hdrs = {}, -- must be empty
 		deps = {
 			"lang/cem/libcc.ansi/headers+pkg",
 			"plat/"..plat.."/include+pkg",
-			"./sys/malloc/malloc.h",
 			"./core/math/localmath.h",
 			"./core/stdlib/ext_fmt.h",
+			"./core/time/loc_time.h",
+			"./sys/malloc/malloc.h",
 			"./sys/stdio/loc_incl.h",
-			"./time/loc_time.h",
 		},
 		vars = { plat = plat }
 	}
diff --git a/lang/cem/libcc.ansi/headers/unistd.h b/lang/cem/libcc.ansi/headers/unistd.h
index 9ae315648..bab5ada71 100644
--- a/lang/cem/libcc.ansi/headers/unistd.h
+++ b/lang/cem/libcc.ansi/headers/unistd.h
@@ -79,6 +79,7 @@ extern char** environ;
 
 /* Implemented system calls */
 
+extern int access(const char* pathname, int mode);
 extern int brk(void* ptr);
 extern int close(int d);
 extern int creat(const char* path, mode_t mode);
diff --git a/lang/cem/libcc.ansi/misc/LIST b/lang/cem/libcc.ansi/misc/LIST
deleted file mode 100644
index bcf708244..000000000
--- a/lang/cem/libcc.ansi/misc/LIST
+++ /dev/null
@@ -1,22 +0,0 @@
-getgrent.c
-getopt.c
-getpass.c
-getpw.c
-getw.c
-putw.c
-putenv.c
-environ.c
-popen.c
-sleep.c
-termcap.c
-fdopen.c
-closedir.c
-getdents.c
-opendir.c
-readdir.c
-rewinddir.c
-seekdir.c
-telldir.c
-isatty.c
-mktemp.c
-hypot.c
diff --git a/lang/cem/libcc.ansi/misc/Makefile b/lang/cem/libcc.ansi/misc/Makefile
deleted file mode 100644
index b191a6ed6..000000000
--- a/lang/cem/libcc.ansi/misc/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-clean:
-	rm -f getgrent.o getopt.o getpass.o getpw.o getw.o putw.o putenv.o \
-		environ.o popen.o sleep.o termcap.o fdopen.o closedir.o \
-		getdents.o opendir.o readdir.o rewinddir.o seekdir.o \
-		telldir.o isatty.o OLIST
diff --git a/lang/cem/libcc.ansi/misc/mktemp.c b/lang/cem/libcc.ansi/sys/misc/mktemp.c
similarity index 91%
rename from lang/cem/libcc.ansi/misc/mktemp.c
rename to lang/cem/libcc.ansi/sys/misc/mktemp.c
index a5b789050..41b72e5ef 100644
--- a/lang/cem/libcc.ansi/misc/mktemp.c
+++ b/lang/cem/libcc.ansi/sys/misc/mktemp.c
@@ -2,8 +2,8 @@
 /* mktemp - make a name for a temporary file; only here for backwards compat */
 /* no _-protected system-calls? */
 
-unsigned int getpid(void);
-int access(char*, int);
+#include <stdlib.h>
+#include <unistd.h>
 
 char* mktemp(char* template)
 {