2 * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 char *ssh_get_progname(char *);
25 #define setsid() setpgrp(0, getpid())
26 #endif /* !HAVE_SETSID */
29 int setenv(const char *, const char *, int);
30 #endif /* !HAVE_SETENV */
33 int setlogin(const char *);
34 #endif /* !HAVE_SETLOGIN */
37 int innetgr(const char *, const char *, const char *, const char *);
38 #endif /* HAVE_INNETGR */
40 #if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID)
42 #endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */
44 #if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID)
46 #endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */
48 #if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR)
49 const char *strerror(int);
52 #if !defined(HAVE_SETLINEBUF)
53 #define setlinebuf(a) (setvbuf((a), NULL, _IOLBF, 0))
57 #ifndef HAVE_STRUCT_TIMEVAL
62 #endif /* HAVE_STRUCT_TIMEVAL */
64 int utimes(char *, struct timeval *);
65 #endif /* HAVE_UTIMES */
68 int truncate (const char *, off_t);
69 #endif /* HAVE_TRUNCATE */
71 #if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP)
72 #ifndef HAVE_STRUCT_TIMESPEC
78 int nanosleep(const struct timespec *, struct timespec *);
82 int usleep(unsigned int useconds);
85 #ifndef HAVE_TCGETPGRP
89 #ifndef HAVE_TCSENDBREAK
90 int tcsendbreak(int, int);
94 int unsetenv(const char *);
102 pid_t getpgid(pid_t);
105 #ifndef HAVE_ENDGRENT
106 # define endgrent() do { } while(0)
109 #ifndef HAVE_KRB5_GET_ERROR_MESSAGE
110 # define krb5_get_error_message krb5_get_err_text
113 #ifndef HAVE_KRB5_FREE_ERROR_MESSAGE
114 # define krb5_free_error_message(a,b) do { } while(0)
118 int pledge(const char *promises, const char *paths[]);
123 void err(int, const char *, ...) __attribute__((format(printf, 2, 3)));
126 void errx(int, const char *, ...) __attribute__((format(printf, 2, 3)));
129 void warn(const char *, ...) __attribute__((format(printf, 1, 2)));
133 long long llabs(long long);
136 #if defined(HAVE_DECL_BZERO) && HAVE_DECL_BZERO == 0
137 void bzero(void *, size_t);
149 # define LOCK_SH 0x01
150 # define LOCK_EX 0x02
151 # define LOCK_NB 0x04
152 # define LOCK_UN 0x08
156 #ifdef FFLUSH_NULL_BUG
157 # define fflush(x) (_ssh_compat_fflush(x))
160 #endif /* _BSD_MISC_H */