include types.h and ucred.h for the struct ucred, disable assertion on DT_WHT
not sure why HAVE_FLOCK64 is defined, but we have to bypass it
correct the ucred member uid -> cr_uid

Index: external/corefx/src/Native/Unix/System.Native/pal_io.c
--- external/corefx/src/Native/Unix/System.Native/pal_io.c.orig
+++ external/corefx/src/Native/Unix/System.Native/pal_io.c
@@ -2,6 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
+#include <sys/types.h>
+#include <sys/ucred.h>
 #include "pal_compiler.h"
 #include "pal_config.h"
 #include "pal_errno.h"
@@ -101,7 +103,7 @@ c_static_assert(PAL_DT_BLK == TO_NODETYPE(DT_BLK));
 c_static_assert(PAL_DT_REG == TO_NODETYPE(DT_REG));
 c_static_assert(PAL_DT_LNK == TO_NODETYPE(DT_LNK));
 c_static_assert(PAL_DT_SOCK == TO_NODETYPE(DT_SOCK));
-c_static_assert(PAL_DT_WHT == TO_NODETYPE(DT_WHT));
+//c_static_assert(PAL_DT_WHT == TO_NODETYPE(DT_WHT)); // per comment, AIX doesn't do any of this anyway
 #undef TO_NODETYPE
 #endif
 
@@ -1436,7 +1438,7 @@ int32_t SystemNative_GetPeerID(intptr_t socket, uid_t*
     socklen_t len = sizeof(creds);
     if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &creds, &len) == 0)
     {
-        *euid = creds.uid;
+        *euid = creds.cr_uid;
         return 0;
     }
     return -1;
@@ -1465,11 +1467,7 @@ int32_t SystemNative_LockFileRegion(intptr_t fd, int64
         return -1;
     }
 
-#if HAVE_FLOCK64
-    struct flock64 lockArgs;
-#else
     struct flock lockArgs;
-#endif
 
     lockArgs.l_type = lockType;
     lockArgs.l_whence = SEEK_SET;
