Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 1 | /* |
| 2 | ** |
Damien Miller | 753331e | 1999-12-30 01:29:35 +1100 | [diff] [blame] | 3 | ** OpenBSD replacement routines |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 4 | ** |
| 5 | ** Damien Miller <djm@ibs.com.au> |
| 6 | ** |
Damien Miller | f20c2aa | 2000-01-06 20:28:41 +1100 | [diff] [blame] | 7 | ** Copyright 1999 Damien Miller |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 8 | ** Copyright 1999 Internet Business Solutions |
| 9 | ** |
| 10 | ** Permission is hereby granted, free of charge, to any person |
| 11 | ** obtaining a copy of this software and associated documentation |
| 12 | ** files (the "Software"), to deal in the Software without |
| 13 | ** restriction, including without limitation the rights to use, copy, |
| 14 | ** modify, merge, publish, distribute, sublicense, and/or sell copies |
| 15 | ** of the Software, and to permit persons to whom the Software is |
| 16 | ** furnished to do so, subject to the following conditions: |
| 17 | ** |
| 18 | ** The above copyright notice and this permission notice shall be |
| 19 | ** included in all copies or substantial portions of the Software. |
| 20 | ** |
| 21 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY |
| 22 | ** KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
| 23 | ** WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE |
| 24 | ** AND NONINFRINGEMENT. IN NO EVENT SHALL DAMIEN MILLER OR INTERNET |
| 25 | ** BUSINESS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 26 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 27 | ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE |
| 28 | ** OR OTHER DEALINGS IN THE SOFTWARE. |
| 29 | ** |
| 30 | ** Except as contained in this notice, the name of Internet Business |
| 31 | ** Solutions shall not be used in advertising or otherwise to promote |
| 32 | ** the sale, use or other dealings in this Software without prior |
| 33 | ** written authorization from Internet Business Solutions. |
| 34 | ** |
| 35 | */ |
| 36 | |
Damien Miller | 753331e | 1999-12-30 01:29:35 +1100 | [diff] [blame] | 37 | #ifndef _BSD_MISC_H |
| 38 | #define _BSD_MISC_H |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 39 | |
Damien Miller | e413cba | 1999-10-28 14:12:54 +1000 | [diff] [blame] | 40 | #include "config.h" |
| 41 | |
| 42 | #ifndef HAVE_ARC4RANDOM |
Damien Miller | 3d112ef | 1999-10-28 13:20:30 +1000 | [diff] [blame] | 43 | unsigned int arc4random(void); |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 44 | void arc4random_stir(void); |
Damien Miller | e413cba | 1999-10-28 14:12:54 +1000 | [diff] [blame] | 45 | #endif /* !HAVE_ARC4RANDOM */ |
| 46 | |
| 47 | #ifndef HAVE_SETPROCTITLE |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 48 | void setproctitle(const char *fmt, ...); |
Damien Miller | e413cba | 1999-10-28 14:12:54 +1000 | [diff] [blame] | 49 | #endif /* !HAVE_SETPROCTITLE */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 50 | |
Damien Miller | d770252 | 1999-11-22 16:11:05 +1100 | [diff] [blame] | 51 | #ifndef HAVE_SETENV |
| 52 | int setenv(const char *name, const char *value, int overwrite); |
| 53 | #endif /* !HAVE_SETENV */ |
| 54 | |
Damien Miller | e72b7af | 1999-12-30 15:08:44 +1100 | [diff] [blame] | 55 | #ifndef HAVE_SETLOGIN |
| 56 | int setlogin(const char *name); |
| 57 | #endif /* !HAVE_SETLOGIN */ |
| 58 | |
| 59 | #ifndef HAVE_INNETGR |
| 60 | int innetgr(const char *netgroup, const char *host, |
| 61 | const char *user, const char *domain); |
| 62 | #endif /* HAVE_INNETGR */ |
| 63 | |
| 64 | #if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) |
| 65 | int seteuid(uid_t euid); |
| 66 | #endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */ |
| 67 | |
Damien Miller | 753331e | 1999-12-30 01:29:35 +1100 | [diff] [blame] | 68 | #endif /* _BSD_MISC_H */ |