POSIX says <fcntl.h> makes SEEK_* visible.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html
We already had two copies of these constants, so time to factor them out
into bits/.
Change-Id: I213c0d2372e41463593f878d338002b8eaa918cd
diff --git a/libc/include/bits/seek_constants.h b/libc/include/bits/seek_constants.h
new file mode 100644
index 0000000..34c5866
--- /dev/null
+++ b/libc/include/bits/seek_constants.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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.
+ */
+
+#ifndef _BITS_SEEK_CONSTANTS_H_
+#define _BITS_SEEK_CONSTANTS_H_
+
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+
+#endif
diff --git a/libc/include/fcntl.h b/libc/include/fcntl.h
index 872a727..c49dbd0 100644
--- a/libc/include/fcntl.h
+++ b/libc/include/fcntl.h
@@ -37,6 +37,7 @@
#include <linux/uio.h>
#include <bits/fcntl.h>
+#include <bits/seek_constants.h>
#if defined(__USE_GNU) || defined(__USE_BSD)
#include <bits/lockf.h>
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index 097be3a..38021ef 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -47,6 +47,8 @@
#define __need_NULL
#include <stddef.h>
+#include <bits/seek_constants.h>
+
__BEGIN_DECLS
#if defined(__clang__)
@@ -106,10 +108,6 @@
#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
#define TMP_MAX 308915776
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-
/*
* Functions defined in ANSI C standard.
*/
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index 86949de..ac7d4c2 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -39,6 +39,7 @@
#include <bits/ioctl.h>
#include <bits/lockf.h>
#include <bits/posix_limits.h>
+#include <bits/seek_constants.h>
#include <bits/sysconf.h>
__BEGIN_DECLS
@@ -52,10 +53,6 @@
#define W_OK 2
#define R_OK 4
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-
#define _PC_FILESIZEBITS 0
#define _PC_LINK_MAX 1
#define _PC_MAX_CANON 2