[2.2.0p1] patch: generic detection of correct getpgrp() invocation

Charles Levert charles at comm.polymtl.ca
Fri Sep 8 03:35:08 EST 2000


I have revised the whole content of next-posix.[ch] to see what could
apply to SunOS 4.1.4.  The only relevant item is highlighted with "==>".


next-posix.h

	-- readdir does return struct dirent * in <dirent.h>
	and it has the d_ino (through a #define) and d_name fields
	needed by scp.c

	-- struct utimbuf seems ok in <utime.h>

	-- O_NONBLOCK is defined by <fcntl.h> (and does not have the
	same value as on NeXT)

	-- WIFEXITED, WIFSTOPPED, WIFSIGNALED, WEXITSTATUS, and
	WTERMSIG are all defined in <sys/wait.h>

==>	-- WCOREFLAG and WCOREDUMP are not defined anywhere on SunOS
	and could use the exact same definitions as for NeXT (I
	believe, according to the wait(2) manpage)

	-- utime is declared in <utime.h>

	-- wait and waitpid are declared in <sys/wait.h>

	-- setsid is declared in <unistd.h>

	-- tc[gs]etattr, cf[gs]etospeed, and cf[gs]etispeed are
	declared in <termios.h>

	-- tcsetpgrp is declared in <unistd.h> but not used in openssh

next-posix.c

	-- wait is available

	-- utime is available

	-- waitpid is available

	-- setsid is available

	-- tc[gs]etattr, cf[gs]etospeed, and cf[gs]etispeed are
	available

	-- tcsetpgrp is available but not used in openssh


For WCOREFLAG and WCOREDUMP, would a simple pair of
#ifndef/#define/#endif in defines.h suffice and be appropriate for
all OSes:  those that don't define these natively and for those
that do, assuming they are always #define's?  Is the 0x80 pretty
universal in those that don't?

It is worth mentioning that the combination of SunOS 4.1.4 and gcc
2.7.2.2 produces a conflict between definitions that SunOS puts in
<sys/ioctl.h> and that gcc puts in its <termios.h> (which are derived
from the SunOS <termios.h> ones anyway, so forget the gcc part of the
comment, really).  Those definitions are for BS0, BS1, CR0, CR1, CR2,
CR3, ECHO, FF0, FF1, FLUSHO, NL0, NL1, NOFLSH, PENDIN, TAB0, TAB1,
TAB2, TOSTOP, and XTABS.  They are incompatible, but I believe that as
long as <sys/ioctl.h> is included before <termios.h> (see includes.h),
the ones in <termios.h> have the final say and this is the right thing
(I think).

These are used in clientloop.c, readpass.c, and ttymodes.[ch].  The
ideal would be probably be to have that specific code isolated to only
see the <termios.h> definitions.  Right now, this produces at *lot*
of warnings in the make output, but they are harmless (again, I think).



Charles





More information about the openssh-unix-dev mailing list