Print this page
12306 XPG4v2 slave pty behaviour should generally be disabled
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Change-ID: I7ccd399c22866f34dd20c6bb9d28e77ba4e24c67

@@ -26,11 +26,11 @@
  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 /*
  * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
- * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  */
 
 /*      Copyright (c) 1988 AT&T */
 /*        All Rights Reserved   */
 

@@ -248,10 +248,23 @@
 extern int posix_openpt(int);
 extern int setenv(const char *, const char *, int);
 extern int unsetenv(const char *);
 #endif
 
+/*
+ * In strict XPG4v2 mode, slave pseudo terminal devices behave differently.
+ * See the block comment in usr/src/lib/libc/port/gen/pt.c
+ */
+#if defined(_STRICT_SYMBOLS) && defined(_XPG4_2)
+#ifdef  __PRAGMA_REDEFINE_EXTNAME
+#pragma redefine_extname unlockpt __unlockpt_xpg4
+#else
+extern int __unlockpt_xpg4(int);
+#define unlockpt __unlockpt_xpg4
+#endif
+#endif  /* defined(_STRICT_SYMBOLS) && defined(_XPG4_2) */
+
 #if defined(__EXTENSIONS__) || \
         (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
 extern char *canonicalize_file_name(const char *);
 extern int clearenv(void);
 extern void closefrom(int);