*** ./tc.who.c.ORIG Wed Jan 30 15:56:05 2013 --- ./tc.who.c Wed Jan 30 16:03:05 2013 *************** *** 54,59 **** --- 54,62 ---- * UTMPX counterparts, so they can be added all here when needed. * Kimmo Suominen, Oct 14 1991 */ + # ifdef _AIX + # define TCSH_PATH_UTMP "/etc/utmp" + # endif # if defined(__UTMPX_FILE) && !defined(UTMPX_FILE) # define TCSH_PATH_UTMP __UTMPX_FILE # elif defined(_PATH_UTMPX) *** ./tc.os.h.ORIG Mon Feb 18 20:25:04 2013 --- ./tc.os.h Mon Feb 18 20:37:40 2013 *************** *** 42,47 **** --- 42,64 ---- # define BACKPIPE #endif /* notdef */ + /* This is from Linux /usr/include/sys/param.h: + + The following are not really correct but it is a value we used for a + long time and which seems to be usable. People should not use NOFILE + and NCARGS anyway. + Linux defines NOFILE as 256. + + I want to force the same or better behavior on AIX. + Otherwise NOFILE will be defined as "OPEN_MAX" and this will be depending + on the AIX version either be 32767 and 65535 and will lead to that many + "EBADF" ("bad file descriptor") errors and thus will only slow down the + startup of tcsh. + In order to reduce the number of EBADF errors this will be defined as 32. */ + #ifdef _AIX + # define NOFILE 32 + #endif + #ifdef __CYGWIN__ # undef NOFILE # define NOFILE sysconf(_SC_OPEN_MAX)