]> git.saurik.com Git - apple/libutil.git/blame - tzlink.h
libutil-47.30.1.tar.gz
[apple/libutil.git] / tzlink.h
CommitLineData
5510e443
A
1/*
2 * Copyright (c) 2013 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _TZLINK_H_
25#define _TZLINK_H_
26
27/*!
28 * @function tzlink
29 * Create the timezone link at TZDEFAULT
30 *
31 * @param tz
32 * New timezone, e.g. "America/Los_Angeles". This path is relative to TZDIR,
33 * and must not contain any relative path components or stray slashes.
34 * The file must exist and must be a valid timezone file with correct
35 * ownership (root:wheel) and permissions (0644).
36 *
37 * @result
38 * If the call succeeds, will return zero. Otherwise, returns an error:
39 * EINVAL: Invalid input, e.g. NULL or a path with relative components.
40 * ENAMETOOLONG: Input too long (generates a path > PATH_MAX)
41 * ENOENT: Specified file doesn't exist or fails owner/perm check.
42 * EPERM: Entitlement check failed.
43 * EIO: Failed to communicate with backing daemon.
44 * ENOTSUP: Always returned on OS X.
45 * And possibly others not documented here.
46 *
47 * @discussion
48 * This call can be used by any sufficiently-entitled client to overwrite
49 * the timezone link at TZDEFAULT (see <tzfile.h>). It communicates with a
50 * root daemon that does the necessary validation and file system work.
51 * Upon success, the "SignificantTimeChangeNotification" notification is
52 * posted.
53 */
54errno_t tzlink(const char *tz);
55
56#endif /* !_TZLINK_H_ */