1 /*	$NetBSD: os.h,v 1.4 2014/12/10 04:37:52 christos Exp $	*/
2 
3 /*
4  * Copyright (C) 2004, 2005, 2007-2009  Internet Systems Consortium, Inc. ("ISC")
5  * Copyright (C) 1999-2002  Internet Software Consortium.
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /* Id: os.h,v 1.31 2009/08/05 23:47:43 tbox Exp  */
21 
22 #ifndef NS_OS_H
23 #define NS_OS_H 1
24 
25 /*! \file */
26 
27 #include <isc/types.h>
28 
29 void
30 ns_os_init(const char *progname);
31 
32 void
33 ns_os_daemonize(void);
34 
35 void
36 ns_os_opendevnull(void);
37 
38 void
39 ns_os_closedevnull(void);
40 
41 void
42 ns_os_chroot(const char *root);
43 
44 void
45 ns_os_inituserinfo(const char *username);
46 
47 void
48 ns_os_changeuser(void);
49 
50 void
51 ns_os_adjustnofile(void);
52 
53 void
54 ns_os_minprivs(void);
55 
56 FILE *
57 ns_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user);
58 
59 void
60 ns_os_writepidfile(const char *filename, isc_boolean_t first_time);
61 
62 void
63 ns_os_shutdown(void);
64 
65 isc_result_t
66 ns_os_gethostname(char *buf, size_t len);
67 
68 void
69 ns_os_shutdownmsg(char *command, isc_buffer_t *text);
70 
71 void
72 ns_os_tzset(void);
73 
74 void
75 ns_os_started(void);
76 
77 #endif /* NS_OS_H */
78