aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-08-01 18:09:02 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-08-01 18:09:02 +0000
commit7f86f1dd15c739523417661e8482a9bd91300d92 (patch)
tree59281be6c93f8ea914846a6f4b8cc83efc6a0d09
parent6616056f0f89499d4662b646019f2d4a59624985 (diff)
parentb15feb70240a4fdf88ae1a7da85e6f87523e00ed (diff)
downloadbionic-7f86f1dd15c739523417661e8482a9bd91300d92.tar.gz
Merge "Clean up some <stdio.h> constants."
-rw-r--r--libc/include/stdio.h9
-rw-r--r--tests/stdio_test.cpp5
2 files changed, 9 insertions, 5 deletions
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index 2ac16861c..327bdc239 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -105,12 +105,11 @@ extern FILE __sF[] __REMOVED_IN(23);
* stdio can provide without attempting to allocate further resources
* (which could fail). Do not use this for anything.
*/
+#define FOPEN_MAX 20
+#define FILENAME_MAX 4096
-#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
-#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
-
-#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
-#define TMP_MAX 308915776
+#define L_tmpnam 4096
+#define TMP_MAX 308915776
/*
* Functions defined in ANSI C standard.
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index dac7056e2..1bb97a361 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -1918,3 +1918,8 @@ TEST(STDIO_TEST, freopen_append_mode_and_ftell) {
ASSERT_EQ(0, fclose(fp));
AssertFileIs(tf.filename, "0123456789xxx");
}
+
+TEST(STDIO_TEST, constants) {
+ ASSERT_LE(FILENAME_MAX, PATH_MAX);
+ ASSERT_EQ(L_tmpnam, PATH_MAX);
+}