1getzoneid(3C) Standard C Library Functions getzoneid(3C)
2
3
4
6 getzoneid, getzoneidbyname, getzonenamebyid - map between zone id and
7 name
8
10 #include <zone.h>
11
12 zoneid_t getzoneid(void);
13
14
15 zoneid_t getzoneidbyname(const char *name);
16
17
18 ssize_t getzonenamebyid(zoneid_t id, char *buf, size_t buflen);
19
20
22 The getzoneid() function returns the zone ID of the calling process.
23
24
25 The getzoneidbyname() function returns the zone ID corresponding to the
26 named zone, if that zone is currently active. If name is NULL, the
27 function returns the zone ID of the calling process.
28
29
30 The getzonenamebyid() function stores the name of the zone with ID
31 specified by id in the location specified by buf. The bufsize argument
32 specifies the size in bytes of the buffer. If the buffer is too small
33 to hold the complete null-terminated name, the first bufsize bytes of
34 the name are stored in the buffer. A buffer of size {ZONENAME_MAX} is
35 sufficient to hold any zone name. If buf is NULL or bufsize is 0, the
36 name is not copied into the buffer.
37
39 On successful completion, getzoneid() and getzoneidbyname() return a
40 non-negative zone ID. Otherwise, getzoneidbyname() returns −1 and sets
41 errno to indicate the error.
42
43
44 On successful completion, the getzonenamebyid() function returns the
45 buffer size required to hold the full null-terminated name. Otherwise,
46 it returns −1 and sets errno to indicate the error.
47
49 The getzoneidbyname() function will fail if:
50
51 EFAULT The name argument is non-null and points to an illegal
52 address.
53
54
55 EINVAL A zone with the indicated name is not active.
56
57
58 ENAMETOOLONG The length of the name argument exceeds {ZONENAME_MAX}.
59
60
61
62 The getzonenamebyid() function will fail if:
63
64 EINVAL A zone with the specified ID is not active.
65
66
67 EFAULT The buf argument points to an illegal address.
68
69
71 See attributes(5) for descriptions of the following attributes:
72
73
74
75
76 ┌─────────────────────────────┬─────────────────────────────┐
77 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
78 ├─────────────────────────────┼─────────────────────────────┤
79 │Interface Stability │Evolving │
80 ├─────────────────────────────┼─────────────────────────────┤
81 │MT-Level │Safe │
82 └─────────────────────────────┴─────────────────────────────┘
83
85 Intro(2), chroot(2), malloc(3C), attributes(5), zones(5)
86
87
88
89SunOS 5.11 1 Nov 2004 getzoneid(3C)