From ae6e4aa3d17c13489a2b610a805a4b27140d4036 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Tue, 11 Feb 2020 18:50:16 +0100
Subject: [PATCH] Include <fcntl.h> instead of <sys/file.h> where this header
 is wanted.

---
 games/rogue/machdep.c            | 2 +-
 games/wump/wump.c                | 2 +-
 lib/libc/gen/nlist.c             | 2 +-
 lib/libc/stdio/flags.c           | 3 +--
 lib/libc/yp/yplib.c              | 2 +-
 lib/libdmsg/dmsg_local.h         | 2 +-
 lib/libkvm/kvm_proc.c            | 2 +-
 lib/libutil/uucplock.c           | 2 +-
 libexec/rpc.rquotad/rquotad.c    | 3 +--
 sbin/disklabel32/disklabel.c     | 2 +-
 sbin/disklabel64/disklabel64.c   | 2 +-
 sbin/fsck/setup.c                | 2 +-
 sbin/mount_cd9660/mount_cd9660.c | 2 +-
 sbin/newfs/defs.h                | 4 +---
 sbin/newfs/newfs.c               | 2 +-
 sbin/nvmectl/nvmectl.h           | 2 +-
 sbin/restore/dirs.c              | 2 +-
 sbin/restore/tape.c              | 2 +-
 sbin/route/route.c               | 2 +-
 sbin/svc/svc.h                   | 2 +-
 usr.bin/ktrace/ktrace.c          | 2 +-
 usr.bin/netstat/main.c           | 2 +-
 usr.bin/patch/inp.c              | 2 +-
 usr.bin/quota/quota.c            | 2 +-
 usr.bin/rwho/rwho.c              | 2 +-
 usr.bin/tftp/main.c              | 2 +-
 usr.bin/tip/tip.h                | 2 +-
 usr.bin/top/m_dragonfly.c        | 2 +-
 usr.sbin/authpf/authpf.c         | 2 +-
 usr.sbin/cdcontrol/cdcontrol.c   | 2 +-
 usr.sbin/config/main.c           | 2 +-
 usr.sbin/edquota/edquota.c       | 2 +-
 usr.sbin/fdcontrol/fdcontrol.c   | 2 +-
 usr.sbin/keyserv/keyserv.c       | 2 +-
 usr.sbin/powerd/powerd.c         | 2 +-
 usr.sbin/rarpd/rarpd.c           | 2 +-
 usr.sbin/sliplogin/sliplogin.c   | 2 +-
 usr.sbin/trpt/trpt.c             | 3 +--
 38 files changed, 38 insertions(+), 43 deletions(-)

diff --git a/games/rogue/machdep.c b/games/rogue/machdep.c
index d2911ad7a6..ed45f51a69 100644
--- a/games/rogue/machdep.c
+++ b/games/rogue/machdep.c
@@ -88,9 +88,9 @@
 
 #include <stdio.h>
 #include <sys/types.h>
-#include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
+#include <fcntl.h>
 #include <pwd.h>
 #include <time.h>
 
diff --git a/games/wump/wump.c b/games/wump/wump.c
index e5a4109ee9..82c5f996e8 100644
--- a/games/wump/wump.c
+++ b/games/wump/wump.c
@@ -43,8 +43,8 @@
 
 #include <err.h>
 #include <sys/types.h>
-#include <sys/file.h>
 #include <sys/wait.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index c436ca13f2..381ac552f5 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -35,10 +35,10 @@
 #include <sys/param.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
-#include <sys/file.h>
 
 #include <errno.h>
 #include <a.out.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/lib/libc/stdio/flags.c b/lib/libc/stdio/flags.c
index 7e1ea37af0..32242459c7 100644
--- a/lib/libc/stdio/flags.c
+++ b/lib/libc/stdio/flags.c
@@ -31,13 +31,12 @@
  *
  * @(#)flags.c	8.1 (Berkeley) 6/4/93
  * $FreeBSD: src/lib/libc/stdio/flags.c,v 1.10 2007/01/09 00:28:06 imp Exp $
- * $DragonFly: src/lib/libc/stdio/flags.c,v 1.5 2005/01/31 22:29:40 dillon Exp $
  */
 
 #include <sys/types.h>
-#include <sys/file.h>
 #include <stdio.h>
 #include <errno.h>
+#include <fcntl.h>
 
 #include "local.h"
 
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c
index 2bced56f43..6b81253d8c 100644
--- a/lib/libc/yp/yplib.c
+++ b/lib/libc/yp/yplib.c
@@ -35,10 +35,10 @@
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <sys/file.h>
 #include <sys/uio.h>
 #include <arpa/inet.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
diff --git a/lib/libdmsg/dmsg_local.h b/lib/libdmsg/dmsg_local.h
index da9b84e352..39087df3f3 100644
--- a/lib/libdmsg/dmsg_local.h
+++ b/lib/libdmsg/dmsg_local.h
@@ -36,7 +36,6 @@
 #include <sys/queue.h>
 #include <sys/tree.h>
 #include <sys/endian.h>
-#include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/dmsg.h>
@@ -49,6 +48,7 @@
 #include <arpa/inet.h>
 
 #include <assert.h>
+#include <fcntl.h>
 #include <pthread.h>
 #include <libutil.h>
 
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index 9c217028cd..02edb294c7 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -51,8 +51,8 @@
 #include <sys/globaldata.h>
 #include <sys/ioctl.h>
 #include <sys/tty.h>
-#include <sys/file.h>
 #include <sys/jail.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
diff --git a/lib/libutil/uucplock.c b/lib/libutil/uucplock.c
index 800863c214..a66187f68a 100644
--- a/lib/libutil/uucplock.c
+++ b/lib/libutil/uucplock.c
@@ -32,10 +32,10 @@
  */
 
 #include <sys/types.h>
-#include <sys/file.h>
 #include <dirent.h>
 #include <limits.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <paths.h>
 #include <signal.h>
 #include <stdio.h>
diff --git a/libexec/rpc.rquotad/rquotad.c b/libexec/rpc.rquotad/rquotad.c
index 8b87484c18..dffdb2ec4e 100644
--- a/libexec/rpc.rquotad/rquotad.c
+++ b/libexec/rpc.rquotad/rquotad.c
@@ -4,19 +4,18 @@
  * There is no copyright, you can use it as you want.
  *
  * $FreeBSD: src/libexec/rpc.rquotad/rquotad.c,v 1.3.2.1 2001/07/02 23:46:27 mikeh Exp $
- * $DragonFly: src/libexec/rpc.rquotad/rquotad.c,v 1.6 2008/11/19 18:41:30 swildner Exp $
  */
 
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/mount.h>
-#include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <signal.h>
 
 #include <ctype.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <fstab.h>
 #include <grp.h>
 #include <pwd.h>
diff --git a/sbin/disklabel32/disklabel.c b/sbin/disklabel32/disklabel.c
index 261a3a22a8..d72c09e977 100644
--- a/sbin/disklabel32/disklabel.c
+++ b/sbin/disklabel32/disklabel.c
@@ -36,7 +36,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #define DKTYPENAMES
@@ -47,6 +46,7 @@
 #include <sys/dtype.h>
 #include <sys/sysctl.h>
 #include <disktab.h>
+#include <fcntl.h>
 #include <fstab.h>
 
 #include <vfs/ufs/dinode.h>
diff --git a/sbin/disklabel64/disklabel64.c b/sbin/disklabel64/disklabel64.c
index c6d536202a..4a5d8a3d40 100644
--- a/sbin/disklabel64/disklabel64.c
+++ b/sbin/disklabel64/disklabel64.c
@@ -68,7 +68,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #define DKTYPENAMES
@@ -78,6 +77,7 @@
 #include <sys/dtype.h>
 #include <sys/sysctl.h>
 #include <disktab.h>
+#include <fcntl.h>
 #include <fstab.h>
 
 #include <vfs/ufs/dinode.h>
diff --git a/sbin/fsck/setup.c b/sbin/fsck/setup.c
index 3c2126cacb..33726a7ddd 100644
--- a/sbin/fsck/setup.c
+++ b/sbin/fsck/setup.c
@@ -34,7 +34,6 @@
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/diskslice.h>
-#include <sys/file.h>
 
 #include <vfs/ufs/dinode.h>
 #include <vfs/ufs/fs.h>
@@ -42,6 +41,7 @@
 #include <ctype.h>
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <string.h>
 
 #include "fsck.h"
diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c
index 4eb98fc281..44c4f7fee6 100644
--- a/sbin/mount_cd9660/mount_cd9660.c
+++ b/sbin/mount_cd9660/mount_cd9660.c
@@ -39,7 +39,6 @@
  */
 
 #include <sys/cdio.h>
-#include <sys/file.h>
 #include <sys/param.h>
 #include <sys/mount.h>
 #include <sys/iconv.h>
@@ -49,6 +48,7 @@
 
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <mntopts.h>
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/sbin/newfs/defs.h b/sbin/newfs/defs.h
index 1e097e8d00..fc91d93a3a 100644
--- a/sbin/newfs/defs.h
+++ b/sbin/newfs/defs.h
@@ -22,8 +22,6 @@
  * LIABILITY, 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/newfs/defs.h,v 1.3 2007/05/20 23:21:36 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -35,10 +33,10 @@
 #include <vfs/ufs/dinode.h>
 #include <vfs/ufs/dir.h>
 #include <vfs/ufs/fs.h>
-#include <sys/file.h>
 #include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <err.h>
+#include <fcntl.h>
 #include <signal.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index 7b446692eb..3568e73bbb 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -37,7 +37,6 @@
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/diskslice.h>
-#include <sys/file.h>
 #include <sys/mount.h>
 #include <sys/sysctl.h>
 
@@ -49,6 +48,7 @@
 #include <ctype.h>
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <mntopts.h>
 #include <inttypes.h>
 #include <paths.h>
diff --git a/sbin/nvmectl/nvmectl.h b/sbin/nvmectl/nvmectl.h
index bf7a39d76b..726438397e 100644
--- a/sbin/nvmectl/nvmectl.h
+++ b/sbin/nvmectl/nvmectl.h
@@ -33,7 +33,6 @@
  */
 
 #include <sys/types.h>
-#include <sys/file.h>
 #include <sys/ioctl.h>
 #include <dev/disk/nvme/nvme_fw.h>
 #include <dev/disk/nvme/nvme_log.h>
@@ -41,6 +40,7 @@
 #include <dev/disk/nvme/nvme_ns.h>
 #include <dev/disk/nvme/nvme_chipset.h>
 #include <dev/disk/nvme/nvme_ioctl.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c
index 9bf8b26444..719cc05a95 100644
--- a/sbin/restore/dirs.c
+++ b/sbin/restore/dirs.c
@@ -36,7 +36,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 
@@ -46,6 +45,7 @@
 
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <paths.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index 6b117da2b9..e6e9d6c787 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -36,7 +36,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/file.h>
 #include <sys/mtio.h>
 #include <sys/stat.h>
 #include <sys/time.h>
@@ -45,6 +44,7 @@
 #include <protocols/dumprestore.h>
 
 #include <errno.h>
+#include <fcntl.h>
 #include <paths.h>
 #include <setjmp.h>
 #include <stdio.h>
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 0d06c901f0..c40855fa15 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -32,7 +32,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/file.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <sys/sysctl.h>
@@ -52,6 +51,7 @@
 #include <ctype.h>
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <inttypes.h>
 #include <paths.h>
 #include <stdio.h>
diff --git a/sbin/svc/svc.h b/sbin/svc/svc.h
index 505aca1836..9bb285e201 100644
--- a/sbin/svc/svc.h
+++ b/sbin/svc/svc.h
@@ -36,7 +36,6 @@
 #include <sys/param.h>
 #include <sys/procctl.h>
 #include <sys/stat.h>
-#include <sys/file.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
@@ -45,6 +44,7 @@
 #include <sys/devfs.h>
 #include <sys/mount.h>
 #include <sys/jail.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c
index e66f0a6395..4864e93f4c 100644
--- a/usr.bin/ktrace/ktrace.c
+++ b/usr.bin/ktrace/ktrace.c
@@ -33,12 +33,12 @@
 
 #include <sys/param.h>
 #include <sys/stat.h>
-#include <sys/file.h>
 #include <sys/time.h>
 #include <sys/errno.h>
 #include <sys/ktrace.h>
 
 #include <err.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 1a9a56933f..405997a294 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -32,7 +32,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/file.h>
 #include <sys/protosw.h>
 #include <sys/socket.h>
 #include <sys/sysctl.h>
@@ -44,6 +43,7 @@
 #include <ctype.h>
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <kvm.h>
 #include <limits.h>
 #include <netdb.h>
diff --git a/usr.bin/patch/inp.c b/usr.bin/patch/inp.c
index 41cc27a384..afb644dc67 100644
--- a/usr.bin/patch/inp.c
+++ b/usr.bin/patch/inp.c
@@ -28,11 +28,11 @@
  */
 
 #include <sys/types.h>
-#include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
 
 #include <ctype.h>
+#include <fcntl.h>
 #include <libgen.h>
 #include <limits.h>
 #include <stddef.h>
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c
index 26d100a76b..17773dda5b 100644
--- a/usr.bin/quota/quota.c
+++ b/usr.bin/quota/quota.c
@@ -40,7 +40,6 @@
 
 #include <sys/param.h>
 #include <sys/types.h>
-#include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/mount.h>
 #include <sys/socket.h>
@@ -52,6 +51,7 @@
 #include <vfs/ufs/quota.h>
 
 #include <ctype.h>
+#include <fcntl.h>
 #include <err.h>
 #include <fstab.h>
 #include <grp.h>
diff --git a/usr.bin/rwho/rwho.c b/usr.bin/rwho/rwho.c
index 9520224937..540b59e1fa 100644
--- a/usr.bin/rwho/rwho.c
+++ b/usr.bin/rwho/rwho.c
@@ -32,12 +32,12 @@
  */
 
 #include <sys/param.h>
-#include <sys/file.h>
 
 #include <protocols/rwhod.h>
 
 #include <dirent.h>
 #include <err.h>
+#include <fcntl.h>
 #include <langinfo.h>
 #include <locale.h>
 #include <stdio.h>
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index f760212b0c..bd2cb0067f 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -39,7 +39,6 @@
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <sys/file.h>
 
 #include <netinet/in.h>
 
@@ -47,6 +46,7 @@
 
 #include <ctype.h>
 #include <err.h>
+#include <fcntl.h>
 #include <histedit.h>
 #include <netdb.h>
 #include <setjmp.h>
diff --git a/usr.bin/tip/tip.h b/usr.bin/tip/tip.h
index 8153b8c319..2f60a35471 100644
--- a/usr.bin/tip/tip.h
+++ b/usr.bin/tip/tip.h
@@ -38,13 +38,13 @@
 
 #include <sys/types.h>
 #include <machine/endian.h>
-#include <sys/file.h>
 #include <sys/time.h>
 #include <limits.h>
 
 #include <sys/ioctl.h>         /* for TIOCHPCL */
 #include <sys/filio.h>    /* for FIONREAD */
 
+#include <fcntl.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.bin/top/m_dragonfly.c b/usr.bin/top/m_dragonfly.c
index 2e11f38aca..5caf35a49c 100644
--- a/usr.bin/top/m_dragonfly.c
+++ b/usr.bin/top/m_dragonfly.c
@@ -30,6 +30,7 @@
 
 #include "os.h"
 #include <err.h>
+#include <fcntl.h>
 #include <kvm.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -37,7 +38,6 @@
 #include <pwd.h>
 #include <sys/errno.h>
 #include <sys/sysctl.h>
-#include <sys/file.h>
 #include <sys/vmmeter.h>
 #include <sys/resource.h>
 #include <sys/rtprio.h>
diff --git a/usr.sbin/authpf/authpf.c b/usr.sbin/authpf/authpf.c
index 12a55ba0e0..ae81c73468 100644
--- a/usr.sbin/authpf/authpf.c
+++ b/usr.sbin/authpf/authpf.c
@@ -20,7 +20,6 @@
 
 #include <sys/param.h>
 #include <sys/types.h>
-#include <sys/file.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
@@ -33,6 +32,7 @@
 
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <login_cap.h>
 #include <pwd.h>
 #include <signal.h>
diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c
index d60dbe1e90..56e536efdf 100644
--- a/usr.sbin/cdcontrol/cdcontrol.c
+++ b/usr.sbin/cdcontrol/cdcontrol.c
@@ -22,12 +22,12 @@
 
 #include <sys/cdio.h>
 #include <sys/cdrio.h>
-#include <sys/file.h>
 #include <sys/ioctl.h>
 #include <sys/param.h>
 #include <ctype.h>
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <histedit.h>
 #include <limits.h>
 #include <paths.h>
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 1e9bbda2e1..ad4d6bd32e 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -33,11 +33,11 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/file.h>
 #include <sys/mman.h>
 #include <sys/param.h>
 #include <ctype.h>
 #include <err.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <dirent.h>
 #include <sysexits.h>
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c
index 7f9ea31deb..5788f6422b 100644
--- a/usr.sbin/edquota/edquota.c
+++ b/usr.sbin/edquota/edquota.c
@@ -39,12 +39,12 @@
  */
 #include <sys/param.h>
 #include <sys/stat.h>
-#include <sys/file.h>
 #include <sys/wait.h>
 #include <vfs/ufs/quota.h>
 #include <ctype.h>
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <fstab.h>
 #include <grp.h>
 #include <pwd.h>
diff --git a/usr.sbin/fdcontrol/fdcontrol.c b/usr.sbin/fdcontrol/fdcontrol.c
index b30b97d9d6..1637da8dff 100644
--- a/usr.sbin/fdcontrol/fdcontrol.c
+++ b/usr.sbin/fdcontrol/fdcontrol.c
@@ -28,11 +28,11 @@
  */
 
 #include <err.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <machine/ioctl_fd.h>
-#include <sys/file.h>
 
 static int
 getnumber(void)
diff --git a/usr.sbin/keyserv/keyserv.c b/usr.sbin/keyserv/keyserv.c
index 1f0cd6ad75..7882bfdc38 100644
--- a/usr.sbin/keyserv/keyserv.c
+++ b/usr.sbin/keyserv/keyserv.c
@@ -43,6 +43,7 @@
  */
 
 #include <err.h>
+#include <fcntl.h>
 #include <pwd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -52,7 +53,6 @@
 #include <sys/types.h>
 #include <rpc/rpc.h>
 #include <sys/param.h>
-#include <sys/file.h>
 #include <rpc/des_crypt.h>
 #include <rpc/des.h>
 #include <rpc/key_prot.h>
diff --git a/usr.sbin/powerd/powerd.c b/usr.sbin/powerd/powerd.c
index fa64a8359f..ed81e945f1 100644
--- a/usr.sbin/powerd/powerd.c
+++ b/usr.sbin/powerd/powerd.c
@@ -44,7 +44,6 @@
 #include <sys/types.h>
 #include <sys/sysctl.h>
 #include <sys/kinfo.h>
-#include <sys/file.h>
 #include <sys/queue.h>
 #include <sys/soundcard.h>
 #include <sys/sensors.h>
@@ -52,6 +51,7 @@
 #include <sys/cpumask.h>
 #include <machine/cpufunc.h>
 #include <err.h>
+#include <fcntl.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c
index 9571aed455..284c5e10b3 100644
--- a/usr.sbin/rarpd/rarpd.c
+++ b/usr.sbin/rarpd/rarpd.c
@@ -27,7 +27,6 @@
  * Currently, the argument is ignored.
  */
 #include <sys/param.h>
-#include <sys/file.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/time.h>
@@ -46,6 +45,7 @@
 
 #include <dirent.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <ifaddrs.h>
 #include <netdb.h>
 #include <stdarg.h>
diff --git a/usr.sbin/sliplogin/sliplogin.c b/usr.sbin/sliplogin/sliplogin.c
index f0977eda2c..dd363aabbb 100644
--- a/usr.sbin/sliplogin/sliplogin.c
+++ b/usr.sbin/sliplogin/sliplogin.c
@@ -59,7 +59,6 @@
 
 #include <sys/param.h>
 #include <sys/socket.h>
-#include <sys/file.h>
 #include <sys/stat.h>
 #include <syslog.h>
 #include <netdb.h>
@@ -69,6 +68,7 @@
 #include <net/slip.h>
 #include <net/if.h>
 
+#include <fcntl.h>
 #include <stdio.h>
 #include <errno.h>
 #include <ctype.h>
diff --git a/usr.sbin/trpt/trpt.c b/usr.sbin/trpt/trpt.c
index ec7d3e8dc9..bd04b7aec5 100644
--- a/usr.sbin/trpt/trpt.c
+++ b/usr.sbin/trpt/trpt.c
@@ -29,7 +29,6 @@
  * @(#) Copyright (c) 1983, 1988, 1993 The Regents of the University of California.  All rights reserved.
  * @(#)trpt.c	8.1 (Berkeley) 6/6/93
  * $FreeBSD: src/usr.sbin/trpt/trpt.c,v 1.12 2000/01/29 11:49:07 shin Exp $
- * $DragonFly: src/usr.sbin/trpt/trpt.c,v 1.4 2004/03/21 22:41:24 cpressey Exp $
  */
 
 #include <sys/param.h>
@@ -38,7 +37,6 @@
 #include <sys/socketvar.h>
 #define PRUREQUESTS
 #include <sys/protosw.h>
-#include <sys/file.h>
 #include <sys/time.h>
 
 #include <net/route.h>
@@ -65,6 +63,7 @@
 #include <arpa/inet.h>
 
 #include <err.h>
+#include <fcntl.h>
 #include <nlist.h>
 #include <paths.h>
 #include <stdio.h>
-- 
2.24.1

