1135446Strhodes/*
2224092Sdougb * Copyright (C) 2004, 2005, 2007-2009  Internet Systems Consortium, Inc. ("ISC")
3135446Strhodes * Copyright (C) 1999-2002  Internet Software Consortium.
4135446Strhodes *
5186462Sdougb * Permission to use, copy, modify, and/or distribute this software for any
6135446Strhodes * purpose with or without fee is hereby granted, provided that the above
7135446Strhodes * copyright notice and this permission notice appear in all copies.
8135446Strhodes *
9135446Strhodes * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10135446Strhodes * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11135446Strhodes * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12135446Strhodes * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13135446Strhodes * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14135446Strhodes * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15135446Strhodes * PERFORMANCE OF THIS SOFTWARE.
16135446Strhodes */
17135446Strhodes
18234010Sdougb/* $Id: os.h,v 1.31 2009/08/05 23:47:43 tbox Exp $ */
19135446Strhodes
20135446Strhodes#ifndef NS_OS_H
21135446Strhodes#define NS_OS_H 1
22135446Strhodes
23170222Sdougb/*! \file */
24170222Sdougb
25135446Strhodes#include <isc/types.h>
26135446Strhodes
27135446Strhodesvoid
28135446Strhodesns_os_init(const char *progname);
29135446Strhodes
30135446Strhodesvoid
31135446Strhodesns_os_daemonize(void);
32135446Strhodes
33135446Strhodesvoid
34135446Strhodesns_os_opendevnull(void);
35135446Strhodes
36135446Strhodesvoid
37135446Strhodesns_os_closedevnull(void);
38135446Strhodes
39135446Strhodesvoid
40135446Strhodesns_os_chroot(const char *root);
41135446Strhodes
42135446Strhodesvoid
43135446Strhodesns_os_inituserinfo(const char *username);
44135446Strhodes
45135446Strhodesvoid
46135446Strhodesns_os_changeuser(void);
47135446Strhodes
48135446Strhodesvoid
49186462Sdougbns_os_adjustnofile(void);
50186462Sdougb
51186462Sdougbvoid
52135446Strhodesns_os_minprivs(void);
53135446Strhodes
54224092SdougbFILE *
55224092Sdougbns_os_openfile(const char *filename, mode_t mode, isc_boolean_t switch_user);
56224092Sdougb
57135446Strhodesvoid
58135446Strhodesns_os_writepidfile(const char *filename, isc_boolean_t first_time);
59224092Sdougb
60135446Strhodesvoid
61135446Strhodesns_os_shutdown(void);
62135446Strhodes
63135446Strhodesisc_result_t
64135446Strhodesns_os_gethostname(char *buf, size_t len);
65135446Strhodes
66135446Strhodesvoid
67135446Strhodesns_os_shutdownmsg(char *command, isc_buffer_t *text);
68135446Strhodes
69135446Strhodesvoid
70135446Strhodesns_os_tzset(void);
71135446Strhodes
72143731Sdougbvoid
73143731Sdougbns_os_started(void);
74143731Sdougb
75135446Strhodes#endif /* NS_OS_H */
76