$OpenBSD: patch-unix_uxpty_c,v 1.2 2013/01/13 10:12:52 brad Exp $
--- unix/uxpty.c.orig	Wed Mar  2 14:12:42 2011
+++ unix/uxpty.c	Thu Dec 27 01:30:33 2012
@@ -335,12 +335,21 @@ static void pty_open_master(Pty pty)
     chown(pty->name, getuid(), gp ? gp->gr_gid : -1);
     chmod(pty->name, 0600);
 #else
+#ifdef HAVE_POSIX_OPENPT
+    pty->master_fd = posix_openpt(O_RDWR|O_NOCTTY);
+
+    if (pty->master_fd < 0) {
+	perror("posix_openpt");
+	exit(1);
+    }
+#else
     pty->master_fd = open("/dev/ptmx", O_RDWR);
 
     if (pty->master_fd < 0) {
 	perror("/dev/ptmx: open");
 	exit(1);
     }
+#endif
 
     if (grantpt(pty->master_fd) < 0) {
 	perror("grantpt");
