1 /* Copyright (c) 2008, 2009
2 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
3 * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
4 * Micah Cowan (micah@cowan.name)
5 * Sadrul Habib Chowdhury (sadrul@users.sourceforge.net)
6 * Copyright (c) 1993-2002, 2003, 2005, 2006, 2007
7 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
8 * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
9 * Copyright (c) 1987 Oliver Laumann
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3, or (at your option)
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program (see the file COPYING); if not, see
23 * https://www.gnu.org/licenses/, or contact Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26 ****************************************************************
34 #include <sys/param.h>
46 #if defined(HAVE_SETRESUID) && !defined(HAVE_SETREUID)
47 # define setreuid(ruid, euid) setresuid(ruid, euid, -1)
48 # define setregid(rgid, egid) setresgid(rgid, egid, -1)
56 # include <netinet/in.h>
57 # include <arpa/inet.h>
60 /*****************************************************************
72 # ifdef _POSIX_VDISABLE
73 # define VDISABLE _POSIX_VDISABLE
75 # define VDISABLE 0377
76 # endif /* _POSIX_VDISABLE */
77 #endif /* !VDISABLE */
79 /*****************************************************************
83 #if defined(ENABLE_UTMP)
86 typedef char* slot_t
; /* used internally in utmp.c */
90 # define UTMPXFILE UTMPX_FILE
93 # define UTMPXFILE _PATH_UTMPX
95 # define UTMPXFILE "/etc/utmpx"
96 # endif /* _PATH_UTMPX */
100 #endif /* ENABLE_UTMP */
102 /*****************************************************************
106 /* apparently NSIG is not part of standard, but it's present some form in most
107 * libc headers, if not define sane default
117 /*****************************************************************
122 * SunOS 4.1.3: `man 2V open' has only one line that mentions O_NOBLOCK:
124 * O_NONBLOCK Same as O_NDELAY above.
126 * on the very same SunOS 4.1.3, I traced the open system call and found
127 * that an open("/dev/ttyy08", O_RDWR|O_NONBLOCK|O_NOCTTY) was blocked,
128 * whereas open("/dev/ttyy08", O_RDWR|O_NDELAY |O_NOCTTY) went through.
130 * For this simple reason I now favour O_NDELAY. jw. 4.5.95
132 #if !defined(O_NONBLOCK) && defined(O_NDELAY)
133 # define O_NONBLOCK O_NDELAY
136 #if !defined(FNBLOCK) && defined(FNONBLOCK)
137 # define FNBLOCK FNONBLOCK
139 #if !defined(FNBLOCK) && defined(FNDELAY)
140 # define FNBLOCK FNDELAY
142 #if !defined(FNBLOCK) && defined(O_NONBLOCK)
143 # define FNBLOCK O_NONBLOCK
146 /*****************************************************************
147 * user defineable stuff
150 #ifndef TERMCAP_BUFSIZE
151 # define TERMCAP_BUFSIZE 1023
155 * you may try to vary this value. Use low values if your (VMS) system
156 * tends to choke when pasting. Use high values if you want to test
157 * how many characters your pty's can buffer.
161 /* Changing those you won't be able to attach to your old sessions
162 * when changing those values in official tree don't forget to bump
164 #define MAXTERMLEN 32
165 #define MAXLOGINLEN 256