From 5745fc2cfdc3a30ea13797dfc1d561768a8a484c Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Fri, 5 Jan 2018 03:56:57 +0100
Subject: [PATCH 2/2] Use POSIX header names in userland.

---
 bin/pax/tables.c                          |  2 +-
 games/sail/sync.c                         |  2 +-
 include/pthread.h                         |  2 +-
 include/rpcsvc/bootparam_prot.x           |  3 +--
 lib/libc/gen/assert.c                     |  3 +--
 lib/libc/gen/getnetgrent.c                |  3 +--
 lib/libc/gen/posixshm.c                   |  2 +-
 lib/libc/gen/syslog.c                     |  3 +--
 lib/libc/gen/termios.c                    |  2 +-
 lib/libc/gen/ucontext.c                   |  2 +-
 lib/libc/rpc/auth_time.c                  |  2 +-
 lib/libc/rpc/clnt_bcast.c                 |  2 +-
 lib/libc/rpc/clnt_generic.c               |  2 +-
 lib/libc/rpc/clnt_vc.c                    |  4 ++--
 lib/libc/rpc/key_call.c                   |  2 +-
 lib/libc/rpc/pmap_rmt.c                   |  3 +--
 lib/libc/rpc/svc.c                        |  3 +--
 lib/libc/rpc/svc_vc.c                     |  2 +-
 lib/libc/sys/sched_getcpu.2               |  2 +-
 lib/libc/sys/sched_setaffinity.2          |  2 +-
 lib/libc/upmap/upmap.c                    |  2 +-
 lib/libc/x86_64/gen/makecontext.c         |  2 +-
 lib/libc/x86_64/gen/quickcontext.c        |  2 +-
 lib/libc/x86_64/sys/asmcontext.c          |  2 +-
 lib/libc_r/test/mutex_d.c                 |  4 ++--
 lib/libc_r/test/sem_d.c                   |  4 +---
 lib/libc_r/uthread/pthread_private.h      |  8 ++++----
 lib/libc_r/uthread/uthread_cancel.c       |  4 ++--
 lib/libc_r/uthread/uthread_ioctl.c        |  4 ++--
 lib/libc_r/uthread/uthread_poll.c         |  4 ++--
 lib/libc_r/uthread/uthread_read.c         |  5 ++---
 lib/libc_r/uthread/uthread_readv.c        |  5 ++---
 lib/libc_r/uthread/uthread_select.c       |  4 ++--
 lib/libc_r/uthread/uthread_sem.c          |  3 +--
 lib/libc_r/uthread/uthread_sendfile.c     |  3 +--
 lib/libc_r/uthread/uthread_spinlock.c     |  4 ++--
 lib/libc_r/uthread/uthread_write.c        |  5 ++---
 lib/libc_r/uthread/uthread_writev.c       |  5 ++---
 lib/libcam/scsi_cmdparse.c                |  4 ++--
 lib/libdevattr/devattr.c                  |  2 +-
 lib/libdevattr/devattr_device.c           |  2 +-
 lib/libdevattr/devattr_enumerate.c        |  2 +-
 lib/libdevattr/devattr_monitor.c          |  2 +-
 lib/libdevstat/devstat.c                  |  3 +--
 lib/libdmsg/dmsg_local.h                  |  2 +-
 lib/libfetch/fetch.c                      |  2 +-
 lib/libkcore/kcore.c                      |  4 +---
 lib/libposix1e/acl_delete.c               |  5 ++---
 lib/libposix1e/acl_free.c                 |  5 ++---
 lib/libposix1e/acl_from_text.c            |  5 ++---
 lib/libposix1e/acl_get.c                  |  5 ++---
 lib/libposix1e/acl_to_text.c              |  2 +-
 lib/libposix1e/acl_valid.c                |  5 ++---
 lib/libpuffs/dispatcher.c                 |  2 +-
 lib/librt/aio.c                           |  2 +-
 lib/libstand/hammer1.c                    |  2 +-
 lib/libthread_xu/thread/thr_private.h     |  8 ++++----
 lib/libthread_xu/thread/thr_sem.c         |  2 +-
 lib/libusb/libusb10.c                     |  2 +-
 lib/libusb/libusb10_hotplug.c             |  2 +-
 lib/libusb/libusb_global_linux.h          |  2 +-
 lib/libutil/flopen.3                      |  2 +-
 lib/libutil/gr_util.c                     |  2 +-
 lib/libutil/pw_util.c                     |  2 +-
 libexec/atrun/atrun.c                     |  2 +-
 libexec/bootpd/readfile.c                 |  2 +-
 libexec/pppoed/pppoed.c                   |  3 +--
 libexec/rtld-elf/libmap.c                 |  2 +-
 libexec/ypxfr/ypxfrd_getmap.c             |  3 +--
 sbin/diskinfo/diskinfo.c                  |  4 +---
 sbin/dmesg/dmesg.c                        |  2 +-
 sbin/ifconfig/regdomain.c                 |  2 +-
 sbin/mount_nfs/mount_nfs.c                |  2 +-
 sbin/mountd/mountd.c                      |  4 ++--
 sbin/nfsd/nfsd.c                          |  2 +-
 sbin/nfsiod/nfsiod.c                      |  3 +--
 sbin/shutdown/shutdown.c                  |  2 +-
 sbin/udevd/test_udevd.c                   |  2 +-
 sbin/udevd/udevd.c                        |  2 +-
 sbin/udevd/udevd_client.c                 |  2 +-
 sbin/udevd/udevd_monitor.c                |  2 +-
 sbin/udevd/udevd_pdev.c                   |  2 +-
 share/examples/meteor/rgb16.c             |  3 ++-
 share/examples/meteor/rgb24.c             |  2 +-
 share/examples/meteor/test-n.c            |  2 +-
 share/examples/meteor/yuvpk.c             |  2 +-
 share/examples/meteor/yuvpl.c             |  2 +-
 share/man/man4/pf.4                       |  2 +-
 test/interbench/hackbench.c               |  2 +-
 test/stress/fsstress/global.h             |  5 +----
 test/stress/stress2/misc/ldt.sh           |  2 +-
 test/stress/stress2/tools/fstool.c        |  2 +-
 test/sysperf/randread.c                   |  2 +-
 test/sysperf/read1.c                      |  4 +---
 test/sysperf/syscall2.c                   |  2 +-
 test/sysperf/umtx1.c                      |  2 +-
 tools/regression/nfsmmap/test1/test1.c    |  6 +-----
 tools/regression/nfsmmap/test2/test2.c    |  6 +-----
 tools/regression/p1003_1b/fifo.c          |  4 ++--
 tools/regression/p1003_1b/prutil.c        |  2 +-
 tools/regression/p1003_1b/sched.c         |  2 +-
 tools/regression/p1003_1b/yield.c         |  5 ++---
 usr.bin/brandelf/brandelf.c               |  2 +-
 usr.bin/chkey/chkey.c                     |  4 ++--
 usr.bin/crunch/crunchide/crunchide.c      |  2 +-
 usr.bin/kdump/kdump.c                     |  2 +-
 usr.bin/kdump/mksubr                      | 10 +++++-----
 usr.bin/ktrace/ktrace.c                   |  3 +--
 usr.bin/perror/perror.c                   |  2 +-
 usr.bin/pkill/pkill.c                     |  2 +-
 usr.bin/top/m_dragonfly.c                 |  2 +-
 usr.bin/vmstat/vmstat.c                   |  2 +-
 usr.sbin/802_11/ndis_events/ndis_events.c |  2 +-
 usr.sbin/802_11/wpa_supplicant/Packet32.c |  4 ++--
 usr.sbin/bthcid/parser.y                  |  3 +--
 usr.sbin/burncd/burncd.c                  |  3 +--
 usr.sbin/clog/clog.c                      |  3 +--
 usr.sbin/dconschat/dconschat.c            |  4 +---
 usr.sbin/fwcontrol/fwcontrol.c            |  2 +-
 usr.sbin/installer/libdfui/conn_npipe.c   |  2 +-
 usr.sbin/installer/libdfui/conn_tcp.c     |  2 +-
 usr.sbin/iostat/iostat.c                  |  3 +--
 usr.sbin/keyserv/setkey.c                 |  3 +--
 usr.sbin/mfiutil/mfi_cmd.c                |  2 +-
 usr.sbin/mfiutil/mfi_drive.c              |  2 +-
 usr.sbin/mfiutil/mfi_evt.c                |  2 +-
 usr.sbin/mfiutil/mfi_flash.c              |  2 +-
 usr.sbin/mfiutil/mfi_patrol.c             |  2 +-
 usr.sbin/mfiutil/mfi_show.c               |  2 +-
 usr.sbin/mfiutil/mfi_volume.c             |  2 +-
 usr.sbin/mfiutil/mfiutil.c                |  2 +-
 usr.sbin/mptutil/mpt_cmd.c                |  2 +-
 usr.sbin/mptutil/mpt_config.c             |  2 +-
 usr.sbin/mptutil/mpt_drive.c              |  2 +-
 usr.sbin/mptutil/mpt_evt.c                |  2 +-
 usr.sbin/mptutil/mpt_show.c               |  2 +-
 usr.sbin/mptutil/mpt_volume.c             |  2 +-
 usr.sbin/mptutil/mptutil.c                |  2 +-
 usr.sbin/pciconf/pciconf.c                |  2 +-
 usr.sbin/ppp/ether.c                      |  3 +--
 usr.sbin/ppp/netgraph.c                   |  3 +--
 usr.sbin/ppp/prompt.c                     |  3 +--
 usr.sbin/rpc.umntall/mounttab.c           |  4 +---
 usr.sbin/rpc.yppasswdd/yppasswdd_server.c |  2 +-
 usr.sbin/rpc.ypupdated/yp_dbupdate.c      |  4 +---
 usr.sbin/rpc.ypxfrd/ypxfrd_server.c       |  3 +--
 usr.sbin/rpcbind/rpcb_svc_com.c           |  2 +-
 usr.sbin/rpcbind/rpcbind.c                |  2 +-
 usr.sbin/rpcbind/util.c                   |  2 +-
 usr.sbin/rtprio/rtprio.c                  |  3 +--
 usr.sbin/syslogd/syslogd.c                |  2 +-
 usr.sbin/tzsetup/tzsetup.c                |  2 +-
 usr.sbin/vidcontrol/vidcontrol.c          |  2 +-
 usr.sbin/watch/watch.c                    |  3 +--
 usr.sbin/ypbind/yp_ping.c                 |  2 +-
 usr.sbin/ypbind/ypbind.c                  |  3 +--
 usr.sbin/yppush/yppush_main.c             |  2 +-
 usr.sbin/ypserv/yp_access.c               |  3 +--
 usr.sbin/ypserv/yp_dnslookup.c            |  2 +-
 159 files changed, 192 insertions(+), 252 deletions(-)

diff --git a/bin/pax/tables.c b/bin/pax/tables.c
index fbff1e1bd5..2df3258549 100644
--- a/bin/pax/tables.c
+++ b/bin/pax/tables.c
@@ -37,8 +37,8 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/stat.h>
-#include <sys/fcntl.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/games/sail/sync.c b/games/sail/sync.c
index 468da58407..676963bbc7 100644
--- a/games/sail/sync.c
+++ b/games/sail/sync.c
@@ -31,9 +31,9 @@
  */
 
 #include <sys/file.h>
-#include <sys/errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <errno.h>
 #include "externs.h"
 
 #define BUFSIZE 4096
diff --git a/include/pthread.h b/include/pthread.h
index 12fb145979..91f4936aba 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -43,7 +43,7 @@
 #include <sys/time.h>
 #include <sys/signal.h>
 #include <machine/limits.h>
-#include <sys/sched.h>
+#include <sched.h>
 
 /*
  * Run-time invariant values:
diff --git a/include/rpcsvc/bootparam_prot.x b/include/rpcsvc/bootparam_prot.x
index dc28fa8aca..6a6b83f9e1 100644
--- a/include/rpcsvc/bootparam_prot.x
+++ b/include/rpcsvc/bootparam_prot.x
@@ -29,7 +29,6 @@
  * @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro
  * @(#)bootparam_prot.x	2.1 88/08/01 4.0 RPCSRC
  * $FreeBSD: src/include/rpcsvc/bootparam_prot.x,v 1.7 2003/05/04 02:51:42 obrien Exp $
- * $DragonFly: src/include/rpcsvc/bootparam_prot.x,v 1.2 2003/06/17 04:25:58 dillon Exp $
  */
 
 /*
@@ -45,9 +44,9 @@
 #ifdef RPC_HDR
 %#include <rpc/types.h>
 %#include <sys/time.h>
-%#include <sys/errno.h>
 %#include <sys/param.h>
 %#include <sys/syslimits.h>
+%#include <errno.h>
 #endif
 
 const MAX_MACHINE_NAME  = 255;
diff --git a/lib/libc/gen/assert.c b/lib/libc/gen/assert.c
index 2910b9c9a7..480a080d2e 100644
--- a/lib/libc/gen/assert.c
+++ b/lib/libc/gen/assert.c
@@ -28,13 +28,12 @@
  *
  * @(#)assert.c	8.1 (Berkeley) 6/4/93
  * $FreeBSD: src/lib/libc/gen/assert.c,v 1.8 2007/01/09 00:27:53 imp Exp $
- * $DragonFly: src/lib/libc/gen/assert.c,v 1.5 2005/04/26 10:41:57 joerg Exp $
  */
 
-#include <sys/syslog.h>
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <syslog.h>
 
 void
 __assert(const char *func, const char *file, int line, const char *failedexpr)
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c
index 076882e603..afbadaf31a 100644
--- a/lib/libc/gen/getnetgrent.c
+++ b/lib/libc/gen/getnetgrent.c
@@ -31,10 +31,10 @@
  *
  * @(#)getnetgrent.c	8.2 (Berkeley) 4/27/95
  * $FreeBSD: src/lib/libc/gen/getnetgrent.c,v 1.35 2007/01/09 00:27:54 imp Exp $
- * $DragonFly: src/lib/libc/gen/getnetgrent.c,v 1.5 2005/04/25 19:03:46 joerg Exp $
  */
 
 #include <ctype.h>
+#include <errno.h>
 #include <netdb.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -87,7 +87,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/param.h>
-#include <sys/errno.h>
 static char *_netgr_yp_domain;
 int _use_only_yp;
 static int _netgr_yp_enabled;
diff --git a/lib/libc/gen/posixshm.c b/lib/libc/gen/posixshm.c
index 52ec30bb88..654571d919 100644
--- a/lib/libc/gen/posixshm.c
+++ b/lib/libc/gen/posixshm.c
@@ -31,11 +31,11 @@
 
 #include "namespace.h"
 #include <sys/types.h>
-#include <sys/fcntl.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 
 #include <errno.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include "un-namespace.h"
 
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index 87f8f77f76..a32a2e1a2a 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -28,13 +28,11 @@
  *
  * @(#)syslog.c	8.5 (Berkeley) 4/29/95
  * $FreeBSD: src/lib/libc/gen/syslog.c,v 1.39 2007/01/09 00:27:55 imp Exp $
- * $DragonFly: src/lib/libc/gen/syslog.c,v 1.9 2005/11/19 22:32:53 swildner Exp $
  */
 
 #include "namespace.h"
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <sys/syslog.h>
 #include <sys/uio.h>
 #include <sys/un.h>
 #include <netdb.h>
@@ -46,6 +44,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 #include <time.h>
 #include <unistd.h>
 
diff --git a/lib/libc/gen/termios.c b/lib/libc/gen/termios.c
index 24fa4b57a7..4f972c4e74 100644
--- a/lib/libc/gen/termios.c
+++ b/lib/libc/gen/termios.c
@@ -33,11 +33,11 @@
 
 #include "namespace.h"
 #include <sys/types.h>
-#include <sys/fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/time.h>
 
 #include <errno.h>
+#include <fcntl.h>
 #include <string.h>
 #define	TTYDEFCHARS
 #include <termios.h>
diff --git a/lib/libc/gen/ucontext.c b/lib/libc/gen/ucontext.c
index 71bd5c1582..0ce17f4c04 100644
--- a/lib/libc/gen/ucontext.c
+++ b/lib/libc/gen/ucontext.c
@@ -27,11 +27,11 @@
 #include "namespace.h"
 #include <sys/param.h>
 #include <sys/signal.h>
-#include <sys/ucontext.h>
 
 #include <errno.h>
 #include <stdarg.h>
 #include <stdlib.h>
+#include <ucontext.h>
 #include <unistd.h>
 #include <signal.h>
 #include "un-namespace.h"
diff --git a/lib/libc/rpc/auth_time.c b/lib/libc/rpc/auth_time.c
index f9b4c1c537..ec9439937d 100644
--- a/lib/libc/rpc/auth_time.c
+++ b/lib/libc/rpc/auth_time.c
@@ -29,6 +29,7 @@
  */
 
 #include "namespace.h"
+#include <errno.h>
 #include <stdio.h>
 #include <syslog.h>
 #include <string.h>
@@ -36,7 +37,6 @@
 #include <unistd.h>
 #include <netdb.h>
 #include <sys/signal.h>
-#include <sys/errno.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
diff --git a/lib/libc/rpc/clnt_bcast.c b/lib/libc/rpc/clnt_bcast.c
index 9339b87d73..43fd5a03d8 100644
--- a/lib/libc/rpc/clnt_bcast.c
+++ b/lib/libc/rpc/clnt_bcast.c
@@ -50,7 +50,6 @@
 #include <net/if.h>
 #include <netinet/in.h>
 #include <ifaddrs.h>
-#include <sys/poll.h>
 #include <rpc/rpc.h>
 #ifdef PORTMAP
 #include <rpc/pmap_prot.h>
@@ -63,6 +62,7 @@
 #include <stdio.h>
 #endif
 #include <errno.h>
+#include <poll.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <netdb.h>
diff --git a/lib/libc/rpc/clnt_generic.c b/lib/libc/rpc/clnt_generic.c
index cb208fd0df..8fb45e999c 100644
--- a/lib/libc/rpc/clnt_generic.c
+++ b/lib/libc/rpc/clnt_generic.c
@@ -57,10 +57,10 @@
 #include "namespace.h"
 #include "reentrant.h"
 #include <sys/types.h>
-#include <sys/fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <errno.h>
 #include <netdb.h>
diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c
index 2b690c9136..c4ec7ff0a9 100644
--- a/lib/libc/rpc/clnt_vc.c
+++ b/lib/libc/rpc/clnt_vc.c
@@ -53,8 +53,6 @@
 #include "namespace.h"
 #include "reentrant.h"
 #include <sys/types.h>
-#include <sys/poll.h>
-#include <sys/syslog.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/uio.h>
@@ -64,9 +62,11 @@
 #include <err.h>
 #include <errno.h>
 #include <netdb.h>
+#include <poll.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 #include <unistd.h>
 #include <signal.h>
 
diff --git a/lib/libc/rpc/key_call.c b/lib/libc/rpc/key_call.c
index ed94a0f917..2e73dff855 100644
--- a/lib/libc/rpc/key_call.c
+++ b/lib/libc/rpc/key_call.c
@@ -43,6 +43,7 @@
 
 #include "namespace.h"
 #include "reentrant.h"
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -56,7 +57,6 @@
 #include <sys/utsname.h>
 #include <signal.h>
 #include <sys/wait.h>
-#include <sys/fcntl.h>
 #include "un-namespace.h"
 #include "mt_misc.h"
 
diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c
index 80e92a2f73..c76e9fab72 100644
--- a/lib/libc/rpc/pmap_rmt.c
+++ b/lib/libc/rpc/pmap_rmt.c
@@ -29,7 +29,6 @@
  * @(#)pmap_rmt.c	2.2 88/08/01 4.0 RPCSRC
  * $NetBSD: pmap_rmt.c,v 1.29 2000/07/06 03:10:34 christos Exp $
  * $FreeBSD: src/lib/libc/rpc/pmap_rmt.c,v 1.20 2004/10/16 06:11:35 obrien Exp $
- * $DragonFly: src/lib/libc/rpc/pmap_rmt.c,v 1.5 2005/11/13 12:27:04 swildner Exp $
  */
 
 /*
@@ -43,7 +42,6 @@
 #include "namespace.h"
 #include <sys/types.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/socket.h>
 
 #include <net/if.h>
@@ -53,6 +51,7 @@
 #include <assert.h>
 #include <err.h>
 #include <errno.h>
+#include <poll.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c
index 7a4253d6aa..72355e5d79 100644
--- a/lib/libc/rpc/svc.c
+++ b/lib/libc/rpc/svc.c
@@ -29,7 +29,6 @@
  * @(#)svc.c	2.4 88/08/11 4.0 RPCSRC
  * $NetBSD: svc.c,v 1.21 2000/07/06 03:10:35 christos Exp $
  * $FreeBSD: src/lib/libc/rpc/svc.c,v 1.24 2006/02/27 22:10:59 deischen Exp $
- * $DragonFly: src/lib/libc/rpc/svc.c,v 1.4 2005/11/13 12:27:04 swildner Exp $
  */
 
 /*
@@ -45,9 +44,9 @@
 #include "namespace.h"
 #include "reentrant.h"
 #include <sys/types.h>
-#include <sys/poll.h>
 #include <assert.h>
 #include <errno.h>
+#include <poll.h>
 #include <stdlib.h>
 #include <string.h>
 
diff --git a/lib/libc/rpc/svc_vc.c b/lib/libc/rpc/svc_vc.c
index 584c910a74..b286716066 100644
--- a/lib/libc/rpc/svc_vc.c
+++ b/lib/libc/rpc/svc_vc.c
@@ -43,7 +43,6 @@
 #include "reentrant.h"
 #include <sys/types.h>
 #include <sys/param.h>
-#include <sys/poll.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/time.h>
@@ -55,6 +54,7 @@
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <poll.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/libc/sys/sched_getcpu.2 b/lib/libc/sys/sched_getcpu.2
index 6ef576a73c..93f051c97e 100644
--- a/lib/libc/sys/sched_getcpu.2
+++ b/lib/libc/sys/sched_getcpu.2
@@ -40,7 +40,7 @@
 .Lb libc
 .Sh SYNOPSIS
 .In sys/types.h
-.In sys/sched.h
+.In sched.h
 .Ft int
 .Fn sched_getcpu "void"
 .Sh DESCRIPTION
diff --git a/lib/libc/sys/sched_setaffinity.2 b/lib/libc/sys/sched_setaffinity.2
index 9144103cd2..9bebeac27b 100644
--- a/lib/libc/sys/sched_setaffinity.2
+++ b/lib/libc/sys/sched_setaffinity.2
@@ -50,7 +50,7 @@
 .Lb libc
 .Sh SYNOPSIS
 .In sys/types.h
-.In sys/sched.h
+.In sched.h
 .Ft int
 .Fn sched_setaffinity "pid_t pid" "size_t cpusetsize" "const cpu_set_t *mask"
 .Ft int
diff --git a/lib/libc/upmap/upmap.c b/lib/libc/upmap/upmap.c
index 7bc9762210..8f9596edc1 100644
--- a/lib/libc/upmap/upmap.c
+++ b/lib/libc/upmap/upmap.c
@@ -39,8 +39,8 @@
 #include <sys/upmap.h>
 #include <sys/time.h>
 #include <sys/mman.h>
-#include <sys/fcntl.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <time.h>
diff --git a/lib/libc/x86_64/gen/makecontext.c b/lib/libc/x86_64/gen/makecontext.c
index b2a3ced209..b2d3a66796 100644
--- a/lib/libc/x86_64/gen/makecontext.c
+++ b/lib/libc/x86_64/gen/makecontext.c
@@ -28,7 +28,6 @@
 #include <sys/cdefs.h>
 #include <sys/param.h>
 #include <sys/signal.h>
-#include <sys/ucontext.h>
 
 #include <machine/frame.h>
 #include <machine/tss.h>
@@ -39,6 +38,7 @@
 #include <string.h>
 #include <stdarg.h>
 #include <stdlib.h>
+#include <ucontext.h>
 #include <unistd.h>
 
 typedef void (*func_t)(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t);
diff --git a/lib/libc/x86_64/gen/quickcontext.c b/lib/libc/x86_64/gen/quickcontext.c
index 776295b664..2c25ed25b5 100644
--- a/lib/libc/x86_64/gen/quickcontext.c
+++ b/lib/libc/x86_64/gen/quickcontext.c
@@ -24,7 +24,6 @@
 #include <sys/cdefs.h>
 #include <sys/param.h>
 #include <sys/signal.h>
-#include <sys/ucontext.h>
 
 #include <machine/frame.h>
 #include <machine/tss.h>
@@ -35,6 +34,7 @@
 #include <string.h>
 #include <stdarg.h>
 #include <stdlib.h>
+#include <ucontext.h>
 #include <unistd.h>
 
 /* Prototypes */
diff --git a/lib/libc/x86_64/sys/asmcontext.c b/lib/libc/x86_64/sys/asmcontext.c
index 660c49a329..046b2d2cb9 100644
--- a/lib/libc/x86_64/sys/asmcontext.c
+++ b/lib/libc/x86_64/sys/asmcontext.c
@@ -1,11 +1,11 @@
 #define _KERNEL_STRUCTURES
 #include <sys/types.h>
-#include <sys/ucontext.h>
 #include <sys/assym.h>
 #include <machine/frame.h>
 #include <machine/tss.h>
 #include <machine/segments.h>
 #include <stddef.h>
+#include <ucontext.h>
 
 ASSYM(UC_SIGMASK, offsetof(ucontext_t, uc_sigmask));
 ASSYM(UC_LINK, offsetof(ucontext_t, uc_link));
diff --git a/lib/libc_r/test/mutex_d.c b/lib/libc_r/test/mutex_d.c
index 466f453e57..238ae79bdb 100644
--- a/lib/libc_r/test/mutex_d.c
+++ b/lib/libc_r/test/mutex_d.c
@@ -30,8 +30,8 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/test/mutex_d.c,v 1.1.2.2 2003/01/05 19:59:39 semenu Exp $
- * $DragonFly: src/lib/libc_r/test/mutex_d.c,v 1.3 2007/06/26 23:30:05 josepht Exp $
  */
+
 #include <stdlib.h>
 #include <unistd.h>
 
@@ -39,7 +39,7 @@
 #include <assert.h>
 #include <errno.h>
 #include "pthread.h"
-#include <sys/sched.h>
+#include <sched.h>
 #include <signal.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/lib/libc_r/test/sem_d.c b/lib/libc_r/test/sem_d.c
index 5ae8919a7b..455d6ab7f6 100644
--- a/lib/libc_r/test/sem_d.c
+++ b/lib/libc_r/test/sem_d.c
@@ -32,17 +32,15 @@
  * sem test.
  *
  * $FreeBSD: src/lib/libc_r/test/sem_d.c,v 1.1.2.2 2001/06/22 21:44:27 jasone Exp $
- * $DragonFly: src/lib/libc_r/test/sem_d.c,v 1.3 2007/06/26 23:30:05 josepht Exp $
  *
  ****************************************************************************/
 
-#include <sys/semaphore.h>
-
 #include <assert.h>
 #include <stdio.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <pthread.h>
+#include <semaphore.h>
 
 #define NTHREADS 10
 
diff --git a/lib/libc_r/uthread/pthread_private.h b/lib/libc_r/uthread/pthread_private.h
index def75d5fe7..52643fa252 100644
--- a/lib/libc_r/uthread/pthread_private.h
+++ b/lib/libc_r/uthread/pthread_private.h
@@ -56,7 +56,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/cdefs.h>
-#include <sys/sched.h>
+#include <sched.h>
 #include <spinlock.h>
 #include <pthread_np.h>
 
@@ -1230,7 +1230,7 @@ void	_thread_enter_cancellation_point(void);
 void	_thread_leave_cancellation_point(void);
 void	_thread_cancellation_point(void);
 
-/* #include <aio.h> */
+/* #include <sys/aio.h> */
 #ifdef _SYS_AIO_H_
 int	__sys_aio_suspend(const struct aiocb * const[], int, const struct timespec *);
 #endif
@@ -1306,7 +1306,7 @@ pid_t	__sys_wait4(pid_t, int *, int, struct rusage *);
 int	__sys_getdirentries(int, char *, int, long *);
 #endif
 
-/* #include <fcntl.h> */
+/* #include <sys/fcntl.h> */
 #ifdef _SYS_FCNTL_H_
 int	__sys_fcntl(int, int, ...);
 int	__sys_flock(int, int);
@@ -1315,7 +1315,7 @@ int	__sys_openat(int, const char *, int, ...);
 #endif
 
 /* #include <poll.h> */
-#ifdef _SYS_POLL_H_
+#ifdef _POLL_H_
 int	__sys_poll(struct pollfd *, unsigned, int);
 #endif
 
diff --git a/lib/libc_r/uthread/uthread_cancel.c b/lib/libc_r/uthread/uthread_cancel.c
index ec663a2dab..66a00aa960 100644
--- a/lib/libc_r/uthread/uthread_cancel.c
+++ b/lib/libc_r/uthread/uthread_cancel.c
@@ -1,9 +1,9 @@
 /*
  * David Leonard <d@openbsd.org>, 1999. Public domain.
  * $FreeBSD: src/lib/libc_r/uthread/uthread_cancel.c,v 1.3.2.9 2002/10/22 14:44:02 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_cancel.c,v 1.4 2005/05/30 20:50:53 joerg Exp $
  */
-#include <sys/errno.h>
+
+#include <errno.h>
 #include <pthread.h>
 #include "pthread_private.h"
 
diff --git a/lib/libc_r/uthread/uthread_ioctl.c b/lib/libc_r/uthread/uthread_ioctl.c
index ffc32004e4..e709d0f58e 100644
--- a/lib/libc_r/uthread/uthread_ioctl.c
+++ b/lib/libc_r/uthread/uthread_ioctl.c
@@ -30,11 +30,11 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_ioctl.c,v 1.9.2.3 2002/10/22 14:44:03 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_ioctl.c,v 1.2 2003/06/17 04:26:48 dillon Exp $
  */
+
 #include <stdarg.h>
 #include <sys/ioctl.h>
-#include <sys/fcntl.h>	/* O_NONBLOCK*/
+#include <fcntl.h>	/* O_NONBLOCK*/
 #include <pthread.h>
 #include "pthread_private.h"
 
diff --git a/lib/libc_r/uthread/uthread_poll.c b/lib/libc_r/uthread/uthread_poll.c
index b39fb19f60..d2b1274a9d 100644
--- a/lib/libc_r/uthread/uthread_poll.c
+++ b/lib/libc_r/uthread/uthread_poll.c
@@ -30,15 +30,15 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_poll.c,v 1.9.2.4 2002/10/22 14:44:03 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_poll.c,v 1.2 2003/06/17 04:26:48 dillon Exp $
  */
+
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
 #include <poll.h>
 #include <sys/types.h>
 #include <sys/time.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <pthread.h>
 #include "pthread_private.h"
 
diff --git a/lib/libc_r/uthread/uthread_read.c b/lib/libc_r/uthread/uthread_read.c
index 3786ebc47f..24894db411 100644
--- a/lib/libc_r/uthread/uthread_read.c
+++ b/lib/libc_r/uthread/uthread_read.c
@@ -30,13 +30,12 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_read.c,v 1.11.2.4 2002/10/22 14:44:03 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_read.c,v 1.4 2007/01/08 21:41:53 dillon Exp $
- *
  */
+
 #include <sys/types.h>
-#include <sys/fcntl.h>
 #include <sys/uio.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include <pthread.h>
 #include "pthread_private.h"
diff --git a/lib/libc_r/uthread/uthread_readv.c b/lib/libc_r/uthread/uthread_readv.c
index 704b4d914f..c5741c4321 100644
--- a/lib/libc_r/uthread/uthread_readv.c
+++ b/lib/libc_r/uthread/uthread_readv.c
@@ -30,13 +30,12 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_readv.c,v 1.11.2.5 2002/10/22 14:44:03 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_readv.c,v 1.4 2007/01/08 21:41:53 dillon Exp $
- *
  */
+
 #include <sys/types.h>
-#include <sys/fcntl.h>
 #include <sys/uio.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include <pthread.h>
 #include "pthread_private.h"
diff --git a/lib/libc_r/uthread/uthread_select.c b/lib/libc_r/uthread/uthread_select.c
index 29286a9dbc..b7516379be 100644
--- a/lib/libc_r/uthread/uthread_select.c
+++ b/lib/libc_r/uthread/uthread_select.c
@@ -30,8 +30,8 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_select.c,v 1.16.2.5 2002/10/22 14:44:03 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_select.c,v 1.3 2008/01/10 22:30:27 nth Exp $
  */
+
 #include <unistd.h>
 #include <errno.h>
 #include <poll.h>
@@ -40,7 +40,7 @@
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/time.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <pthread.h>
 #include "pthread_private.h"
 
diff --git a/lib/libc_r/uthread/uthread_sem.c b/lib/libc_r/uthread/uthread_sem.c
index 76ed4fcd7c..8eb949c9df 100644
--- a/lib/libc_r/uthread/uthread_sem.c
+++ b/lib/libc_r/uthread/uthread_sem.c
@@ -29,11 +29,10 @@
  * $FreeBSD: src/lib/libc_r/uthread/uthread_sem.c,v 1.3.2.5 2002/10/22 14:44:03 fjoe Exp $
  */
 
-#include <sys/semaphore.h>
-
 #include <stdlib.h>
 #include <errno.h>
 #include <pthread.h>
+#include <semaphore.h>
 
 #include "pthread_private.h"
 
diff --git a/lib/libc_r/uthread/uthread_sendfile.c b/lib/libc_r/uthread/uthread_sendfile.c
index 3d5d9ab8b6..640488f334 100644
--- a/lib/libc_r/uthread/uthread_sendfile.c
+++ b/lib/libc_r/uthread/uthread_sendfile.c
@@ -27,14 +27,13 @@
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_sendfile.c,v 1.2.2.10 2002/10/22 14:44:03 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_sendfile.c,v 1.2 2003/06/17 04:26:48 dillon Exp $
  */
 
-#include <sys/fcntl.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <pthread.h>
 #include "pthread_private.h"
 
diff --git a/lib/libc_r/uthread/uthread_spinlock.c b/lib/libc_r/uthread/uthread_spinlock.c
index 34b0439fe0..50a36150cc 100644
--- a/lib/libc_r/uthread/uthread_spinlock.c
+++ b/lib/libc_r/uthread/uthread_spinlock.c
@@ -36,10 +36,10 @@ extern unsigned	int	__sleep(unsigned int);
 
 #include "namespace.h"
 #include <stdlib.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/sched.h>
+#include <sched.h>
 #include <pthread.h>
 #include <unistd.h>
 #include "un-namespace.h"
diff --git a/lib/libc_r/uthread/uthread_write.c b/lib/libc_r/uthread/uthread_write.c
index 859fa18475..544d178ebf 100644
--- a/lib/libc_r/uthread/uthread_write.c
+++ b/lib/libc_r/uthread/uthread_write.c
@@ -30,13 +30,12 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_write.c,v 1.16.2.6 2002/11/12 20:46:53 archie Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_write.c,v 1.6 2007/01/08 21:41:53 dillon Exp $
- *
  */
+
 #include <sys/types.h>
-#include <sys/fcntl.h>
 #include <sys/uio.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include <pthread.h>
 #include "pthread_private.h"
diff --git a/lib/libc_r/uthread/uthread_writev.c b/lib/libc_r/uthread/uthread_writev.c
index 712479ccd2..872e9c353c 100644
--- a/lib/libc_r/uthread/uthread_writev.c
+++ b/lib/libc_r/uthread/uthread_writev.c
@@ -30,13 +30,12 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_writev.c,v 1.16.2.6 2002/11/15 18:39:21 archie Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_writev.c,v 1.4 2007/01/08 21:41:53 dillon Exp $
- *
  */
+
 #include <sys/types.h>
-#include <sys/fcntl.h>
 #include <sys/uio.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/lib/libcam/scsi_cmdparse.c b/lib/libcam/scsi_cmdparse.c
index b99da64b4d..ebb83e5c87 100644
--- a/lib/libcam/scsi_cmdparse.c
+++ b/lib/libcam/scsi_cmdparse.c
@@ -33,13 +33,13 @@
  * SUCH DAMAGE.
  * From: scsi.c,v 1.8 1997/02/22 15:07:54 peter Exp $
  * $FreeBSD: src/lib/libcam/scsi_cmdparse.c,v 1.3.2.1 2000/08/14 05:42:30 kbyanc Exp $
- * $DragonFly: src/lib/libcam/scsi_cmdparse.c,v 1.3 2007/11/24 01:53:50 pavalos Exp $
  */
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <stdarg.h>
 #include <fcntl.h>
 
diff --git a/lib/libdevattr/devattr.c b/lib/libdevattr/devattr.c
index 1f46c73fe9..357f0f4987 100644
--- a/lib/libdevattr/devattr.c
+++ b/lib/libdevattr/devattr.c
@@ -36,7 +36,6 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/queue.h>
 #include <sys/un.h>
 #include <cpu/inttypes.h>
@@ -45,6 +44,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <poll.h>
 #include <regex.h>
 #include <signal.h>
 #include <stdarg.h>
diff --git a/lib/libdevattr/devattr_device.c b/lib/libdevattr/devattr_device.c
index afbad124ef..5fe5315e77 100644
--- a/lib/libdevattr/devattr_device.c
+++ b/lib/libdevattr/devattr_device.c
@@ -36,7 +36,6 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/queue.h>
 #include <sys/stat.h>
 #include <sys/un.h>
@@ -46,6 +45,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <poll.h>
 #include <regex.h>
 #include <signal.h>
 #include <stdarg.h>
diff --git a/lib/libdevattr/devattr_enumerate.c b/lib/libdevattr/devattr_enumerate.c
index 63db367607..d09ca29d6c 100644
--- a/lib/libdevattr/devattr_enumerate.c
+++ b/lib/libdevattr/devattr_enumerate.c
@@ -36,7 +36,6 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/queue.h>
 #include <sys/un.h>
 #include <cpu/inttypes.h>
@@ -45,6 +44,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <poll.h>
 #include <regex.h>
 #include <signal.h>
 #include <stdarg.h>
diff --git a/lib/libdevattr/devattr_monitor.c b/lib/libdevattr/devattr_monitor.c
index f21455aa66..9ce39bae66 100644
--- a/lib/libdevattr/devattr_monitor.c
+++ b/lib/libdevattr/devattr_monitor.c
@@ -36,7 +36,6 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/queue.h>
 #include <sys/un.h>
 #include <cpu/inttypes.h>
@@ -45,6 +44,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <poll.h>
 #include <regex.h>
 #include <signal.h>
 #include <stdarg.h>
diff --git a/lib/libdevstat/devstat.c b/lib/libdevstat/devstat.c
index 019a29fba9..a56fea0dc9 100644
--- a/lib/libdevstat/devstat.c
+++ b/lib/libdevstat/devstat.c
@@ -26,15 +26,14 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libdevstat/devstat.c,v 1.6 1999/08/28 00:04:26 peter Exp $
- * $DragonFly: src/lib/libdevstat/devstat.c,v 1.5 2005/01/08 19:19:26 joerg Exp $
  */
 
 #include <sys/types.h>
 #include <sys/sysctl.h>
-#include <sys/errno.h>
 
 #include <ctype.h>
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/libdmsg/dmsg_local.h b/lib/libdmsg/dmsg_local.h
index c3b4533348..d1c3c1c062 100644
--- a/lib/libdmsg/dmsg_local.h
+++ b/lib/libdmsg/dmsg_local.h
@@ -40,7 +40,6 @@
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/dmsg.h>
-#include <sys/poll.h>
 #include <sys/uio.h>
 
 #include <netinet/in.h>
@@ -52,6 +51,7 @@
 #include <pthread.h>
 #include <libutil.h>
 
+#include <poll.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c
index f1493a4c9d..3856882c5a 100644
--- a/lib/libfetch/fetch.c
+++ b/lib/libfetch/fetch.c
@@ -29,9 +29,9 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 
 #include <ctype.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/libkcore/kcore.c b/lib/libkcore/kcore.c
index 8e9b3681bd..a5a99518b0 100644
--- a/lib/libkcore/kcore.c
+++ b/lib/libkcore/kcore.c
@@ -30,16 +30,14 @@
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- * 
- * $DragonFly: src/lib/libkcore/kcore.c,v 1.6 2005/02/03 17:28:40 joerg Exp $
  */
 
 #include <sys/kinfo.h>
 #include <sys/param.h>
-#include <sys/fcntl.h>
 
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <kcore.h>
 #include <kvm.h>
 #include <stdlib.h>
diff --git a/lib/libposix1e/acl_delete.c b/lib/libposix1e/acl_delete.c
index 501e9f56fa..0103651553 100644
--- a/lib/libposix1e/acl_delete.c
+++ b/lib/libposix1e/acl_delete.c
@@ -23,8 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *$FreeBSD: src/lib/libposix1e/acl_delete.c,v 1.4 2000/01/26 04:19:36 rwatson Exp $
- *$DragonFly: src/lib/libposix1e/acl_delete.c,v 1.3 2005/08/04 17:27:09 drhodus Exp $
+ * $FreeBSD: src/lib/libposix1e/acl_delete.c,v 1.4 2000/01/26 04:19:36 rwatson Exp $
  */
 /*
  * acl_delete_def_file -- remove a default acl from a file
@@ -32,7 +31,7 @@
 
 #include <sys/types.h>
 #include <sys/acl.h>
-#include <sys/errno.h>
+#include <errno.h>
 
 int
 acl_delete_def_file(const char *path_p)
diff --git a/lib/libposix1e/acl_free.c b/lib/libposix1e/acl_free.c
index 3e1c80facf..6628290307 100644
--- a/lib/libposix1e/acl_free.c
+++ b/lib/libposix1e/acl_free.c
@@ -23,8 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *$FreeBSD: src/lib/libposix1e/acl_free.c,v 1.1 2000/01/15 19:44:23 rwatson Exp $
- *$DragonFly: src/lib/libposix1e/acl_free.c,v 1.3 2005/08/04 17:27:09 drhodus Exp $
+ * $FreeBSD: src/lib/libposix1e/acl_free.c,v 1.1 2000/01/15 19:44:23 rwatson Exp $
  */
 /*
  * acl_free -- free ACL objects from user memory
@@ -32,7 +31,7 @@
 
 #include <sys/types.h>
 #include <sys/acl.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <stdlib.h>
 
 int
diff --git a/lib/libposix1e/acl_from_text.c b/lib/libposix1e/acl_from_text.c
index 76b3965614..2ea679cced 100644
--- a/lib/libposix1e/acl_from_text.c
+++ b/lib/libposix1e/acl_from_text.c
@@ -23,8 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *$FreeBSD: src/lib/libposix1e/acl_from_text.c,v 1.1 2000/01/15 19:44:24 rwatson Exp $
- *$DragonFly: src/lib/libposix1e/acl_from_text.c,v 1.3 2005/08/04 17:27:09 drhodus Exp $
+ * $FreeBSD: src/lib/libposix1e/acl_from_text.c,v 1.1 2000/01/15 19:44:24 rwatson Exp $
  */
 /*
  * acl_from_text: convert a text-form ACL from a string to an acl_t
@@ -32,7 +31,7 @@
 
 #include <sys/types.h>
 #include <sys/acl.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/libposix1e/acl_get.c b/lib/libposix1e/acl_get.c
index 5a8e5ae11e..0ac371d63c 100644
--- a/lib/libposix1e/acl_get.c
+++ b/lib/libposix1e/acl_get.c
@@ -23,8 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *$FreeBSD: src/lib/libposix1e/acl_get.c,v 1.3 2000/01/26 04:19:37 rwatson Exp $
- *$DragonFly: src/lib/libposix1e/acl_get.c,v 1.3 2005/08/04 17:27:09 drhodus Exp $
+ * $FreeBSD: src/lib/libposix1e/acl_get.c,v 1.3 2000/01/26 04:19:37 rwatson Exp $
  */
 /*
  * acl_get_file - syscall wrapper for retrieving ACL by filename
@@ -34,7 +33,7 @@
 
 #include <sys/types.h>
 #include <sys/acl.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <stdlib.h>
 
 acl_t
diff --git a/lib/libposix1e/acl_to_text.c b/lib/libposix1e/acl_to_text.c
index f2aafde42f..c75c6ef79e 100644
--- a/lib/libposix1e/acl_to_text.c
+++ b/lib/libposix1e/acl_to_text.c
@@ -32,7 +32,7 @@
 
 #include <sys/param.h>
 #include <sys/acl.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/libposix1e/acl_valid.c b/lib/libposix1e/acl_valid.c
index e77250405f..465989cbad 100644
--- a/lib/libposix1e/acl_valid.c
+++ b/lib/libposix1e/acl_valid.c
@@ -23,8 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *$FreeBSD: src/lib/libposix1e/acl_valid.c,v 1.4 2000/01/28 20:07:00 rwatson Exp $
- *$DragonFly: src/lib/libposix1e/acl_valid.c,v 1.3 2005/08/04 17:27:09 drhodus Exp $
+ * $FreeBSD: src/lib/libposix1e/acl_valid.c,v 1.4 2000/01/28 20:07:00 rwatson Exp $
  */
 /*
  * acl_valid -- POSIX.1e ACL check routine
@@ -32,7 +31,7 @@
 
 #include <sys/types.h>
 #include <sys/acl.h>
-#include <sys/errno.h>
+#include <errno.h>
 
 #include "acl_support.h"
 
diff --git a/lib/libpuffs/dispatcher.c b/lib/libpuffs/dispatcher.c
index 7242bd1881..2e3d05cf0a 100644
--- a/lib/libpuffs/dispatcher.c
+++ b/lib/libpuffs/dispatcher.c
@@ -30,10 +30,10 @@
  */
 
 #include <sys/types.h>
-#include <sys/poll.h>
 
 #include <assert.h>
 #include <errno.h>
+#include <poll.h>
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/lib/librt/aio.c b/lib/librt/aio.c
index 8408b93ba0..46d2de9fd3 100644
--- a/lib/librt/aio.c
+++ b/lib/librt/aio.c
@@ -40,7 +40,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <errno.h>
-#include <sys/aio.h>
+#include <aio.h>
 #include <pthread.h>
 
 static void 	*_aio_thr_start(void *);
diff --git a/lib/libstand/hammer1.c b/lib/libstand/hammer1.c
index e3dde9d1f4..c0394135d1 100644
--- a/lib/libstand/hammer1.c
+++ b/lib/libstand/hammer1.c
@@ -52,7 +52,7 @@
 #endif
 
 #ifdef TESTING
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <err.h>
diff --git a/lib/libthread_xu/thread/thr_private.h b/lib/libthread_xu/thread/thr_private.h
index 7f4efc2aec..8b63657287 100644
--- a/lib/libthread_xu/thread/thr_private.h
+++ b/lib/libthread_xu/thread/thr_private.h
@@ -47,8 +47,8 @@
 #include <machine/cpumask.h>
 #include <errno.h>
 #include <limits.h>
+#include <sched.h>
 #include <signal.h>
-#include <sys/sched.h>
 #include <stdarg.h>
 #include <unistd.h>
 #include <pthread.h>
@@ -722,7 +722,7 @@ int	_schedparam_to_rtp(int policy, const struct sched_param *param,
 int	_umtx_sleep_err(volatile const int *, int, int);
 int	_umtx_wakeup_err(volatile const int *, int);
 
-/* #include <fcntl.h> */
+/* #include <sys/fcntl.h> */
 #ifdef  _SYS_FCNTL_H_
 int     __sys_fcntl(int, int, ...);
 int     __sys_open(const char *, int, ...);
@@ -734,8 +734,8 @@ int     __sys_openat(int, const char *, int, ...);
 int	__sys_ioctl(int, unsigned long, ...);
 #endif
 
-/* #include <sched.h> */
-#ifdef	_SCHED_H_
+/* #include <sys/sched.h> */
+#ifdef	_SYS_SCHED_H_
 int	__sys_sched_yield(void);
 #endif
 
diff --git a/lib/libthread_xu/thread/thr_sem.c b/lib/libthread_xu/thread/thr_sem.c
index a079ace3ba..9984bc8b47 100644
--- a/lib/libthread_xu/thread/thr_sem.c
+++ b/lib/libthread_xu/thread/thr_sem.c
@@ -30,7 +30,6 @@
 
 #include "namespace.h"
 #include <machine/tls.h>
-#include <sys/semaphore.h>
 #include <sys/mman.h>
 #include <sys/queue.h>
 #include <sys/stat.h>
@@ -39,6 +38,7 @@
 #include <fcntl.h>
 #include <limits.h>
 #include <pthread.h>
+#include <semaphore.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c
index 45e7204dbb..c6214bd471 100644
--- a/lib/libusb/libusb10.c
+++ b/lib/libusb/libusb10.c
@@ -30,6 +30,7 @@
 #else
 #include <assert.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <poll.h>
 #include <pthread.h>
 #include <stdio.h>
@@ -37,7 +38,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <time.h>
-#include <sys/fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/queue.h>
 #include <sys/endian.h>
diff --git a/lib/libusb/libusb10_hotplug.c b/lib/libusb/libusb10_hotplug.c
index cf6131ed33..0168bd962a 100644
--- a/lib/libusb/libusb10_hotplug.c
+++ b/lib/libusb/libusb10_hotplug.c
@@ -29,6 +29,7 @@
 #else
 #include <assert.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <poll.h>
 #include <pthread.h>
 #include <stdio.h>
@@ -36,7 +37,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <time.h>
-#include <sys/fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/queue.h>
 #include <sys/endian.h>
diff --git a/lib/libusb/libusb_global_linux.h b/lib/libusb/libusb_global_linux.h
index a0418565a4..5032b5d8e8 100644
--- a/lib/libusb/libusb_global_linux.h
+++ b/lib/libusb/libusb_global_linux.h
@@ -36,6 +36,7 @@
 
 #include <ctype.h>
 #include <errno.h>
+#include <poll.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -51,7 +52,6 @@
 #include <pthread.h>
 #include <sys/queue.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/time.h>
 #include <bus/u4b/usb_endian.h>
 #include <bus/u4b/usb_dragonfly.h>
diff --git a/lib/libutil/flopen.3 b/lib/libutil/flopen.3
index 1773140006..cacac98018 100644
--- a/lib/libutil/flopen.3
+++ b/lib/libutil/flopen.3
@@ -34,7 +34,7 @@
 .Sh LIBRARY
 .Lb libutil
 .Sh SYNOPSIS
-.In sys/fcntl.h
+.In fcntl.h
 .In libutil.h
 .Ft int
 .Fn flopen "const char *path" "int flags"
diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c
index 7b89302037..009b5437fd 100644
--- a/lib/libutil/gr_util.c
+++ b/lib/libutil/gr_util.c
@@ -27,11 +27,11 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 #include <sys/stat.h>
 
 #include <ctype.h>
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <grp.h>
 #include <inttypes.h>
diff --git a/lib/libutil/pw_util.c b/lib/libutil/pw_util.c
index d265b899bc..65db706374 100644
--- a/lib/libutil/pw_util.c
+++ b/lib/libutil/pw_util.c
@@ -43,7 +43,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/stat.h>
@@ -51,6 +50,7 @@
 
 #include <ctype.h>
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <inttypes.h>
 #include <libgen.h>
diff --git a/libexec/atrun/atrun.c b/libexec/atrun/atrun.c
index 2ad6a318bc..d58f4cb4dc 100644
--- a/libexec/atrun/atrun.c
+++ b/libexec/atrun/atrun.c
@@ -27,7 +27,6 @@
 
 /* System Headers */
 
-#include <sys/fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
@@ -35,6 +34,7 @@
 #include <ctype.h>
 #include <dirent.h>
 #include <err.h>
+#include <fcntl.h>
 #include <grp.h>
 #include <pwd.h>
 #include <signal.h>
diff --git a/libexec/bootpd/readfile.c b/libexec/bootpd/readfile.c
index 5ddf923b19..9eebde237e 100644
--- a/libexec/bootpd/readfile.c
+++ b/libexec/bootpd/readfile.c
@@ -32,13 +32,13 @@ SOFTWARE.
  */
 
 
-#include <sys/errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <sys/time.h>
 #include <netinet/in.h>
 
+#include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/libexec/pppoed/pppoed.c b/libexec/pppoed/pppoed.c
index d856c3394c..d53f3f19ed 100644
--- a/libexec/pppoed/pppoed.c
+++ b/libexec/pppoed/pppoed.c
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/libexec/pppoed/pppoed.c,v 1.2.6.8 2002/06/17 02:21:25 brian Exp $
- * $DragonFly: src/libexec/pppoed/pppoed.c,v 1.4 2007/06/04 00:40:31 swildner Exp $
  */
 
 #include <sys/param.h>
@@ -43,6 +42,7 @@
 #include <netgraph/socket/ng_socket.h>
 
 #include <errno.h>
+#include <fcntl.h>
 #include <paths.h>
 #include <signal.h>
 #include <stdio.h>
@@ -50,7 +50,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysexits.h>
-#include <sys/fcntl.h>
 #ifndef NOKLDLOAD
 #include <sys/linker.h>
 #include <sys/module.h>
diff --git a/libexec/rtld-elf/libmap.c b/libexec/rtld-elf/libmap.c
index 80d9a911d5..16021f1b80 100644
--- a/libexec/rtld-elf/libmap.c
+++ b/libexec/rtld-elf/libmap.c
@@ -4,12 +4,12 @@
 
 #include <sys/types.h>
 #include <sys/param.h>
-#include <sys/fcntl.h>
 #include <sys/mman.h>
 #include <sys/queue.h>
 #include <sys/stat.h>
 #include <dirent.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
 
diff --git a/libexec/ypxfr/ypxfrd_getmap.c b/libexec/ypxfr/ypxfrd_getmap.c
index 9ee331e244..4f57fed4b4 100644
--- a/libexec/ypxfr/ypxfrd_getmap.c
+++ b/libexec/ypxfr/ypxfrd_getmap.c
@@ -30,10 +30,10 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/libexec/ypxfr/ypxfrd_getmap.c,v 1.7.2.1 2002/02/15 00:46:54 des Exp $
- * $DragonFly: src/libexec/ypxfr/ypxfrd_getmap.c,v 1.2 2003/06/17 04:27:08 dillon Exp $
  */
 
 #include <errno.h>
+#include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
@@ -42,7 +42,6 @@
 #include <rpcsvc/yp.h>
 #include <rpc/rpc.h>
 #include <sys/uio.h>
-#include <sys/fcntl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include "ypxfr_extern.h"
diff --git a/sbin/diskinfo/diskinfo.c b/sbin/diskinfo/diskinfo.c
index c30de375af..b571d595c6 100644
--- a/sbin/diskinfo/diskinfo.c
+++ b/sbin/diskinfo/diskinfo.c
@@ -30,15 +30,13 @@
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- * 
- * $DragonFly: src/sbin/diskinfo/diskinfo.c,v 1.7 2008/05/19 10:19:49 corecode Exp $
  */
 
 #define DKTYPENAMES
 #include <sys/param.h>
-#include <sys/fcntl.h>
 #include <sys/dtype.h>
 #include <sys/diskslice.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/sbin/dmesg/dmesg.c b/sbin/dmesg/dmesg.c
index 5bbe2bc8df..488c4ea506 100644
--- a/sbin/dmesg/dmesg.c
+++ b/sbin/dmesg/dmesg.c
@@ -41,9 +41,9 @@
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <syslog.h>
 #include <unistd.h>
 #include <vis.h>
-#include <sys/syslog.h>
 
 static struct nlist nl[] = {
 #define	X_MSGBUF	0
diff --git a/sbin/ifconfig/regdomain.c b/sbin/ifconfig/regdomain.c
index eaef5f1fa3..aaa2548a82 100644
--- a/sbin/ifconfig/regdomain.c
+++ b/sbin/ifconfig/regdomain.c
@@ -27,11 +27,11 @@ static const char rcsid[] = "$FreeBSD: head/sbin/ifconfig/regdomain.c 200587 200
 #endif /* not lint */
 
 #include <sys/types.h>
-#include <sys/errno.h>
 #include <sys/mman.h>
 #include <sys/sbuf.h>
 #include <sys/stat.h>
 
+#include <errno.h>
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 6c396379e5..97e9536673 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -38,7 +38,6 @@
 #include <sys/mount.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
-#include <sys/syslog.h>
 
 #include <rpc/rpc.h>
 #include <rpc/pmap_clnt.h>
@@ -60,6 +59,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sysexits.h>
+#include <syslog.h>
 #include <unistd.h>
 
 #include "mounttab.h"
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c
index c9fb1deaf5..9eb69ee91b 100644
--- a/sbin/mountd/mountd.c
+++ b/sbin/mountd/mountd.c
@@ -38,10 +38,8 @@
 #include <sys/module.h>
 #include <sys/mount.h>
 #include <sys/mountctl.h>
-#include <sys/fcntl.h>
 #include <sys/linker.h>
 #include <sys/stat.h>
-#include <sys/syslog.h>
 #include <sys/sysctl.h>
 
 #include <rpc/rpc.h>
@@ -60,6 +58,7 @@
 #include <ctype.h>
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <grp.h>
 #include <limits.h>
 #include <libutil.h>
@@ -69,6 +68,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 #include <unistd.h>
 #include "pathnames.h"
 
diff --git a/sbin/nfsd/nfsd.c b/sbin/nfsd/nfsd.c
index a645d0227f..10d4f9abfd 100644
--- a/sbin/nfsd/nfsd.c
+++ b/sbin/nfsd/nfsd.c
@@ -35,7 +35,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/syslog.h>
 #include <sys/wait.h>
 #include <sys/mount.h>
 #include <sys/linker.h>
@@ -56,6 +55,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 #include <unistd.h>
 
 /* Global defs */
diff --git a/sbin/nfsiod/nfsiod.c b/sbin/nfsiod/nfsiod.c
index 6764efa222..5b23f0dbe8 100644
--- a/sbin/nfsiod/nfsiod.c
+++ b/sbin/nfsiod/nfsiod.c
@@ -32,11 +32,9 @@
  * @(#) Copyright (c) 1989, 1993 The Regents of the University of California.  All rights reserved.
  * @(#)nfsiod.c	8.4 (Berkeley) 5/3/95
  * $FreeBSD: src/sbin/nfsiod/nfsiod.c,v 1.9 1999/08/28 00:13:55 peter Exp $
- * $DragonFly: src/sbin/nfsiod/nfsiod.c,v 1.5 2004/11/14 20:07:25 liamfoy Exp $
  */
 
 #include <sys/param.h>
-#include <sys/syslog.h>
 #include <sys/wait.h>
 #include <sys/mount.h>
 
@@ -46,6 +44,7 @@
 #include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <syslog.h>
 #include <unistd.h>
 
 /* Global defs */
diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c
index 750085edbf..d0bb9e9cc8 100644
--- a/sbin/shutdown/shutdown.c
+++ b/sbin/shutdown/shutdown.c
@@ -34,7 +34,6 @@
 #include <sys/param.h>
 #include <sys/time.h>
 #include <sys/resource.h>
-#include <sys/syslog.h>
 
 #include <ctype.h>
 #include <err.h>
@@ -45,6 +44,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 #include <unistd.h>
 
 #include "pathnames.h"
diff --git a/sbin/udevd/test_udevd.c b/sbin/udevd/test_udevd.c
index 6564dfcd0b..68b0118629 100644
--- a/sbin/udevd/test_udevd.c
+++ b/sbin/udevd/test_udevd.c
@@ -2,7 +2,6 @@
 #include <sys/device.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
-#include <sys/poll.h>
 #include <sys/queue.h>
 #include <sys/un.h>
 
@@ -10,6 +9,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <poll.h>
 #include <signal.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/sbin/udevd/udevd.c b/sbin/udevd/udevd.c
index 66c03523c7..c0cfabdcb9 100644
--- a/sbin/udevd/udevd.c
+++ b/sbin/udevd/udevd.c
@@ -36,7 +36,6 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/queue.h>
 #include <sys/un.h>
 #include <cpu/inttypes.h>
@@ -45,6 +44,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <poll.h>
 #include <regex.h>
 #include <signal.h>
 #include <stdarg.h>
diff --git a/sbin/udevd/udevd_client.c b/sbin/udevd/udevd_client.c
index 212fb3ad66..b9bae34cce 100644
--- a/sbin/udevd/udevd_client.c
+++ b/sbin/udevd/udevd_client.c
@@ -36,7 +36,6 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/queue.h>
 #include <sys/un.h>
 #include <cpu/inttypes.h>
@@ -45,6 +44,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <poll.h>
 #include <regex.h>
 #include <signal.h>
 #include <stdarg.h>
diff --git a/sbin/udevd/udevd_monitor.c b/sbin/udevd/udevd_monitor.c
index 286a668b76..34dd9e6ba5 100644
--- a/sbin/udevd/udevd_monitor.c
+++ b/sbin/udevd/udevd_monitor.c
@@ -36,7 +36,6 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/queue.h>
 #include <sys/un.h>
 #include <cpu/inttypes.h>
@@ -47,6 +46,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <poll.h>
 #include <regex.h>
 #include <signal.h>
 #include <stdarg.h>
diff --git a/sbin/udevd/udevd_pdev.c b/sbin/udevd/udevd_pdev.c
index dcb50e69ba..37f4ba2185 100644
--- a/sbin/udevd/udevd_pdev.c
+++ b/sbin/udevd/udevd_pdev.c
@@ -36,7 +36,6 @@
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/queue.h>
 #include <sys/un.h>
 #include <cpu/inttypes.h>
@@ -45,6 +44,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <poll.h>
 #include <regex.h>
 #include <signal.h>
 #include <stdarg.h>
diff --git a/share/examples/meteor/rgb16.c b/share/examples/meteor/rgb16.c
index 4c7ee0703c..305fa70049 100644
--- a/share/examples/meteor/rgb16.c
+++ b/share/examples/meteor/rgb16.c
@@ -29,9 +29,10 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+
 #include <sys/types.h>
 #include <sys/mman.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 /*#include <machine/ioctl_meteor.h>*/
 #include "/sys/i386/include/ioctl_meteor.h"
 
diff --git a/share/examples/meteor/rgb24.c b/share/examples/meteor/rgb24.c
index f2969022bb..56c50d4716 100644
--- a/share/examples/meteor/rgb24.c
+++ b/share/examples/meteor/rgb24.c
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include <sys/fcntl.h>
+#include <fcntl.h>
 /*#include <machine/ioctl_meteor.h>*/
 #include "/sys/i386/include/ioctl_meteor.h"
 
diff --git a/share/examples/meteor/test-n.c b/share/examples/meteor/test-n.c
index 4651654c96..4e12192c5e 100644
--- a/share/examples/meteor/test-n.c
+++ b/share/examples/meteor/test-n.c
@@ -44,7 +44,7 @@
 
 #include <sys/types.h>
 #include <sys/mman.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 /*#include <machine/ioctl_meteor.h> */
 #include "/sys/i386/include/ioctl_meteor.h"
 
diff --git a/share/examples/meteor/yuvpk.c b/share/examples/meteor/yuvpk.c
index 6ebd2e4620..b230b9d1fe 100644
--- a/share/examples/meteor/yuvpk.c
+++ b/share/examples/meteor/yuvpk.c
@@ -31,7 +31,7 @@
 
 #include <sys/types.h>
 #include <sys/mman.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 /*#include <machine/ioctl_meteor.h>*/
 #include "/sys/i386/include/ioctl_meteor.h"
 
diff --git a/share/examples/meteor/yuvpl.c b/share/examples/meteor/yuvpl.c
index 704dfce331..9b68f47031 100644
--- a/share/examples/meteor/yuvpl.c
+++ b/share/examples/meteor/yuvpl.c
@@ -31,7 +31,7 @@
 
 #include <sys/types.h>
 #include <sys/mman.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 /*#include <machine/ioctl_meteor.h>*/                             
 #include "/sys/i386/include/ioctl_meteor.h"                   
 
diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4
index f44e552fc5..c0012ef496 100644
--- a/share/man/man4/pf.4
+++ b/share/man/man4/pf.4
@@ -1070,11 +1070,11 @@ command to find the internal host/port of a NATed connection:
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/fcntl.h>
 #include <net/if.h>
 #include <netinet/in.h>
 #include <net/pfvar.h>
 #include <err.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 
diff --git a/test/interbench/hackbench.c b/test/interbench/hackbench.c
index 641dd3d201..5191aa79e5 100644
--- a/test/interbench/hackbench.c
+++ b/test/interbench/hackbench.c
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
+#include <poll.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <semaphore.h>
@@ -9,7 +10,6 @@
 #include <sys/socket.h>
 #include <sys/wait.h>
 #include <sys/time.h>
-#include <sys/poll.h>
 #include "interbench.h"
 
 #define DATASIZE 100
diff --git a/test/stress/fsstress/global.h b/test/stress/fsstress/global.h
index 1d89cc49c5..0deffcb69a 100644
--- a/test/stress/fsstress/global.h
+++ b/test/stress/fsstress/global.h
@@ -29,9 +29,6 @@
  * 
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
-/*
- * $DragonFly: src/test/stress/fsstress/global.h,v 1.2 2007/05/12 21:46:49 swildner Exp $
- */
  
 #ifndef GLOBAL_H
 #define GLOBAL_H
@@ -63,10 +60,10 @@
 #endif
 #include <dirent.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <sys/fcntl.h>
 #include <string.h>
 #ifndef O_DIRECT
 #define O_DIRECT        040000
diff --git a/test/stress/stress2/misc/ldt.sh b/test/stress/stress2/misc/ldt.sh
index e6910e2be8..0295dea914 100755
--- a/test/stress/stress2/misc/ldt.sh
+++ b/test/stress/stress2/misc/ldt.sh
@@ -286,11 +286,11 @@ EOF
 
 #include <sys/cdefs.h>
 #include <sys/types.h>
-#include <sys/ucontext.h>
 #include <errno.h>
 #include <signal.h>
 #include <stdio.h>
 #include <string.h>
+#include <ucontext.h>
 #include <unistd.h>
 
 extern char *fault_instr;
diff --git a/test/stress/stress2/tools/fstool.c b/test/stress/stress2/tools/fstool.c
index 90eecebff7..b3557504f5 100644
--- a/test/stress/stress2/tools/fstool.c
+++ b/test/stress/stress2/tools/fstool.c
@@ -33,7 +33,7 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/param.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <string.h>
 #include <err.h>
 
diff --git a/test/sysperf/randread.c b/test/sysperf/randread.c
index b500ebb533..2c18cf40f0 100644
--- a/test/sysperf/randread.c
+++ b/test/sysperf/randread.c
@@ -10,8 +10,8 @@
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <sys/mman.h>
-#include <sys/errno.h>
 #include <sys/wait.h>
+#include <errno.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/test/sysperf/read1.c b/test/sysperf/read1.c
index 8065fdcf44..5650baa3a3 100644
--- a/test/sysperf/read1.c
+++ b/test/sysperf/read1.c
@@ -2,14 +2,12 @@
  * read1.c
  *
  * Tests reading 1 byte at a time from a file.
- *
- * $DragonFly: src/test/sysperf/read1.c,v 1.1 2004/08/13 02:28:42 dillon Exp $
  */
 
 #include "blib.h"
 #include <errno.h>
+#include <fcntl.h>
 #include <sys/resource.h>
-#include <sys/fcntl.h>
 
 char Buf[8192];
 
diff --git a/test/sysperf/syscall2.c b/test/sysperf/syscall2.c
index e9468bb9ce..c3e119ade3 100644
--- a/test/sysperf/syscall2.c
+++ b/test/sysperf/syscall2.c
@@ -5,8 +5,8 @@
  */
 
 #include <sys/types.h>
-#include <sys/errno.h>
 #include <sys/mman.h>
+#include <errno.h>
 #include <time.h>
 #include <stdio.h>
 
diff --git a/test/sysperf/umtx1.c b/test/sysperf/umtx1.c
index 786954754a..e2b711e0b7 100644
--- a/test/sysperf/umtx1.c
+++ b/test/sysperf/umtx1.c
@@ -4,7 +4,7 @@
 
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <pthread.h>
 #include <machine/cpufunc.h>
 #include <machine/atomic.h>
diff --git a/tools/regression/nfsmmap/test1/test1.c b/tools/regression/nfsmmap/test1/test1.c
index 9a49d06b1c..e982a34ebd 100644
--- a/tools/regression/nfsmmap/test1/test1.c
+++ b/tools/regression/nfsmmap/test1/test1.c
@@ -1,10 +1,6 @@
-/*
- * $DragonFly: src/tools/regression/nfsmmap/test1/test1.c,v 1.2 2003/11/07 14:38:38 eirikn Exp $
- */
-
 #include <sys/types.h>
-#include <sys/fcntl.h>
 #include <sys/mman.h>
+#include <fcntl.h>
 #include <unistd.h>
 
 int main(int argc, char** argv)
diff --git a/tools/regression/nfsmmap/test2/test2.c b/tools/regression/nfsmmap/test2/test2.c
index 15776f6ed3..7dfcfcdf7c 100644
--- a/tools/regression/nfsmmap/test2/test2.c
+++ b/tools/regression/nfsmmap/test2/test2.c
@@ -1,10 +1,6 @@
-/*
- * $DragonFly: src/tools/regression/nfsmmap/test2/test2.c,v 1.2 2003/11/07 14:38:38 eirikn Exp $
- */
-
 #include <sys/types.h>
-#include <sys/fcntl.h>
 #include <sys/mman.h>
+#include <fcntl.h>
 #include <unistd.h>
 
 int main(int argc, char** argv)
diff --git a/tools/regression/p1003_1b/fifo.c b/tools/regression/p1003_1b/fifo.c
index a34e0dc3a2..c7aaa62810 100644
--- a/tools/regression/p1003_1b/fifo.c
+++ b/tools/regression/p1003_1b/fifo.c
@@ -30,8 +30,8 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/tools/regression/p1003_1b/fifo.c,v 1.1 2000/02/16 14:28:40 dufault Exp $
- * $DragonFly: src/tools/regression/p1003_1b/fifo.c,v 1.3 2007/06/26 23:30:05 josepht Exp $
  */
+
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -41,7 +41,7 @@
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <sys/time.h>
-#include <sys/sched.h>
+#include <sched.h>
 #include <signal.h>
 
 volatile int ticked;
diff --git a/tools/regression/p1003_1b/prutil.c b/tools/regression/p1003_1b/prutil.c
index 043489a03e..fdccb88329 100644
--- a/tools/regression/p1003_1b/prutil.c
+++ b/tools/regression/p1003_1b/prutil.c
@@ -1,6 +1,6 @@
 #include <errno.h>
 #include <unistd.h>
-#include <sys/sched.h>
+#include <sched.h>
 #include <stdio.h>
 #include <stdlib.h>
 
diff --git a/tools/regression/p1003_1b/sched.c b/tools/regression/p1003_1b/sched.c
index 63ccd46782..f9cf5fe528 100644
--- a/tools/regression/p1003_1b/sched.c
+++ b/tools/regression/p1003_1b/sched.c
@@ -50,7 +50,7 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#include <sys/sched.h>
+#include <sched.h>
 
 #include "prutil.h"
 
diff --git a/tools/regression/p1003_1b/yield.c b/tools/regression/p1003_1b/yield.c
index 1a002fc25e..18916d7e5e 100644
--- a/tools/regression/p1003_1b/yield.c
+++ b/tools/regression/p1003_1b/yield.c
@@ -29,9 +29,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * $FreeBSD: src/tools/regression/p1003_1b/yield.c,v 1.1 2000/02/16 14:28:42 dufault Exp $
- * $DragonFly: src/tools/regression/p1003_1b/yield.c,v 1.3 2007/06/26 23:30:05 josepht Exp $
- *
  */
+
 #include <sys/types.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -41,7 +40,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/mman.h>
-#include <sys/sched.h>
+#include <sched.h>
 #include <stdlib.h>
 #include <sys/wait.h>
 
diff --git a/usr.bin/brandelf/brandelf.c b/usr.bin/brandelf/brandelf.c
index 0cecd8c829..d09e77b6bc 100644
--- a/usr.bin/brandelf/brandelf.c
+++ b/usr.bin/brandelf/brandelf.c
@@ -31,8 +31,8 @@
 
 #include <sys/types.h>
 #include <sys/elf_common.h>
-#include <sys/errno.h>
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.bin/chkey/chkey.c b/usr.bin/chkey/chkey.c
index f31c719973..6f40aaadef 100644
--- a/usr.bin/chkey/chkey.c
+++ b/usr.bin/chkey/chkey.c
@@ -27,7 +27,6 @@
  * 2550 Garcia Avenue
  * Mountain View, California  94043
  *
- * $DragonFly: src/usr.bin/chkey/chkey.c,v 1.6 2008/11/11 18:06:12 pavalos Exp $
  * @(#)chkey.c 1.7 91/03/11 Copyr 1986 Sun Micro
  */
 /*
@@ -37,8 +36,9 @@
 /*
  * Command to change one's public key in the public key database
  */
-#include <sys/fcntl.h>
+
 #include <err.h>
+#include <fcntl.h>
 #include <pwd.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.bin/crunch/crunchide/crunchide.c b/usr.bin/crunch/crunchide/crunchide.c
index 2cca9ab9d8..10c3f0f8f9 100644
--- a/usr.bin/crunch/crunchide/crunchide.c
+++ b/usr.bin/crunch/crunchide/crunchide.c
@@ -61,7 +61,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 955ba2bad7..06542d21c7 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -33,7 +33,6 @@
 
 #define _KERNEL_STRUCTURES
 
-#include <sys/errno.h>
 #include <sys/param.h>
 #include <sys/time.h>
 #include <sys/uio.h>
@@ -42,6 +41,7 @@
 #include <sys/ptrace.h>
 #include <dlfcn.h>
 #include <err.h>
+#include <errno.h>
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr
index a6044ec03e..40c67b2f36 100644
--- a/usr.bin/kdump/mksubr
+++ b/usr.bin/kdump/mksubr
@@ -148,7 +148,7 @@ cat <<_EOF_
 
 #include <stdio.h>
 #include <time.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/unistd.h>
 #include <sys/mman.h>
@@ -320,7 +320,7 @@ sockoptlevelname (int level, int decimal)
 _EOF_
 
 auto_or_type "modename" "S_[A-Z]+[[:space:]]+[0-6]{7}" "sys/stat.h"
-auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h"
+auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "fcntl.h"
 auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h"
 auto_or_type "mmapprotname" "PROT_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h"
 auto_or_type "mmapflagsname" "MAP_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h"
@@ -328,12 +328,12 @@ auto_or_type "wait4optname" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h"
 auto_or_type "getfsstatflagsname" "MNT_[A-Z]+[[:space:]]+0x[0-9][0-9][0-9][0-9][^0-9]" "sys/mount.h"
 auto_or_type "mountflagsname" "MNT_[A-Z]+[[:space:]]+0x[0-9][0-9][0-9][0-9][0-9]+" "sys/mount.h"
 auto_or_type "rebootoptname" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h"
-auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h"
+auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "fcntl.h"
 auto_or_type "mlockallname" "MCL_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h"
 auto_or_type "shmatname" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h"
 auto_or_type "rforkname" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h"
 auto_or_type "chflagsname" "[SU]F_[A-Z]+[[:space:]]+0x[0-9]+" "sys/stat.h"
-auto_or_type "atflagsname" "AT_[A-Z_]+[[:space:]]+[1-9]+[0-9]*" "sys/fcntl.h"
+auto_or_type "atflagsname" "AT_[A-Z_]+[[:space:]]+[1-9]+[0-9]*" "fcntl.h"
 
 auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h"
 auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h"
@@ -374,7 +374,7 @@ fcntlcmdname (int cmd, int arg, int decimal)
 	switch (cmd) {
 _EOF_
 egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z0-9_]+[[:space:]]+[0-9]+[[:space:]]*" \
-	$include_dir/sys/fcntl.h | \
+	$include_dir/fcntl.h | \
 	awk 'BEGIN { o=0 } { for (i = 1; i <= NF; i++) \
 		if ($i ~ /define/) \
 			break; \
diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c
index d25e4fa9a7..decdb61fcf 100644
--- a/usr.bin/ktrace/ktrace.c
+++ b/usr.bin/ktrace/ktrace.c
@@ -29,18 +29,17 @@
  * @(#) Copyright (c) 1988, 1993 The Regents of the University of California.  All rights reserved.
  * @(#)ktrace.c	8.1 (Berkeley) 6/6/93
  * $FreeBSD: src/usr.bin/ktrace/ktrace.c,v 1.12.2.3 2001/07/11 00:29:27 mikeh Exp $
- * $DragonFly: src/usr.bin/ktrace/ktrace.c,v 1.4 2005/06/01 03:05:40 swildner Exp $
  */
 
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <sys/time.h>
-#include <sys/errno.h>
 #include <sys/uio.h>
 #include <sys/ktrace.h>
 
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/usr.bin/perror/perror.c b/usr.bin/perror/perror.c
index 8e6ae11b18..968c3ed0e1 100644
--- a/usr.bin/perror/perror.c
+++ b/usr.bin/perror/perror.c
@@ -27,12 +27,12 @@
  * $FreeBSD: head/usr.bin/perror/perror.c 199642 2009-11-22 05:17:22Z edwin $
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <err.h>
 #include <locale.h>
-#include <sys/errno.h>
 
 static void usage(void);
 
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index 427139c5e6..4229f11cd3 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -38,11 +38,11 @@
 #include <sys/sysctl.h>
 #include <sys/queue.h>
 #include <sys/stat.h>
-#include <sys/fcntl.h>
 #include <sys/time.h>
 #include <sys/user.h>
 
 #include <assert.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
diff --git a/usr.bin/top/m_dragonfly.c b/usr.bin/top/m_dragonfly.c
index 7c0ffed24a..e48eb524f0 100644
--- a/usr.bin/top/m_dragonfly.c
+++ b/usr.bin/top/m_dragonfly.c
@@ -30,12 +30,12 @@
 
 #include "os.h"
 #include <err.h>
+#include <errno.h>
 #include <kvm.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <math.h>
 #include <pwd.h>
-#include <sys/errno.h>
 #include <sys/sysctl.h>
 #include <sys/file.h>
 #include <sys/vmmeter.h>
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 7ee06f0dcd..b1cb9ccad1 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -38,7 +38,6 @@
 #include <sys/namei.h>
 #include <sys/malloc.h>
 #include <sys/signal.h>
-#include <sys/fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/sysctl.h>
 #include <sys/vmmeter.h>
@@ -50,6 +49,7 @@
 #include <ctype.h>
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <kinfo.h>
 #include <kvm.h>
 #include <limits.h>
diff --git a/usr.sbin/802_11/ndis_events/ndis_events.c b/usr.sbin/802_11/ndis_events/ndis_events.c
index a393e1cf91..b90273216a 100644
--- a/usr.sbin/802_11/ndis_events/ndis_events.c
+++ b/usr.sbin/802_11/ndis_events/ndis_events.c
@@ -44,7 +44,6 @@
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/errno.h>
 #include <sys/sysctl.h>
 #include <net/if.h>
 #include <net/if_dl.h>
@@ -55,6 +54,7 @@
 #include <netdb.h>
 #include <net/route.h>
 
+#include <errno.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
diff --git a/usr.sbin/802_11/wpa_supplicant/Packet32.c b/usr.sbin/802_11/wpa_supplicant/Packet32.c
index 3e263e4b73..b188167a1f 100644
--- a/usr.sbin/802_11/wpa_supplicant/Packet32.c
+++ b/usr.sbin/802_11/wpa_supplicant/Packet32.c
@@ -44,9 +44,7 @@
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/errno.h>
 #include <sys/sysctl.h>
-#include <sys/fcntl.h>
 #include <net/if.h>
 #include <net/if_dl.h>
 #include <net/if_var.h>
@@ -59,6 +57,8 @@
 
 #include <netproto/802_11/ieee80211_ioctl.h>
 
+#include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
diff --git a/usr.sbin/bthcid/parser.y b/usr.sbin/bthcid/parser.y
index da0aacb3da..578a865270 100644
--- a/usr.sbin/bthcid/parser.y
+++ b/usr.sbin/bthcid/parser.y
@@ -28,13 +28,12 @@
  *
  * $Id: parser.y,v 1.5 2003/06/07 21:22:30 max Exp $
  * $FreeBSD: src/usr.sbin/bluetooth/hcsecd/parser.y,v 1.4 2004/09/14 20:04:33 emax Exp $
- * $DragonFly: src/usr.sbin/bthcid/parser.y,v 1.1 2008/01/30 14:10:19 hasso Exp $
  */
 
-#include <sys/fcntl.h>
 #include <sys/queue.h>
 #include <bluetooth.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdarg.h>
diff --git a/usr.sbin/burncd/burncd.c b/usr.sbin/burncd/burncd.c
index edacea0525..2f5d9e7d9f 100644
--- a/usr.sbin/burncd/burncd.c
+++ b/usr.sbin/burncd/burncd.c
@@ -26,7 +26,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/burncd/burncd.c,v 1.10.2.6 2002/11/20 00:26:18 njl Exp $
- * $DragonFly: src/usr.sbin/burncd/burncd.c,v 1.4 2008/06/05 18:06:33 swildner Exp $
  */
 
 #include <unistd.h>
@@ -34,9 +33,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <err.h>
+#include <errno.h>
 #include <sysexits.h>
 #include <fcntl.h>
-#include <sys/errno.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/cdio.h>
diff --git a/usr.sbin/clog/clog.c b/usr.sbin/clog/clog.c
index 3feaab5c5f..87e8af483f 100644
--- a/usr.sbin/clog/clog.c
+++ b/usr.sbin/clog/clog.c
@@ -25,7 +25,6 @@
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $Id: clog.c,v 1.3 2001/10/02 18:51:26 jdw Exp $
- * $DragonFly: src/usr.sbin/clog/clog.c,v 1.4 2007/06/26 23:30:05 josepht Exp $
  */
 
 
@@ -33,6 +32,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <poll.h>
+#include <sched.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -40,7 +40,6 @@
 #include <unistd.h>
 
 #include <sys/mman.h>
-#include <sys/sched.h>
 #include <sys/stat.h>
 #include <sys/uio.h>
 
diff --git a/usr.sbin/dconschat/dconschat.c b/usr.sbin/dconschat/dconschat.c
index 9254c4a77e..7150af689d 100644
--- a/usr.sbin/dconschat/dconschat.c
+++ b/usr.sbin/dconschat/dconschat.c
@@ -33,13 +33,13 @@
  * 
  * $Id: dconschat.c,v 1.76 2003/10/23 06:21:13 simokawa Exp $
  * $FreeBSD: src/usr.sbin/dconschat/dconschat.c,v 1.6 2004/05/26 22:59:54 brooks Exp $
- * $DragonFly: src/usr.sbin/dconschat/dconschat.c,v 1.1 2004/09/23 06:38:29 simokawa Exp $
  */
 
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <unistd.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -68,8 +68,6 @@
 #include <kvm.h>
 #include <nlist.h>
 
-#include <sys/errno.h>
-
 #define	DCONS_POLL_HZ		100
 #define	DCONS_POLL_OFFLINE	2	/* sec */
 
diff --git a/usr.sbin/fwcontrol/fwcontrol.c b/usr.sbin/fwcontrol/fwcontrol.c
index 1287051f82..7eb242a136 100644
--- a/usr.sbin/fwcontrol/fwcontrol.c
+++ b/usr.sbin/fwcontrol/fwcontrol.c
@@ -38,11 +38,11 @@
 #include <sys/malloc.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
-#include <sys/errno.h>
 #include <bus/firewire/firewire.h>
 #include <bus/firewire/iec13213.h>
 
 #include <netinet/in.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <err.h>
diff --git a/usr.sbin/installer/libdfui/conn_npipe.c b/usr.sbin/installer/libdfui/conn_npipe.c
index a9150f1a08..75236b39d0 100644
--- a/usr.sbin/installer/libdfui/conn_npipe.c
+++ b/usr.sbin/installer/libdfui/conn_npipe.c
@@ -42,9 +42,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
-#include <sys/errno.h>
 
 #include <err.h>
+#include <errno.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/installer/libdfui/conn_tcp.c b/usr.sbin/installer/libdfui/conn_tcp.c
index 2cd9ac726d..adff57d703 100644
--- a/usr.sbin/installer/libdfui/conn_tcp.c
+++ b/usr.sbin/installer/libdfui/conn_tcp.c
@@ -58,12 +58,12 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
-#include <sys/errno.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
 #include <err.h>
+#include <errno.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c
index 1d4a987624..4ee6b7b33a 100644
--- a/usr.sbin/iostat/iostat.c
+++ b/usr.sbin/iostat/iostat.c
@@ -26,7 +26,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/iostat/iostat.c,v 1.17.2.2 2001/07/19 04:15:42 kris Exp $
- * $DragonFly: src/usr.sbin/iostat/iostat.c,v 1.7 2005/09/01 19:08:38 swildner Exp $
  */
 /*
  * Parts of this program are derived from the original FreeBSD iostat
@@ -98,10 +97,10 @@
 
 #include <sys/user.h>
 #include <sys/param.h>
-#include <sys/errno.h>
 
 #include <err.h>
 #include <ctype.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <kinfo.h>
 #include <stdio.h>
diff --git a/usr.sbin/keyserv/setkey.c b/usr.sbin/keyserv/setkey.c
index 5ef5688950..ee076742d6 100644
--- a/usr.sbin/keyserv/setkey.c
+++ b/usr.sbin/keyserv/setkey.c
@@ -28,7 +28,6 @@
  *
  * @(#)setkey.c	1.11	94/04/25 SMI
  * $FreeBSD: src/usr.sbin/keyserv/setkey.c,v 1.3 1999/08/28 01:16:41 peter Exp $
- * $DragonFly: src/usr.sbin/keyserv/setkey.c,v 1.10 2008/06/05 18:06:33 swildner Exp $
  */
 
 /*
@@ -42,6 +41,7 @@
  * Cache the common keys, so the expensive computation is avoided.
  */
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -51,7 +51,6 @@
 #include <rpc/key_prot.h>
 #include <rpc/des_crypt.h>
 #include <rpc/des.h>
-#include <sys/errno.h>
 #include "keyserv.h"
 #include <openssl/bn.h>
 #include <openssl/crypto.h>
diff --git a/usr.sbin/mfiutil/mfi_cmd.c b/usr.sbin/mfiutil/mfi_cmd.c
index 30f1ccf399..8bea501ce2 100644
--- a/usr.sbin/mfiutil/mfi_cmd.c
+++ b/usr.sbin/mfiutil/mfi_cmd.c
@@ -30,7 +30,6 @@
  */
 
 #define _KERNEL_STRUCTURES
-#include <sys/errno.h>
 #include <sys/ioctl.h>
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -38,6 +37,7 @@
 #include <sys/uio.h>
 
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/mfiutil/mfi_drive.c b/usr.sbin/mfiutil/mfi_drive.c
index 5dd4de26f6..7b727f9cd3 100644
--- a/usr.sbin/mfiutil/mfi_drive.c
+++ b/usr.sbin/mfiutil/mfi_drive.c
@@ -30,9 +30,9 @@
  */
 
 #include <sys/types.h>
-#include <sys/errno.h>
 #include <ctype.h>
 #include <err.h>
+#include <errno.h>
 #include <libutil.h>
 #include <limits.h>
 #include <stdio.h>
diff --git a/usr.sbin/mfiutil/mfi_evt.c b/usr.sbin/mfiutil/mfi_evt.c
index dced8f7290..82e15fd3cd 100644
--- a/usr.sbin/mfiutil/mfi_evt.c
+++ b/usr.sbin/mfiutil/mfi_evt.c
@@ -30,8 +30,8 @@
  */
 
 #include <sys/types.h>
-#include <sys/errno.h>
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <strings.h>
diff --git a/usr.sbin/mfiutil/mfi_flash.c b/usr.sbin/mfiutil/mfi_flash.c
index 1940b1019d..fdf94afedb 100644
--- a/usr.sbin/mfiutil/mfi_flash.c
+++ b/usr.sbin/mfiutil/mfi_flash.c
@@ -30,9 +30,9 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 #include <sys/stat.h>
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/mfiutil/mfi_patrol.c b/usr.sbin/mfiutil/mfi_patrol.c
index 9764688140..1e86a93eed 100644
--- a/usr.sbin/mfiutil/mfi_patrol.c
+++ b/usr.sbin/mfiutil/mfi_patrol.c
@@ -30,8 +30,8 @@
  */
 
 #include <sys/types.h>
-#include <sys/errno.h>
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/usr.sbin/mfiutil/mfi_show.c b/usr.sbin/mfiutil/mfi_show.c
index 0c1b481d8f..9b2d716cb2 100644
--- a/usr.sbin/mfiutil/mfi_show.c
+++ b/usr.sbin/mfiutil/mfi_show.c
@@ -30,8 +30,8 @@
  */
 
 #include <sys/types.h>
-#include <sys/errno.h>
 #include <err.h>
+#include <errno.h>
 #include <libutil.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/mfiutil/mfi_volume.c b/usr.sbin/mfiutil/mfi_volume.c
index 3c99265667..148f98da92 100644
--- a/usr.sbin/mfiutil/mfi_volume.c
+++ b/usr.sbin/mfiutil/mfi_volume.c
@@ -30,8 +30,8 @@
  */
 
 #include <sys/types.h>
-#include <sys/errno.h>
 #include <err.h>
+#include <errno.h>
 #include <libutil.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/mfiutil/mfiutil.c b/usr.sbin/mfiutil/mfiutil.c
index 55ed3e162d..ad4b66c622 100644
--- a/usr.sbin/mfiutil/mfiutil.c
+++ b/usr.sbin/mfiutil/mfiutil.c
@@ -29,8 +29,8 @@
  * $FreeBSD: src/usr.sbin/mfiutil/mfiutil.c,v 1.5 2011/06/20 21:28:50 bz Exp $
  */
 
-#include <sys/errno.h>
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/usr.sbin/mptutil/mpt_cmd.c b/usr.sbin/mptutil/mpt_cmd.c
index 8b138c3bef..72b80faa1c 100644
--- a/usr.sbin/mptutil/mpt_cmd.c
+++ b/usr.sbin/mptutil/mpt_cmd.c
@@ -31,13 +31,13 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 #include <sys/ioctl.h>
 #include <sys/mpt_ioctl.h>
 #include <sys/sysctl.h>
 #include <sys/uio.h>
 
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/mptutil/mpt_config.c b/usr.sbin/mptutil/mpt_config.c
index bb4fe8c575..29f2e1a6a6 100644
--- a/usr.sbin/mptutil/mpt_config.c
+++ b/usr.sbin/mptutil/mpt_config.c
@@ -31,8 +31,8 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <libutil.h>
 #include <paths.h>
diff --git a/usr.sbin/mptutil/mpt_drive.c b/usr.sbin/mptutil/mpt_drive.c
index 15de48b58a..7f4a03d709 100644
--- a/usr.sbin/mptutil/mpt_drive.c
+++ b/usr.sbin/mptutil/mpt_drive.c
@@ -31,9 +31,9 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 #include <ctype.h>
 #include <err.h>
+#include <errno.h>
 #include <libutil.h>
 #include <limits.h>
 #include <stdio.h>
diff --git a/usr.sbin/mptutil/mpt_evt.c b/usr.sbin/mptutil/mpt_evt.c
index 75fec8d5a0..c3c407158e 100644
--- a/usr.sbin/mptutil/mpt_evt.c
+++ b/usr.sbin/mptutil/mpt_evt.c
@@ -31,9 +31,9 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 #include <ctype.h>
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/usr.sbin/mptutil/mpt_show.c b/usr.sbin/mptutil/mpt_show.c
index 7e6c485599..dbcb61a8ee 100644
--- a/usr.sbin/mptutil/mpt_show.c
+++ b/usr.sbin/mptutil/mpt_show.c
@@ -31,8 +31,8 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 #include <err.h>
+#include <errno.h>
 #include <libutil.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/mptutil/mpt_volume.c b/usr.sbin/mptutil/mpt_volume.c
index b75e56f0a4..d23f194e46 100644
--- a/usr.sbin/mptutil/mpt_volume.c
+++ b/usr.sbin/mptutil/mpt_volume.c
@@ -31,8 +31,8 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 #include <err.h>
+#include <errno.h>
 #include <libutil.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/mptutil/mptutil.c b/usr.sbin/mptutil/mptutil.c
index 1b2be226cc..fbe6cf3002 100644
--- a/usr.sbin/mptutil/mptutil.c
+++ b/usr.sbin/mptutil/mptutil.c
@@ -31,8 +31,8 @@
  */
 
 #include <sys/param.h>
-#include <sys/errno.h>
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index 7b579f4094..7483bd9152 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -30,10 +30,10 @@
  */
 
 #include <sys/types.h>
-#include <sys/fcntl.h>
 
 #include <ctype.h>
 #include <err.h>
+#include <fcntl.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/usr.sbin/ppp/ether.c b/usr.sbin/ppp/ether.c
index 9cd237efbe..b75c1b97b8 100644
--- a/usr.sbin/ppp/ether.c
+++ b/usr.sbin/ppp/ether.c
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/ppp/ether.c,v 1.9.2.14 2002/09/01 02:12:26 brian Exp $
- * $DragonFly: src/usr.sbin/ppp/ether.c,v 1.3 2003/08/08 04:18:47 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -52,11 +51,11 @@
 #endif
 
 #include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sysexits.h>
-#include <sys/fcntl.h>
 #include <sys/stat.h>
 #include <sys/uio.h>
 #include <termios.h>
diff --git a/usr.sbin/ppp/netgraph.c b/usr.sbin/ppp/netgraph.c
index 5c650eb968..37fe2cb044 100644
--- a/usr.sbin/ppp/netgraph.c
+++ b/usr.sbin/ppp/netgraph.c
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/ppp/netgraph.c,v 1.4.2.1 2002/09/01 02:12:29 brian Exp $
- * $DragonFly: src/usr.sbin/ppp/netgraph.c,v 1.3 2007/06/04 00:40:32 swildner Exp $
  */
 
 #include <sys/param.h>
@@ -48,11 +47,11 @@
 #endif
 
 #include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sysexits.h>
-#include <sys/fcntl.h>
 #include <sys/uio.h>
 #include <termios.h>
 #include <sys/time.h>
diff --git a/usr.sbin/ppp/prompt.c b/usr.sbin/ppp/prompt.c
index afea5b7e1f..daf9dccab6 100644
--- a/usr.sbin/ppp/prompt.c
+++ b/usr.sbin/ppp/prompt.c
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/ppp/prompt.c,v 1.20.2.5 2003/04/05 10:51:39 ume Exp $
- * $DragonFly: src/usr.sbin/ppp/prompt.c,v 1.2 2003/06/17 04:30:01 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -35,11 +34,11 @@
 #include <sys/un.h>
 
 #include <errno.h>
+#include <fcntl.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/fcntl.h>
 #include <termios.h>
 #include <unistd.h>
 
diff --git a/usr.sbin/rpc.umntall/mounttab.c b/usr.sbin/rpc.umntall/mounttab.c
index f4321db619..1369fbaf7f 100644
--- a/usr.sbin/rpc.umntall/mounttab.c
+++ b/usr.sbin/rpc.umntall/mounttab.c
@@ -24,11 +24,8 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/rpc.umntall/mounttab.c,v 1.2.2.1 2001/12/13 01:27:20 iedowse Exp $
- * $DragonFly: src/usr.sbin/rpc.umntall/mounttab.c,v 1.4 2008/11/12 21:44:59 swildner Exp $
  */
 
-#include <sys/syslog.h>
-
 #include <rpc/rpc.h>
 #include <nfs/rpcv2.h>
 
@@ -38,6 +35,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 #include <unistd.h>
 
 #include "mounttab.h"
diff --git a/usr.sbin/rpc.yppasswdd/yppasswdd_server.c b/usr.sbin/rpc.yppasswdd/yppasswdd_server.c
index 362ffc706b..e21bf855d0 100644
--- a/usr.sbin/rpc.yppasswdd/yppasswdd_server.c
+++ b/usr.sbin/rpc.yppasswdd/yppasswdd_server.c
@@ -33,7 +33,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/fcntl.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
@@ -45,6 +44,7 @@
 #include <db.h>
 #include <dirent.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <pwd.h>
 #include <signal.h>
diff --git a/usr.sbin/rpc.ypupdated/yp_dbupdate.c b/usr.sbin/rpc.ypupdated/yp_dbupdate.c
index 3e5d5824ff..a9cd926faa 100644
--- a/usr.sbin/rpc.ypupdated/yp_dbupdate.c
+++ b/usr.sbin/rpc.ypupdated/yp_dbupdate.c
@@ -30,15 +30,13 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/rpc.ypupdated/yp_dbupdate.c,v 1.9 2004/10/17 19:33:32 stefanf Exp $
- * $DragonFly: src/usr.sbin/rpc.ypupdated/yp_dbupdate.c,v 1.5 2007/11/25 01:28:24 swildner Exp $
  */
 
-#include <sys/fcntl.h>
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
 #include <db.h>
 #include <unistd.h>
diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
index c74752bc7d..8e0cce04c1 100644
--- a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
+++ b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c
@@ -30,11 +30,11 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/rpc.ypxfrd/ypxfrd_server.c,v 1.8.2.1 2002/02/15 00:46:58 des Exp $
- * $DragonFly: src/usr.sbin/rpc.ypxfrd/ypxfrd_server.c,v 1.3 2004/05/20 19:24:43 cpressey Exp $
  */
 
 #include "ypxfrd.h"
 
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -43,7 +43,6 @@
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/uio.h>
-#include <sys/fcntl.h>
 #include <machine/endian.h>
 #include "ypxfrd_extern.h"
 
diff --git a/usr.sbin/rpcbind/rpcb_svc_com.c b/usr.sbin/rpcbind/rpcb_svc_com.c
index 353a900ffb..8a60d24285 100644
--- a/usr.sbin/rpcbind/rpcb_svc_com.c
+++ b/usr.sbin/rpcbind/rpcb_svc_com.c
@@ -41,13 +41,13 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/param.h>
-#include <sys/poll.h>
 #include <sys/socket.h>
 #include <rpc/rpc.h>
 #include <rpc/rpcb_prot.h>
 #include <rpc/svc_dg.h>
 #include <assert.h>
 #include <netconfig.h>
+#include <poll.h>
 #include <errno.h>
 #include <syslog.h>
 #include <unistd.h>
diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c
index 5628fc7232..78fc47661f 100644
--- a/usr.sbin/rpcbind/rpcbind.c
+++ b/usr.sbin/rpcbind/rpcbind.c
@@ -41,7 +41,6 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/errno.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/wait.h>
@@ -54,6 +53,7 @@
 #include <netinet/in.h>
 #endif
 #include <arpa/inet.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <netdb.h>
 #include <stdio.h>
diff --git a/usr.sbin/rpcbind/util.c b/usr.sbin/rpcbind/util.c
index 4dd429ef46..c95330bd51 100644
--- a/usr.sbin/rpcbind/util.c
+++ b/usr.sbin/rpcbind/util.c
@@ -43,9 +43,9 @@
 #include <net/if.h>
 #include <netinet/in.h>
 #include <ifaddrs.h>
-#include <sys/poll.h>
 #include <rpc/rpc.h>
 #include <errno.h>
+#include <poll.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/usr.sbin/rtprio/rtprio.c b/usr.sbin/rtprio/rtprio.c
index fe07c0d8ef..013da1189c 100644
--- a/usr.sbin/rtprio/rtprio.c
+++ b/usr.sbin/rtprio/rtprio.c
@@ -32,15 +32,14 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/rtprio/rtprio.c,v 1.8.2.1 2001/01/29 08:07:26 kuriyama Exp $
- * $DragonFly: src/usr.sbin/rtprio/rtprio.c,v 1.5 2005/02/04 21:32:55 cpressey Exp $
  */
 
 #include <sys/param.h>
 #include <sys/rtprio.h>
-#include <sys/errno.h>
 
 #include <ctype.h>
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 40ffb7e3ff..72d0dc2a07 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -101,7 +101,7 @@
 #include "ttymsg.h"
 
 #define SYSLOG_NAMES
-#include <sys/syslog.h>
+#include <syslog.h>
 
 const char	*ConfFile = _PATH_LOGCONF;
 const char	*PidFile = _PATH_LOGPID;
diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c
index dedf10a7b1..b297c6e5f0 100644
--- a/usr.sbin/tzsetup/tzsetup.c
+++ b/usr.sbin/tzsetup/tzsetup.c
@@ -36,13 +36,13 @@
 
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
 
-#include <sys/fcntl.h>
 #include <sys/param.h>
 #include <sys/queue.h>
 #include <sys/stat.h>
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c
index 2b78ac8611..31753600b6 100644
--- a/usr.sbin/vidcontrol/vidcontrol.c
+++ b/usr.sbin/vidcontrol/vidcontrol.c
@@ -31,12 +31,12 @@
 #include <machine/console.h>
 
 #include <sys/consio.h>
-#include <sys/errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #include <ctype.h>
 #include <err.h>
+#include <errno.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/watch/watch.c b/usr.sbin/watch/watch.c
index 823c4848fb..e25376436f 100644
--- a/usr.sbin/watch/watch.c
+++ b/usr.sbin/watch/watch.c
@@ -13,11 +13,9 @@
  * Snoop stuff.
  *
  * $FreeBSD: src/usr.sbin/watch/watch.c,v 1.18.2.3 2002/08/17 00:59:03 mikeh Exp $
- * $DragonFly: src/usr.sbin/watch/watch.c,v 1.5 2005/12/05 01:23:23 swildner Exp $
  */
 
 #include <sys/param.h>
-#include <sys/fcntl.h>
 #include <sys/filio.h>
 #include <sys/snoop.h>
 #include <sys/stat.h>
@@ -25,6 +23,7 @@
 #include <sys/module.h>
 
 #include <err.h>
+#include <fcntl.h>
 #include <locale.h>
 #include <paths.h>
 #include <signal.h>
diff --git a/usr.sbin/ypbind/yp_ping.c b/usr.sbin/ypbind/yp_ping.c
index 8aea1ff548..4ed28d13f1 100644
--- a/usr.sbin/ypbind/yp_ping.c
+++ b/usr.sbin/ypbind/yp_ping.c
@@ -71,6 +71,7 @@
 
 #include <errno.h>
 #include <netdb.h>
+#include <poll.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -81,7 +82,6 @@
 #include <rpc/pmap_prot.h>
 #include <rpcsvc/yp.h>
 #include <sys/types.h>
-#include <sys/poll.h>
 #include <sys/socket.h>
 #include <sys/signal.h>
 #include <sys/ioctl.h>
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c
index ec9d3d65ac..c1f2b8f0e2 100644
--- a/usr.sbin/ypbind/ypbind.c
+++ b/usr.sbin/ypbind/ypbind.c
@@ -27,7 +27,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/ypbind/ypbind.c,v 1.40 2004/10/17 19:33:33 stefanf Exp $
- * $DragonFly: src/usr.sbin/ypbind/ypbind.c,v 1.6 2005/11/24 22:23:02 swildner Exp $
  */
 
 #include <sys/param.h>
@@ -37,13 +36,13 @@
 #include <sys/signal.h>
 #include <sys/socket.h>
 #include <sys/file.h>
-#include <sys/fcntl.h>
 #include <sys/stat.h>
 #include <sys/uio.h>
 #include <ctype.h>
 #include <dirent.h>
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <netdb.h>
 #include <signal.h>
 #include <stdio.h>
diff --git a/usr.sbin/yppush/yppush_main.c b/usr.sbin/yppush/yppush_main.c
index f4637f2f89..4f68aef31b 100644
--- a/usr.sbin/yppush/yppush_main.c
+++ b/usr.sbin/yppush/yppush_main.c
@@ -33,6 +33,7 @@
  */
 
 #include <errno.h>
+#include <fcntl.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -41,7 +42,6 @@
 #include <time.h>
 #include <unistd.h>
 #include <sys/socket.h>
-#include <sys/fcntl.h>
 #include <sys/wait.h>
 #include <sys/param.h>
 #include <rpc/rpc.h>
diff --git a/usr.sbin/ypserv/yp_access.c b/usr.sbin/ypserv/yp_access.c
index d2b8430ff0..0eb4b980d9 100644
--- a/usr.sbin/ypserv/yp_access.c
+++ b/usr.sbin/ypserv/yp_access.c
@@ -30,7 +30,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/usr.sbin/ypserv/yp_access.c,v 1.23 2006/05/31 22:31:08 cperciva Exp $
- * $DragonFly: src/usr.sbin/ypserv/yp_access.c,v 1.5 2006/06/13 12:38:37 corecode Exp $
  */
 
 #include <stdlib.h>
@@ -45,7 +44,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <sys/stat.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <paths.h>
 #include <errno.h>
 #include <sys/param.h>
diff --git a/usr.sbin/ypserv/yp_dnslookup.c b/usr.sbin/ypserv/yp_dnslookup.c
index 31e9badbb3..f7ef0d6dcf 100644
--- a/usr.sbin/ypserv/yp_dnslookup.c
+++ b/usr.sbin/ypserv/yp_dnslookup.c
@@ -45,7 +45,6 @@
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/time.h>
-#include <sys/fcntl.h>
 #include <sys/queue.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
@@ -53,6 +52,7 @@
 
 #include <ctype.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <netdb.h>
 #include <stdio.h>
 #include <stdlib.h>
-- 
2.15.0

