Include <unistd.h> for lseek()
authorGeorge Koehler <kernigh@gmail.com>
Fri, 22 Mar 2019 17:18:07 +0000 (13:18 -0400)
committerGeorge Koehler <kernigh@gmail.com>
Fri, 22 Mar 2019 17:18:07 +0000 (13:18 -0400)
This unbreaks my build in OpenBSD.  The old `long lseek()` conflicts
with `off_t lseek()` in OpenBSD headers, because long and off_t are
different types.  Commit b4df26e caused "system.h" to include some
headers where OpenBSD declares lseek().

Manuals for lseek() say to #include <unistd.h>.  Do so to be portable
to systems where other headers don't declare lseek().

modules/src/system/open.c
modules/src/system/seek.c

index cf24f32..1433cea 100644 (file)
@@ -4,6 +4,7 @@
  */
 /* $Id$ */
 
+#include <unistd.h>
 #include "system.h"
 
 extern File *_get_entry();
@@ -16,7 +17,6 @@ sys_open(path, flag, filep)
 {
        register int fd;
        register File *fp;
-       long lseek();
 
        if ((fp = _get_entry()) == (File *)0)
                return 0;
index e4d1f85..97749ae 100644 (file)
@@ -4,10 +4,9 @@
  */
 /* $Id$ */
 
+#include <unistd.h>
 #include "system.h"
 
-long lseek();
-
 int
 sys_seek(fp, off, whence, poff)
        File *fp;