*** ./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)