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 *);
23 int seed_from_prngd(unsigned char *, size_t);
26 #define setsid() setpgrp(0, getpid())
27 #endif /* !HAVE_SETSID */
30 int setenv(const char *, const char *, int);
31 #endif /* !HAVE_SETENV */
34 int setlogin(const char *);
35 #endif /* !HAVE_SETLOGIN */
38 int innetgr(const char *, const char *, const char *, const char *);
39 #endif /* HAVE_INNETGR */
41 #if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID)
43 #endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */
45 #if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID)
47 #endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */
49 #if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR)
50 const char *strerror(int);
53 #if !defined(HAVE_SETLINEBUF)
54 #define setlinebuf(a) (setvbuf((a), NULL, _IOLBF, 0))
58 #ifndef HAVE_STRUCT_TIMEVAL
63 #endif /* HAVE_STRUCT_TIMEVAL */
65 int utimes(const char *, struct timeval *);
66 #endif /* HAVE_UTIMES */
69 # define AT_FDCWD (-2)
73 int fchmodat(int, const char *, mode_t, int);
77 int fchownat(int, const char *, uid_t, gid_t, int);
81 int truncate (const char *, off_t);
82 #endif /* HAVE_TRUNCATE */
84 #ifndef HAVE_STRUCT_TIMESPEC
89 #endif /* !HAVE_STRUCT_TIMESPEC */
91 #if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP)
93 int nanosleep(const struct timespec *, struct timespec *);
96 #ifndef HAVE_UTIMENSAT
98 /* start with the high bits and work down to minimise risk of overlap */
99 # ifndef AT_SYMLINK_NOFOLLOW
100 # define AT_SYMLINK_NOFOLLOW 0x80000000
102 int utimensat(int, const char *, const struct timespec[2], int);
103 #endif /* !HAVE_UTIMENSAT */
106 int usleep(unsigned int useconds);
109 #ifndef HAVE_TCGETPGRP
110 pid_t tcgetpgrp(int);
113 #ifndef HAVE_TCSENDBREAK
114 int tcsendbreak(int, int);
117 #ifndef HAVE_UNSETENV
118 int unsetenv(const char *);
126 pid_t getpgid(pid_t);
130 int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *,
134 #ifndef HAVE_ENDGRENT
135 # define endgrent() do { } while(0)
138 #ifndef HAVE_KRB5_GET_ERROR_MESSAGE
139 # define krb5_get_error_message krb5_get_err_text
142 #ifndef HAVE_KRB5_FREE_ERROR_MESSAGE
143 # define krb5_free_error_message(a,b) do { } while(0)
147 int pledge(const char *promises, const char *paths[]);
152 void err(int, const char *, ...) __attribute__((format(printf, 2, 3)));
155 void errx(int, const char *, ...) __attribute__((format(printf, 2, 3)));
158 void warn(const char *, ...) __attribute__((format(printf, 1, 2)));
162 long long llabs(long long);
165 #if defined(HAVE_DECL_BZERO) && HAVE_DECL_BZERO == 0
166 void bzero(void *, size_t);
178 # define LOCK_SH 0x01
179 # define LOCK_EX 0x02
180 # define LOCK_NB 0x04
181 # define LOCK_UN 0x08
185 #ifdef FFLUSH_NULL_BUG
186 # define fflush(x) (_ssh_compat_fflush(x))
189 #ifndef HAVE_LOCALTIME_R
190 struct tm *localtime_r(const time_t *, struct tm *);
193 #ifndef HAVE_REALPATH
194 #define realpath(x, y) (sftp_realpath((x), (y)))
197 #endif /* _BSD_MISC_H */