]>
Commit | Line | Data |
---|---|---|
0fff78ff | 1 | /* $Id$ */ |
2 | ||
3c0ef626 | 3 | /* |
cdd66111 | 4 | * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> |
3c0ef626 | 5 | * |
cdd66111 | 6 | * Permission to use, copy, modify, and distribute this software for any |
7 | * purpose with or without fee is hereby granted, provided that the above | |
8 | * copyright notice and this permission notice appear in all copies. | |
3c0ef626 | 9 | * |
cdd66111 | 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
3c0ef626 | 17 | */ |
18 | ||
3c0ef626 | 19 | #ifndef _BSD_MISC_H |
20 | #define _BSD_MISC_H | |
21 | ||
0fff78ff | 22 | #include "includes.h" |
3c0ef626 | 23 | |
0fff78ff | 24 | char *ssh_get_progname(char *); |
3c0ef626 | 25 | |
26 | #ifndef HAVE_SETSID | |
27 | #define setsid() setpgrp(0, getpid()) | |
28 | #endif /* !HAVE_SETSID */ | |
29 | ||
30 | #ifndef HAVE_SETENV | |
0fff78ff | 31 | int setenv(const char *, const char *, int); |
3c0ef626 | 32 | #endif /* !HAVE_SETENV */ |
33 | ||
34 | #ifndef HAVE_SETLOGIN | |
0fff78ff | 35 | int setlogin(const char *); |
3c0ef626 | 36 | #endif /* !HAVE_SETLOGIN */ |
37 | ||
38 | #ifndef HAVE_INNETGR | |
0fff78ff | 39 | int innetgr(const char *, const char *, const char *, const char *); |
3c0ef626 | 40 | #endif /* HAVE_INNETGR */ |
41 | ||
42 | #if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) | |
0fff78ff | 43 | int seteuid(uid_t); |
3c0ef626 | 44 | #endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */ |
45 | ||
46 | #if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) | |
0fff78ff | 47 | int setegid(uid_t); |
3c0ef626 | 48 | #endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */ |
49 | ||
50 | #if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR) | |
0fff78ff | 51 | const char *strerror(int); |
3c0ef626 | 52 | #endif |
53 | ||
54 | ||
55 | #ifndef HAVE_UTIMES | |
56 | #ifndef HAVE_STRUCT_TIMEVAL | |
57 | struct timeval { | |
58 | long tv_sec; | |
59 | long tv_usec; | |
60 | } | |
61 | #endif /* HAVE_STRUCT_TIMEVAL */ | |
62 | ||
0fff78ff | 63 | int utimes(char *, struct timeval *); |
3c0ef626 | 64 | #endif /* HAVE_UTIMES */ |
65 | ||
700318f3 | 66 | #ifndef HAVE_TRUNCATE |
0fff78ff | 67 | int truncate (const char *, off_t); |
700318f3 | 68 | #endif /* HAVE_TRUNCATE */ |
3c0ef626 | 69 | |
f5799ae1 | 70 | #if !defined(HAVE_SETGROUPS) && defined(SETGROUPS_NOOP) |
0fff78ff | 71 | int setgroups(size_t, const gid_t *); |
f5799ae1 | 72 | #endif |
73 | ||
6a9b3198 | 74 | #if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP) |
75 | #ifndef HAVE_STRUCT_TIMESPEC | |
76 | struct timespec { | |
77 | time_t tv_sec; | |
78 | long tv_nsec; | |
79 | }; | |
80 | #endif | |
0fff78ff | 81 | int nanosleep(const struct timespec *, struct timespec *); |
82 | #endif | |
83 | ||
84 | #ifndef HAVE_TCGETPGRP | |
85 | pid_t tcgetpgrp(int); | |
86 | #endif | |
87 | ||
88 | #ifndef HAVE_TCSENDBREAK | |
89 | int tcsendbreak(int, int); | |
6a9b3198 | 90 | #endif |
f5799ae1 | 91 | |
0fff78ff | 92 | /* wrapper for signal interface */ |
93 | typedef void (*mysig_t)(int); | |
94 | mysig_t mysignal(int sig, mysig_t act); | |
95 | ||
96 | #define signal(a,b) mysignal(a,b) | |
97 | ||
3c0ef626 | 98 | #endif /* _BSD_MISC_H */ |