zsh-workers
 help / color / mirror / code / Atom feed
* pty device files.
@ 2000-05-16 18:15 Tanaka Akira
  2000-05-16 19:37 ` Zefram
  0 siblings, 1 reply; 3+ messages in thread
From: Tanaka Akira @ 2000-05-16 18:15 UTC (permalink / raw)
  To: zsh-workers

I found that FreeBSD may have pty[p-sP-S][0-9a-v].
http://www.jp.freebsd.org/cgi/cvsweb.cgi/src/etc/MAKEDEV.diff?r1=1.65&r2=1.66

I modified default char1 to [p-zP-T] because NetBSD 1.4.2, OpenBSD
2.6, SunOS 4.1.4 may have them at least.
http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/basesrc/etc/etc.i386/MAKEDEV.diff?r1=1.53&r2=1.54 

Index: Src/Modules/zpty.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zpty.c,v
retrieving revision 1.7
diff -u -r1.7 zpty.c
--- Src/Modules/zpty.c	2000/05/08 11:06:27	1.7
+++ Src/Modules/zpty.c	2000/05/16 18:08:35
@@ -213,13 +213,16 @@
 get_pty(int master, int *retfd)
 {
 
-#ifdef __linux
+#if defined(__linux)
     static char char1[] = "abcdefghijklmnopqrstuvwxyz";
     static char char2[] = "0123456789abcdef";
-#else /* ! __linux */
-    static char char1[] = "pq";
+#elif defined(__FreeBSD__)
+    static char char1[] = "pqrsPQRS";
+    static char char2[] = "0123456789abcdefghijklmnopqrstuv";
+#else
+    static char char1[] = "pqrstuvwxyzPQRST";
     static char char2[] = "0123456789abcdef";
-#endif /* __linux */
+#endif
 
     static char name[11];
     static int mfd, sfd;
-- 
Tanaka Akira


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pty device files.
  2000-05-16 18:15 pty device files Tanaka Akira
@ 2000-05-16 19:37 ` Zefram
  2000-05-17  3:42   ` Tanaka Akira
  0 siblings, 1 reply; 3+ messages in thread
From: Zefram @ 2000-05-16 19:37 UTC (permalink / raw)
  To: Tanaka Akira; +Cc: zsh-workers

Tanaka Akira wrote:
>+#elif defined(__FreeBSD__)

Trivial point: #elif isn't portable enough for us (it's not in some
K&R preprocessors).  Though I see one has crept into system.h.

-zefram


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pty device files.
  2000-05-16 19:37 ` Zefram
@ 2000-05-17  3:42   ` Tanaka Akira
  0 siblings, 0 replies; 3+ messages in thread
From: Tanaka Akira @ 2000-05-17  3:42 UTC (permalink / raw)
  To: zsh-workers

In article <E12rn9y-0000b8-00@crucigera.fysh.org>,
  Zefram <zefram@fysh.org> writes:

> >+#elif defined(__FreeBSD__)
> 
> Trivial point: #elif isn't portable enough for us (it's not in some
> K&R preprocessors).  Though I see one has crept into system.h.

I see.

Index: Src/Modules/zpty.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zpty.c,v
retrieving revision 1.8
diff -u -r1.8 zpty.c
--- Src/Modules/zpty.c	2000/05/16 18:16:20	1.8
+++ Src/Modules/zpty.c	2000/05/17 03:40:01
@@ -213,16 +213,18 @@
 get_pty(int master, int *retfd)
 {
 
-#if defined(__linux)
+#ifdef __linux
     static char char1[] = "abcdefghijklmnopqrstuvwxyz";
     static char char2[] = "0123456789abcdef";
-#elif defined(__FreeBSD__)
+#else /* __linux */
+# ifdef __FreeBSD__
     static char char1[] = "pqrsPQRS";
     static char char2[] = "0123456789abcdefghijklmnopqrstuv";
-#else
+# else /* __FreeBSD__ */
     static char char1[] = "pqrstuvwxyzPQRST";
     static char char2[] = "0123456789abcdef";
-#endif
+# endif /* __FreeBSD__ */
+#endif /* __linux */
 
     static char name[11];
     static int mfd, sfd;
-- 
Tanaka Akira


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-05-17  3:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-16 18:15 pty device files Tanaka Akira
2000-05-16 19:37 ` Zefram
2000-05-17  3:42   ` Tanaka Akira

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).