diff options
author | Matthias-Christian Ott <ott@enolink.de> | 2008-06-02 18:40:22 +0200 |
---|---|---|
committer | Matthias-Christian Ott <ott@enolink.de> | 2008-06-02 18:40:22 +0200 |
commit | e2ac1676b10e71dcc2c11614637ea8f00d3ba9a1 (patch) | |
tree | 8d5fec06473f6e29eedfc74fe25e10d4993a65bf /std.c | |
parent | 375efb8891a2d131d46f1582fd770d34464094e0 (diff) | |
download | st-e2ac1676b10e71dcc2c11614637ea8f00d3ba9a1.tar.gz st-e2ac1676b10e71dcc2c11614637ea8f00d3ba9a1.zip |
drop support for proprietary UNIX variants
Proprietary UNIX variants like AIX, HP-UX or SCO UNIX
are nowadays rarely used and maintaining compatibility to
non-standard operating systems interfaces is wasteful and
practically useless.
Projects like xterm suffer from backward compatibility to decades-old
UNIX variants and terminal standards. This does not conform to st's
design goals.
Diffstat (limited to 'std.c')
-rw-r--r-- | std.c | 18 |
1 files changed, 2 insertions, 16 deletions
@@ -107,45 +107,31 @@ getpty(void) { | |||
107 | ptm = getpt(); | 107 | ptm = getpt(); |
108 | #elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 | 108 | #elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 |
109 | ptm = posix_openpt(O_RDWR); | 109 | ptm = posix_openpt(O_RDWR); |
110 | #elif defined(__sgi) | ||
111 | ttydev = _getpty(&ptm, O_RDWR, 0622, 0); | ||
112 | #elif defined(_AIX) | ||
113 | ptm = open("/dev/ptc", O_RDWR); | ||
114 | #else | 110 | #else |
115 | ptm = open("/dev/ptmx", O_RDWR); | 111 | ptm = open("/dev/ptmx", O_RDWR); |
116 | #if defined(__hpux) | ||
117 | if(ptm == -1) | ||
118 | ptm = open("/dev/ptym/clone", O_RDWR); | ||
119 | #endif | ||
120 | if(ptm == -1) { | 112 | if(ptm == -1) { |
121 | if(openpty(&ptm, &pts, NULL, NULL, NULL) == -1) | 113 | if(openpty(&ptm, &pts, NULL, NULL, NULL) == -1) |
122 | eprintn("error, cannot open pty"); | 114 | eprintn("error, cannot open pty"); |
123 | return; | 115 | return; |
124 | } | 116 | } |
125 | #endif | 117 | #endif |
118 | #if defined(_XOPEN_SOURCE) | ||
126 | if(ptm != -1) { | 119 | if(ptm != -1) { |
127 | #if defined(_XOPEN_SOURCE) || !defined(__sgi) || !defined(_AIX) | ||
128 | if(grantpt(ptm) == -1) | 120 | if(grantpt(ptm) == -1) |
129 | eprintn("error, cannot grant access to pty"); | 121 | eprintn("error, cannot grant access to pty"); |
130 | if(unlockpt(ptm) == -1) | 122 | if(unlockpt(ptm) == -1) |
131 | eprintn("error, cannot unlock pty"); | 123 | eprintn("error, cannot unlock pty"); |
132 | ptsdev = ptsname(ptm); | 124 | ptsdev = ptsname(ptm); |
133 | #elif defined(_AIX) | ||
134 | ptsdev = ttyname(ptm); | ||
135 | #endif | ||
136 | if(!ptsdev) | 125 | if(!ptsdev) |
137 | eprintn("error, slave pty name undefined"); | 126 | eprintn("error, slave pty name undefined"); |
138 | pts = open(ptsdev, O_RDWR); | 127 | pts = open(ptsdev, O_RDWR); |
139 | if(pts == -1) | 128 | if(pts == -1) |
140 | eprintn("error, cannot open slave pty"); | 129 | eprintn("error, cannot open slave pty"); |
141 | puts(ptsdev); | 130 | puts(ptsdev); |
142 | #if defined(__hpux) || defined(sun) || defined(__sun) | ||
143 | ioctl(pts, I_PUSH, "ptem"); | ||
144 | ioctl(pts, I_PUSH, "ldterm"); | ||
145 | #endif | ||
146 | } | 131 | } |
147 | else | 132 | else |
148 | eprintn("error, cannot open pty"); | 133 | eprintn("error, cannot open pty"); |
134 | #endif | ||
149 | } | 135 | } |
150 | 136 | ||
151 | void | 137 | void |