Merge branch 'master' of git://github.com/illumos/illumos-gate
[unleashed.git] / usr / src / man / man5 / attributes.5
blobfcfe09fd1b7aca1333be35a6f35a00abccefad44
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH ATTRIBUTES 5 "Jul 29, 2007"
7 .SH NAME
8 attributes, architecture, availability, CSI, stability, MT-Level, standard \-
9 attributes of interfaces
10 .SH DESCRIPTION
11 .sp
12 .LP
13 The \fBATTRIBUTES\fR section of a manual page contains a table defining
14 attribute types and their corresponding values. The following is an example of
15 an attributes table. Not all attribute types are appropriate for all types of
16 interfaces.
17 .sp
19 .sp
20 .TS
21 box;
22 c | c
23 l | l .
24 ATTRIBUTE TYPE  ATTRIBUTE VALUE
26 Architecture    SPARC
28 CSI     Enabled
30 Interface Stability     Committed
32 MT-Level        Safe
34 Standard        See \fBstandards\fR(5).
35 .TE
37 .SS "Architecture"
38 .sp
39 .LP
40 Architecture defines processor or specific hardware. See \fB-p\fR option of
41 \fBuname\fR(1). In some cases, it may indicate required adapters or
42 peripherals.
43 .SS "Code Set Independence (CSI)"
44 .sp
45 .LP
46 \fBOS\fR utilities and libraries free of dependencies on the properties of any
47 code sets are said to have Code Set Independence (CSI). They have the attribute
48 of being \fBCSI\fR enabled. This is in contrast to many commands and utilities,
49 for example, that work only with Extended Unix Codesets (EUC), an encoding
50 method that allows concurrent support for up to four code sets and is commonly
51 used  to represent Asian character sets.
52 .sp
53 .LP
54 For practical reasons, however, this independence is not absolute. Certain
55 assumptions are still applied to the current \fBCSI\fR implementation:
56 .RS +4
57 .TP
58 .ie t \(bu
59 .el o
60 File code is a superset of \fBASCII\fR.
61 .RE
62 .RS +4
63 .TP
64 .ie t \(bu
65 .el o
66 To support multi-byte characters and null-terminated  \fBUNIX\fR file names,
67 the \fINULL\fR and \fB/\fR (slash) characters cannot be part of any multi-byte
68 characters.
69 .RE
70 .RS +4
71 .TP
72 .ie t \(bu
73 .el o
74 Only "stateless" file code encodings are supported. Stateless encoding avoids
75 shift, locking shift, designation, invocation, and so forth, although single
76 shift is not excluded.
77 .RE
78 .RS +4
79 .TP
80 .ie t \(bu
81 .el o
82 Process code (\fBwchar_t\fR values) is implementation dependent and can change
83 over time or between implementations or between locales.
84 .RE
85 .RS +4
86 .TP
87 .ie t \(bu
88 .el o
89 Not every object can have names composed of arbitrary characters. The names of
90 the following objects must be composed of \fBASCII\fR characters:
91 .RS +4
92 .TP
93 .ie t \(bu
94 .el o
95 User names, group name, and passwords
96 .RE
97 .RS +4
98 .TP
99 .ie t \(bu
100 .el o
101 System name
103 .RS +4
105 .ie t \(bu
106 .el o
107 Names of printers and special devices
109 .RS +4
111 .ie t \(bu
112 .el o
113 Names of terminals (/\fBdev/tty*\fR)
115 .RS +4
117 .ie t \(bu
118 .el o
119 Process \fBID\fR numbers
121 .RS +4
123 .ie t \(bu
124 .el o
125 Message queues, semaphores, and shared memory labels.
127 .RS +4
129 .ie t \(bu
130 .el o
131 The following may be composed of \fBISO\fR Latin-1 or \fBEUC\fR characters:
132 .RS +4
134 .ie t \(bu
135 .el o
136 File names
138 .RS +4
140 .ie t \(bu
141 .el o
142 Directory names
144 .RS +4
146 .ie t \(bu
147 .el o
148 Command names
150 .RS +4
152 .ie t \(bu
153 .el o
154 Shell variables and environmental variable names
156 .RS +4
158 .ie t \(bu
159 .el o
160 Mount points for file systems
162 .RS +4
164 .ie t \(bu
165 .el o
166 \fBNIS\fR key names and domain names
170 .RS +4
172 .ie t \(bu
173 .el o
174 The names of \fBNFS\fR shared files should be composed of \fBASCII\fR
175 characters. Although files and directories may have names and contents composed
176 of characters from non-\fBASCII\fR code sets, using only the \fBASCII\fR
177 codeset allows \fBNFS\fR mounting across any machine, regardless of
178 localization. For the commands and utilities that are \fBCSI\fR enabled, all
179 can handle single-byte and multi-byte locales released in 2.6. For applications
180 to get full support of internationalization services, dynamic binding has to be
181 applied. Statically bound programs will only get support for C and POSIX
182 locales.
184 .SS "Interface Stability"
187 Sun often provides developers with early access to new technologies, which
188 allows developers to evaluate with them as soon as possible. Unfortunately, new
189 technologies are prone to changes and standardization often results in
190 interface incompatibility from previous versions.
193 To make reasonable risk assessments, developers need to know how likely an
194 interface is to change in future releases. To aid developers in making these
195 assessments, interface stability information is included on some manual pages
196 for commands, entry-points, and file formats.
199 The more stable interfaces can safely be used by nearly all applications,
200 because Sun will endeavor to ensure that these continue to work in future minor
201 releases. Applications that depend only on Committed interfaces should reliably
202 continue to function correctly on future minor releases (but not necessarily on
203 earlier major releases).
206 The less stable interfaces allow experimentation and prototyping, but should be
207 used only with the understanding that they might change incompatibly or even be
208 dropped or replaced with alternatives in future minor releases.
211 "Interfaces" that Sun does not document (for example, most kernel data
212 structures and some symbols in system header files) may be implementation
213 artifacts. Such internal interfaces are not only subject to incompatible change
214 or removal, but we are unlikely to mention such a change in release notes.
215 .SS "Release Levels"
218 Products are given release levels, as well as names, to aid compatibility
219 discussions. Each release level may also include changes suitable for lower
220 levels.
225 c c c
226 l l l .
227 Release Version Significance
229 Major   x.0     T{
230 Likely to contain major feature additions; adhere to different,  possibly incompatible standard revisions; and though unlikely, could change, drop, or replace Committed interfaces. Initial product releases are usually 1.0.
233 Minor   x.y     T{
234 Compared to an x.0 or earlier release (y!=0), it is likely to contain: feature additions, compatible changes to Committed interfaces, or likely incompatible changes to Uncommitted or Volatile interfaces.
237 Micro   x.y.z   T{
238 Intended to be interface compatible with the previous release (z!=0), but likely to add bug fixes, performance enhancements, and support for additional hardware. Incompatible changes to Volatile interfaces are possible.
244 In the context of interface stability, update releases (occasionally referred
245 to as patch releases) should be considered equivalent to Micro Releases.
246 .SS "Classifications"
249 The following table summarizes how stability level  classifications relate to
250 release level. The first column lists the Stability Level. The second column
251 lists the Release Level for Incompatible Changes, and the third column lists
252 other comments. For a complete discussion of individual classifications, see
253 the appropriate subsection below.
258 c c c
259 l l l .
260 Stability       Release Comments
262 Committed       Major (x.0)     Incompatibilities are exceptional.
264 Uncommitted     Minor (x.y)     Incompatibilities are common.
266 Volatile        Micro (x.y.z)   Incompatibilities are common.
271 The interface stability level classifications described on this manual page
272 apply to both source and binary  interfaces unless otherwise stated. All
273 stability level classifications are public, with the exception of the
274 \fBPrivate\fR classification. The precise stability level of a public interface
275 (one that is documented in the manual pages) is unspecified unless explicitly
276 stated. The stability level of an undocumented interface is implicitly
277 \fBPrivate\fR.
280 The existence of documentation other than the documentation that is a component
281 of the Solaris product should not be construed to imply any level of stability
282 for interfaces provided by the Solaris product. The only source of stability
283 level information is Solaris manual pages.
285 .ne 2
287 \fB\fBCommitted\fR\fR
289 .sp .6
290 .RS 4n
291 The intention of a Committed interface is to enable third parties to develop
292 applications to these interfaces, release them, and have confidence that they
293 will run on all releases of the product after the one in which the interface
294 was introduced, and within the same Major release. Even at a Major release,
295 incompatible changes are expected to be rare, and to have strong
296 justifications.
298 Interfaces defined and controlled as industry standards are most often treated
299 as Committed interfaces. In this case, the controlling body and/or public,
300 versioned document is typically noted in a "Standard" entry in the Attributes
301 table or elsewhere in the documentation.
303 Although a truly exceptional event, incompatible changes are possible in any
304 release if the associated defect is serious enough as outlined in the
305 Exceptions section of this document or in a Minor release by following the End
306 of Feature process. If support of a Committed interface must be discontinued,
307 Sun will attempt to provide notification and the stability level will be marked
308 Obsolete.
312 .ne 2
314 \fB\fBUncommitted\fR\fR
316 .sp .6
317 .RS 4n
318 No commitment is made about either source or binary compatibility of these
319 interfaces from one Minor release to the next.  Even the drastic incompatible
320 change of removal of the interface in a Minor release is possible.  Uncommitted
321 interfaces are generally not appropriate for use by release-independent
322 products.
324 Incompatible changes to the interface are intended to be motivated by true
325 improvement to the interface which may include ease of use considerations.  The
326 general expectation should be that Uncommitted interfaces are not likely to
327 change incompatibly and if such changes occur they will be small in impact and
328 may often have a mitigation plan.
330 Uncommitted interfaces generally fall into one of the following subcategorizes:
331 .RS +4
334 Interfaces that are experimental or transitional. They are typically used to
335 give outside developers early access to new or rapidly changing technology, or
336 to provide an interim solution to a problem where a more general solution is
337 anticipated.
339 .RS +4
342 Interfaces whose specification is controlled by an outside body yet Sun
343 expects to make a reasonable effort to maintain compatibility with previous
344 releases until the next Minor release at which time Sun expects to synchronize
345 with the external specification.
347 .RS +4
350 Interfaces whose target audience values innovation (and possibly ease of
351 use) over stability.  This attribute is often associated with administrative
352 interfaces for higher tier components.
354 For Uncommitted interfaces, Sun makes no claims about either source or binary
355 compatibility from one minor release to another. Applications developed based
356 on these interfaces may not work in future minor releases.
360 .ne 2
362 \fB\fBVolatile\fR\fR
364 .sp .6
365 .RS 4n
366 Volatile interfaces can change at any time and for any reason.
368 The Volatile interface stability level allows Sun products to quickly track a
369 fluid, rapidly evolving specification. In many cases, this is preferred to
370 providing additional stability to the interface, as it may better meet the
371 expectations of the consumer.
373 The most common application of this taxonomy level is to interfaces that are
374 controlled by a body other than Sun, but unlike specifications controlled by
375 standards bodies or Free or Open Source Software (FOSS) communities which value
376 interface compatibility, it can not be asserted that an incompatible change to
377 the interface specification would be exceedingly rare. It may also be applied
378 to FOSS controlled software where it is deemed more important to track the
379 community with minimal latency than to provide stability to our customers.
381 It also common to apply the Volatile classification level to interfaces in the
382 process of being defined by trusted or widely accepted organization.  These are
383 generically referred to as draft standards.  An "IETF Internet draft" is a well
384 understood example of a specification under development.
386 Volatile can also be applied to experimental interfaces.
388 No assertion is made regarding either source or binary compatibility of
389 Volatile interfaces between any two releases, including patches. Applications
390 containing these interfaces might fail to function properly in any future
391 release.
395 .ne 2
397 \fB\fBNot-an-Interface\fR\fR
399 .sp .6
400 .RS 4n
401 The situation occasionally occurs where there exists an entity that could be
402 inferred to be an interface, but actually is not.  Common examples are output
403 from CLIs intended only for human consumption and the exact layout of a GUI.
405 This classification is a convenience term to be used to clarify such situations
406 where such confusion is identified as likely.  Failure to apply this term to an
407 entity is not an indication that the entity is some form of interface.  It only
408 indicates that the potential for confusion was not identified.
412 .ne 2
414 \fB\fBPrivate\fR\fR
416 .sp .6
417 .RS 4n
418 A Private interface is an interface provided by a component (or product)
419 intended only for the use of that component. A Private interface might still be
420 visible to or accessible by other components. Because the use of interfaces
421 private to another component carries great stability risks, such use is
422 explicitly not supported. Components not supplied by Sun Microsystems should
423 not use Private interfaces.
425 Most Private interfaces are not documented. It is an exceptional case when a
426 Private interface is documented. Reasons for documenting a Private interface
427 include, but are not limited to, the intention that the interface might be
428 reclassified to one of the public stability level classifications in the future
429 or the fact that the interface is inordinately visible.
433 .ne 2
435 \fB\fBObsolete\fR\fR
437 .sp .6
438 .RS 4n
439 Obsolete is a modifier that can appear in conjunction with the above
440 classification levels. The Obsolete modifier indicates an interface that is
441 "deprecated" and/or no longer advised for general use. An existing interface
442 may be downgraded from some other status (such as Committed or Uncommitted) by
443 the application of the Obsolete modifier to encourage customers to migrate from
444 that interface before it may be removed (or incompatibly changed).
446 An Obsolete interface is supported in the current release, but is scheduled to
447 be removed in a future (minor) release. When support of an interface is to be
448 discontinued, Sun will attempt to provide notification before discontinuing
449 support. Use of an Obsolete interface may produce warning messages.
452 .SS "Exceptions"
455 There are rare instances when it is in the best interest of both Sun and the
456 customer to break the interface stability commitment. The following list
457 contains the common, known reasons for the interface provider to violate an
458 interface stability commitment, but does not preclude others.
459 .RS +4
462 Security holes where the vulnerability is inherent in the interface.
464 .RS +4
467 Data corruption where the vulnerability is inherent in the interface.
469 .RS +4
472 Standards violations uncovered by a change in interpretation or enhancement
473 of conformance tests.
475 .RS +4
478 An interface specification which isn't controlled by Sun has been changed
479 incompatibly and the vast majority of interface consumers expect the newer
480 interface.
482 .RS +4
485 Not making the incompatible change would be incomprehensible to our
486 customers.  One example of this would to have not incompatibly changed pcfs
487 when the DOS 8.3 naming restrictions were abandoned.
491 Incompatible changes allowed by exception will always be delivered in the "most
492 major" release vehicle possible.  However, often the consequences of the
493 vulnerabilities or contractual branding requirements will force delivery in a
494 patch.
495 .SS "Compatibility with Earlier Interface Classification Schemes"
498 In releases up to and including Solaris 10, a different interface
499 classification scheme was used. The following table summarizes the mapping
500 between the old and new classification schemes.
505 c c c
506 l l l .
507 Old     New     Comments
509 Standard        Committed       T{
510 An entry in the attributes table for the Standard attribute type should appear.
512 Stable  Committed       Name change.
513 Evolving        Uncommitted     Actual commitments match.
514 Unstable        Uncommitted     Name change.
515 External        Volatile        T{
516 Name change with expansion of allowed usage.
518 Obsolete        (Obsolete)      Was a classification, now a modifier.
523 The increased importance of Free or Open Source Software motivated the name
524 change from Stable/Unstable to Committed/Uncommitted. Stable conflicted with
525 the common use of the term in FOSS communities.
528 Ambiguity in the definition of Evolving was causing difficulty in
529 interpretation. As part of the migration to the new classification scheme, many
530 formerly Evolving interfaces were upgraded to Committed. However, upon
531 encountering the term Evolving, Uncommitted should be inferred.
532 .SS "MT-Level"
535 Libraries are classified into categories that define their ability to support
536 multiple threads. Manual pages containing functions that are of multiple or
537 differing levels describe this in their \fBNOTES\fR or \fBUSAGE\fR section.
539 .ne 2
541 \fB\fBSafe\fR\fR
543 .sp .6
544 .RS 4n
545 Safe is an attribute of code that can be called from a multithreaded
546 application. The effect of calling into a Safe interface or a safe code segment
547 is that the results are valid even when called by multiple threads. Often
548 overlooked is the fact that the result of this Safe interface or safe code
549 segment can have global consequences that affect all threads. For example, the
550 action of opening or closing a file from one thread is visible by all the
551 threads within a process. A multithreaded application has the responsibility
552 for using these interfaces in a safe manner, which is different from whether or
553 not the interface is Safe. For example, a multithreaded application that closes
554 a file that is still in use by other threads within the application is not
555 using the \fBclose\fR(2) interface safely.
559 .ne 2
561 \fB\fBUnsafe\fR\fR
563 .sp .6
564 .RS 4n
565 An Unsafe library contains global and static data that is not protected. It is
566 not safe to use unless the application arranges for only one thread at time to
567 execute within the library. Unsafe libraries might contain functions that are
568 Safe; however, most of the library's functions are unsafe to call. Some
569 functions that are Unsafe have reentrant counterparts that are MT-Safe.
570 Reentrant functions are designated by the \fB_r\fR suffix appended to the
571 function name.
575 .ne 2
577 \fB\fBMT-Safe\fR\fR
579 .sp .6
580 .RS 4n
581 An MT-Safe library is fully prepared for multithreaded access. It protects its
582 global and static data with locks, and can provide a reasonable amount of
583 concurrency. A library can be safe to use, but not MT-Safe. For example,
584 surrounding an entire library with a monitor makes the library Safe, but it
585 supports no concurrency so it is not considered MT-Safe. An MT-Safe library
586 must permit a reasonable amount of concurrency. (This definition's purpose is
587 to give precision to what is meant when a library is described as Safe. The
588 definition of a Safe library does not specify if the library supports
589 concurrency. The MT-Safe definition makes it clear that the library is Safe,
590 and supports some concurrency. This clarifies the Safe definition, which can
591 mean anything from being single threaded to being any degree of multithreaded.)
595 .ne 2
597 \fB\fBAsync-Signal-Safe\fR\fR
599 .sp .6
600 .RS 4n
601 Async-Signal-Safe refers to particular library functions that can be safely
602 called from a signal handler. A thread that is executing an Async-Signal-Safe
603 function will not deadlock with itself if interrupted by a signal. Signals are
604 only a problem for MT-Safe functions that acquire locks.
606 Async-Signal-Safe functions are also MT-Safe. Signals are disabled when locks
607 are acquired in Async-Signal-Safe functions. These signals prevent a signal
608 handler that might acquire the same lock from being called.
612 .ne 2
614 \fB\fBMT-Safe with Exceptions\fR\fR
616 .sp .6
617 .RS 4n
618 See the \fBNOTES\fR or \fBUSAGE\fR sections of these pages for a description of
619 the exceptions.
623 .ne 2
625 \fB\fBSafe with Exceptions\fR\fR
627 .sp .6
628 .RS 4n
629 See the \fBNOTES\fR or \fBUSAGE\fR sections of these pages for a description of
630 the exceptions.
634 .ne 2
636 \fB\fBFork-Safe\fR\fR
638 .sp .6
639 .RS 4n
640 The \fBfork\fR(2) function replicates only the calling thread in the child
641 process. The \fBfork1\fR(2) function exists for compatibility with the past and
642 is synonymous with \fBfork()\fR. If a thread other than the one performing the
643 fork holds a lock when \fBfork()\fR is called, the lock will still be held in
644 the child process but there will be no lock owner since the owning thread was
645 not replicated. A child calling a function that attempts to acquire the lock
646 will deadlock itself.
648 When \fBfork()\fR is called, a Fork-Safe library arranges to have all of its
649 internal locks held only by the thread performing the fork. This is usually
650 accomplished with \fBpthread_atfork\fR(3C), which is called when the library is
651 initialized.
653 The \fBforkall\fR(2) function provides the capability for the rare case when a
654 process needs to replicate all of its threads when performing a fork. No
655 \fBpthread_atfork()\fR actions are performed when \fBforkall()\fR is called.
656 There are dangers associated with calling \fBforkall()\fR. If some threads in a
657 process are performing I/O operations when another thread calls
658 \fBforkall()\fR, they will continue performing the same I/O operations in both
659 the parent and child processes, possibly causing data corruption. For this and
660 other race-condition reasons, the use of \fBforkall()\fR is discouraged.
662 In all Solaris releases prior to Solaris 10, the behavior of \fBfork()\fR
663 depended on whether or not the application was linked with \fB-lpthread\fR
664 (POSIX threads, see \fBstandards\fR(5)). If linked with \fB-lpthread\fR,
665 \fBfork()\fR behaved like \fBfork1()\fR; otherwise it behaved like
666 \fBforkall()\fR. To avoid any confusion concerning the behavior of
667 \fBfork()\fR, applications can specifically call \fBfork1()\fR or
668 \fBforkall()\fR as appropriate.
672 .ne 2
674 \fB\fBCancel-Safety\fR\fR
676 .sp .6
677 .RS 4n
678 If a multithreaded application uses \fBpthread_cancel\fR(3C) to cancel (that
679 is, kill) a thread, it is possible that the target thread is killed while
680 holding a resource, such as a lock or allocated memory. If the thread has not
681 installed the appropriate cancellation cleanup handlers to release the
682 resources appropriately (see \fBpthread_cancel\fR(3C)), the application is
683 "cancel-unsafe", that is, it is not safe with respect to cancellation. This
684 unsafety could result in deadlocks due to locks not released by a thread that
685 gets cancelled, or resource leaks; for example, memory not being freed on
686 thread cancellation. All applications that use \fBpthread_cancel\fR(3C) should
687 ensure that they operate in a Cancel-Safe environment. Libraries that have
688 cancellation points and which acquire resources such as locks or allocate
689 memory dynamically, also contribute to the cancel-unsafety of applications that
690 are linked with these libraries. This introduces another level of safety for
691 libraries in a multithreaded program: Cancel-Safety. There are two
692 sub-categories of Cancel-Safety: Deferred-Cancel-Safety, and
693 Asynchronous-Cancel-Safety. An application is considered to be
694 Deferred-Cancel-Safe when it is Cancel-Safe for threads whose cancellation type
695 is \fBPTHREAD_CANCEL_DEFERRED\fR. An application is considered to be
696 Asynchronous-Cancel-Safe when it is Cancel-Safe for threads whose cancellation
697 type is \fBPTHREAD_CANCEL_ASYNCHRONOUS\fR. Deferred-Cancel-Safety is easier to
698 achieve than Asynchronous-Cancel-Safety, since a thread with the deferred
699 cancellation type can be cancelled only at well-defined cancellation points,
700 whereas a thread with the asynchronous cancellation type can be cancelled
701 anywhere. Since all threads are created by default to have the deferred
702 cancellation type, it might never be necessary to worry about asynchronous
703 cancel safety. Most applications and libraries are expected to always be
704 Asynchronous-Cancel-Unsafe. An application which is Asynchronous-Cancel-Safe is
705 also, by definition, Deferred-Cancel-Safe.
708 .SS "Standard"
711 Many interfaces are defined and controlled as industry standards. When this is
712 the case, the controlling body and/or public, versioned document is noted in
713 this section.
716 Programmers producing portable applications should rely on the interface
717 descriptions present in the standard or specification to which the application
718 is intended to conform, rather than the manual page descriptions of interfaces
719 based upon a public standard. When the standard or specification allows
720 alternative implementation choices, the manual page usually only describes the
721 alternative implemented by Sun. The manual page also describes any compatible
722 extensions to the base definition of Standard interfaces provided by Sun.
725 No endorsement of the referenced controlling body or document should be
726 inferred by its presence as a "Standard" entry. The controlling body may be a
727 very formal organization, as in ISO or ANSII, a less formal, but generally
728 accepted organization such as IETF, or as informal as the sole contributor in
729 the case of FOSS (Free or Open Source Software).
730 .SH SEE ALSO
733 \fBuname\fR(1), \fBpkgadd\fR(1M), \fBIntro\fR(3), \fBstandards\fR(5)