diff options
author | Calvin Buckley <calvin@cmpct.info> | 2018-06-19 16:18:25 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-06-19 16:36:25 +0300 |
commit | ed31064357cf8decf4316181810461bb11561dc1 (patch) | |
tree | ff3ac58d54fb41afd3af9efd38e728e1ec3d7856 | |
parent | a81ee32770b5fdc65b1c5fb664404ce1d736b342 (diff) |
Backport getline fix for AIX to Mono CoreFX
-rw-r--r-- | src/Native/Unix/System.Native/pal_io.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Native/Unix/System.Native/pal_io.c b/src/Native/Unix/System.Native/pal_io.c index acb0097347..5a5fb824e6 100644 --- a/src/Native/Unix/System.Native/pal_io.c +++ b/src/Native/Unix/System.Native/pal_io.c @@ -2,11 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#ifdef _AIX -// For getline (declare this before stdio) -#define _GETDELIM 1 -#endif - #include "pal_compiler.h" #include "pal_config.h" #include "pal_errno.h" @@ -47,6 +42,11 @@ // Somehow, AIX mangles the definition for this behind a C++ def // Redeclare it here extern int getpeereid(int, uid_t *__restrict__, gid_t *__restrict__); +// This function declaration is hidden behind `_XOPEN_SOURCE=700`, but we need +// `_ALL_SOURCE` to build the runtime, and that resets that definition to 600. +// Instead of trying to wrangle ifdefs in system headers with more definitions, +// just declare it here. +extern ssize_t getline(char **, size_t *, FILE *); #endif #if HAVE_STAT64 |