2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #ifndef _NSCTL_H
27 #define _NSCTL_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #include <sys/nsctl/nsctl.h>
34
35
36 /*
37 * External file descriptor.
38 */
39
40 #ifndef _LIBNSCTL_H
41 #ifndef _KMEMUSER
46
47 /*
48 * Runtime Solaris release checking.
49 *
50 * nsc_check_release() is called with the string build release
51 * (BUILD_REV_STR) and an optional array of nsc_release_t. The array
52 * defines a map of build release to acceptable runtime release for the
53 * component. The build release is always an acceptable runtime
54 * release and need not be included in the map.
55 *
56 * build - the build release (e.g. "5.7")
57 * runtime - comma &/or space separated list of acceptable runtime
58 * releases (e.g. "5.7, 5.8")
59 */
60
61 typedef struct nsc_release {
62 const char *build; /* build release */
63 const char *runtime; /* runtime release(s) */
64 } nsc_release_t;
65
66 #ifdef __STDC__
67 extern void _nsc_nocheck(void);
68 extern nsc_fd_t *nsc_open(char *, int, int);
69 extern nsc_fd_t *nsc_fdopen(int, char *, int);
70 extern int nsc_close(nsc_fd_t *);
71 extern int nsc_fileno(nsc_fd_t *);
72 extern int nsc_reserve(nsc_fd_t *);
73 extern int nsc_release(nsc_fd_t *);
74 extern int nsc_partsize(nsc_fd_t *, nsc_size_t *);
75 extern int nsc_freeze(char *path);
76 extern int nsc_unfreeze(char *path);
77 extern int nsc_isfrozen(char *path);
78 extern int nsc_getsystemid(int *id);
79 extern int nsc_name_to_id(char *name, int *id);
80 extern int nsc_id_to_name(char **name, int id);
81 extern int nsc_check_release(const char *, nsc_release_t *, char **);
82 #else
83 extern void _nsc_nocheck();
84 extern nsc_fd_t *nsc_open();
85 extern nsc_fd_t *nsc_fdopen();
86 extern int nsc_close();
87 extern int nsc_fileno();
88 extern int nsc_reserve();
89 extern int nsc_release();
90 extern int nsc_partsize();
91 extern int nsc_freeze();
92 extern int nsc_unfreeze();
93 extern int nsc_isfrozen();
94 extern int nsc_getsystemid();
95 extern int nsc_name_to_id();
96 extern int nsc_id_to_name();
97 extern int nsc_check_release();
98 #endif
99
100 #ifdef __cplusplus
101 }
102 #endif
103
104 #endif /* _NSCTL_H */
|
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
23 *
24 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
26 */
27
28 #ifndef _NSCTL_H
29 #define _NSCTL_H
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #include <sys/nsctl/nsctl.h>
36
37
38 /*
39 * External file descriptor.
40 */
41
42 #ifndef _LIBNSCTL_H
43 #ifndef _KMEMUSER
48
49 /*
50 * Runtime Solaris release checking.
51 *
52 * nsc_check_release() is called with the string build release
53 * (BUILD_REV_STR) and an optional array of nsc_release_t. The array
54 * defines a map of build release to acceptable runtime release for the
55 * component. The build release is always an acceptable runtime
56 * release and need not be included in the map.
57 *
58 * build - the build release (e.g. "5.7")
59 * runtime - comma &/or space separated list of acceptable runtime
60 * releases (e.g. "5.7, 5.8")
61 */
62
63 typedef struct nsc_release {
64 const char *build; /* build release */
65 const char *runtime; /* runtime release(s) */
66 } nsc_release_t;
67
68 extern void _nsc_nocheck(void);
69 extern nsc_fd_t *nsc_open(char *, int, int);
70 extern nsc_fd_t *nsc_fdopen(int, char *, int);
71 extern int nsc_close(nsc_fd_t *);
72 extern int nsc_fileno(nsc_fd_t *);
73 extern int nsc_reserve(nsc_fd_t *);
74 extern int nsc_release(nsc_fd_t *);
75 extern int nsc_partsize(nsc_fd_t *, nsc_size_t *);
76 extern int nsc_freeze(char *path);
77 extern int nsc_unfreeze(char *path);
78 extern int nsc_isfrozen(char *path);
79 extern int nsc_getsystemid(int *id);
80 extern int nsc_name_to_id(char *name, int *id);
81 extern int nsc_id_to_name(char **name, int id);
82 extern int nsc_check_release(const char *, nsc_release_t *, char **);
83
84 #ifdef __cplusplus
85 }
86 #endif
87
88 #endif /* _NSCTL_H */
|