Merge "Clean up some <stdio.h> constants."

This commit is contained in:
Elliott Hughes 2017-08-01 18:09:02 +00:00 committed by Gerrit Code Review
commit 7f86f1dd15
2 changed files with 9 additions and 5 deletions

View file

@ -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.

View file

@ -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);
}