4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Problems on Tandem systems while compiling and at runtime.
12 Solution: Recognize root uid is 65535. Check select() return value for it
13 not being supported. Avoid wrong function prototypes. Mention
14 use of -lfloss. (Matthew Woehlke)
15 Files: src/Makefile, src/ex_cmds.c, src/fileio.c, src/main.c,
16 src/osdef1.h.in, src/osdef2.h.in, src/os_unix.c, src/pty.c,
20 *** ../vim-7.0.201/src/Makefile Tue Feb 20 04:46:41 2007
21 --- src/Makefile Tue Feb 27 10:24:05 2007
25 #SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar
26 #SunOS 4.1.3_U1 (sun4c) gcc +X11 +GUI Athena 5.0w (J) Darren Hiebert
27 #SUPER-UX 6.2 (NEC SX-4) cc +X11R6 Motif,Athena4.6b (P) Lennart Schultz
28 + #Tandem/NSK (c) Matthew Woehlke
29 #Unisys 6035 cc +X11 Motif 5.3 (8) Glauber Ribeiro
30 #ESIX V4.2 cc +X11 6.0 (a) Reinhard Wobst
31 #Mac OS X 10.[23] gcc Carbon 6.2 (x) Bram Moolenaar
35 # (a) See line with EXTRA_LIBS below.
36 # (b) When using gcc with the Solaris linker, make sure you don't use GNU
37 # strip, otherwise the binary may not run: "Cannot find ELF".
38 + # (c) Add -lfloss to EXTRA_LIBS, see below.
39 # (x) When you get warnings for precompiled header files, run
40 # "sudo fixPrecomps". Also see CONF_OPT_DARWIN below.
46 ### (a) ESIX V4.2 (Reinhard Wobst)
47 #EXTRA_LIBS = -lnsl -lsocket -lgen -lXIM -lXmu -lXext
49 + ### (c) Tandem/NSK (Matthew Woehlke)
50 + #EXTRA_LIBS = -lfloss
52 ### If you want to use ncurses library instead of the automatically found one
53 ### after changing this, you need to do "make reconfig".
54 *** ../vim-7.0.201/src/ex_cmds.c Tue Feb 13 03:49:01 2007
55 --- src/ex_cmds.c Tue Feb 20 05:20:55 2007
59 st_old.st_dev = st_old.st_ino = 0;
60 st_old.st_mode = 0600;
61 ! if (mch_stat((char *)fname, &st_old) == 0 && getuid()
62 && !(st_old.st_uid == getuid()
63 ? (st_old.st_mode & 0200)
64 : (st_old.st_gid == getgid()
67 st_old.st_dev = st_old.st_ino = 0;
68 st_old.st_mode = 0600;
69 ! if (mch_stat((char *)fname, &st_old) == 0
70 ! && getuid() != ROOT_UID
71 && !(st_old.st_uid == getuid()
72 ? (st_old.st_mode & 0200)
73 : (st_old.st_gid == getgid()
74 *** ../vim-7.0.201/src/fileio.c Tue Jan 16 21:31:38 2007
75 --- src/fileio.c Wed Feb 21 06:04:39 2007
82 size = SSIZE_MAX; /* use max I/O size, 52K */
84 size = 0x10000L; /* use buffer >= 64K */
89 ! # if defined(SSIZE_MAX) && (SSIZE_MAX < 0x10000L)
90 size = SSIZE_MAX; /* use max I/O size, 52K */
92 size = 0x10000L; /* use buffer >= 64K */
93 *** ../vim-7.0.201/src/main.c Tue Nov 7 22:41:37 2006
94 --- src/main.c Tue Feb 20 05:22:33 2007
108 ! && getuid() != ROOT_UID
112 *** ../vim-7.0.201/src/osdef1.h.in Sun Jun 13 21:14:18 2004
113 --- src/osdef1.h.in Tue Feb 20 05:13:23 2007
119 extern int fork __ARGS((void));
121 extern int execvp __ARGS((const char *, const char **));
123 extern int wait __ARGS((int *)); /* will this break things ...? */
124 extern int waitpid __ARGS((pid_t, int *, int));
129 extern int kill __ARGS((int, int));
131 extern int access __ARGS((char *, int));
132 extern int fsync __ARGS((int));
133 extern int fchown __ARGS((int, int, int));
134 ! #if defined(HAVE_GETCWD) && !defined(sun)
135 extern char *getcwd __ARGS((char *, int));
137 extern char *getwd __ARGS((char *));
140 extern int kill __ARGS((int, int));
143 extern int access __ARGS((char *, int));
145 extern int fsync __ARGS((int));
146 extern int fchown __ARGS((int, int, int));
147 ! #if defined(HAVE_GETCWD) && !defined(sun) && !defined(__TANDEM)
148 extern char *getcwd __ARGS((char *, int));
150 extern char *getwd __ARGS((char *));
151 *** ../vim-7.0.201/src/osdef2.h.in Sun Jun 13 17:19:40 2004
152 --- src/osdef2.h.in Tue Feb 20 05:14:50 2007
156 extern int setenv __ARGS((char *, char *, int));
157 extern int putenv __ARGS((const char *));
160 extern int gethostname __ARGS((char *, int));
162 extern void perror __ARGS((char *));
165 extern int sleep __ARGS((int));
167 extern int usleep __ARGS((unsigned int));
168 extern unsigned int alarm __ARGS((unsigned int));
170 extern int chdir __ARGS((char *));
172 extern int fchdir __ARGS((int));
173 #ifndef stat /* could be redefined to stat64() */
174 extern int stat __ARGS((const char *, struct stat *));
178 extern int fstat __ARGS((int, struct stat *));
179 extern int open __ARGS((const char *, int, ...));
180 extern int close __ARGS((int));
182 extern int read __ARGS((int, char *, size_t));
183 extern int write __ARGS((int, char *, size_t));
185 extern int pipe __ARGS((int *));
186 extern off_t lseek __ARGS((int, off_t, int));
187 extern void sync __ARGS((void));
188 *** ../vim-7.0.201/src/os_unix.c Tue Jan 9 15:15:36 2007
189 --- src/os_unix.c Tue Feb 20 05:17:23 2007
192 * Don't use it for the Mac, it causes a warning for precompiled headers.
193 * TODO: use a configure check for precompiled headers?
196 # define select select_declared_wrong
200 * Don't use it for the Mac, it causes a warning for precompiled headers.
201 * TODO: use a configure check for precompiled headers?
203 ! #if !defined(__APPLE__) && !defined(__TANDEM)
204 # define select select_declared_wrong
210 * Use this prototype for select, some include files have a wrong prototype
214 ! # define select beos_select
217 #if defined(HAVE_SELECT)
220 * Use this prototype for select, some include files have a wrong prototype
225 ! # define select beos_select
229 #if defined(HAVE_SELECT)
234 ret = select(maxfd + 1, &rfds, NULL, &efds, tvp);
237 + if (ret == -1 && errno == ENOTSUP)
244 # ifdef FEAT_MZSCHEME
245 if (ret == 0 && mzquantum_used)
246 /* loop if MzThreads must be scheduled and timeout occured */
247 *** ../vim-7.0.201/src/pty.c Wed Nov 1 18:12:46 2006
248 --- src/pty.c Tue Feb 20 05:21:22 2007
251 if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_EXTRA)) < 0)
253 strncpy(TtyName, ttyname(f), sizeof(TtyName));
254 ! if (geteuid() && mch_access(TtyName, R_OK | W_OK))
259 if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_EXTRA)) < 0)
261 strncpy(TtyName, ttyname(f), sizeof(TtyName));
262 ! if (geteuid() != ROOT_UID && mch_access(TtyName, R_OK | W_OK))
271 ! if (geteuid() && mch_access(TtyName, R_OK | W_OK))
279 ! if (geteuid() != ROOT_UID && mch_access(TtyName, R_OK | W_OK))
283 *** ../vim-7.0.201/src/vim.h Tue Jan 16 21:31:38 2007
284 --- src/vim.h Tue Feb 20 05:23:47 2007
291 + /* user ID of root is usually zero, but not for everybody */
293 + # define _TANDEM_SOURCE
294 + # include <floss.h>
295 + # define ROOT_UID 65535
297 + # define ROOT_UID 0
300 #ifdef __EMX__ /* hand-edited config.h for OS/2 with EMX */
301 # include "os_os2_cfg.h"
303 *** ../vim-7.0.201/src/version.c Tue Feb 20 04:46:32 2007
304 --- src/version.c Tue Feb 27 16:44:14 2007
308 { /* Add new patch number below this line */
314 hundred-and-one symptoms of being an internet addict:
315 214. Your MCI "Circle of Friends" are all Hayes-compatible.
317 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
318 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
319 \\\ download, build and distribute -- http://www.A-A-P.org ///
320 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///