Skip to content

Instantly share code, notes, and snippets.

@alanc
Last active May 17, 2022 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanc/147e18981842406cea06afc2bbf3dc33 to your computer and use it in GitHub Desktop.
Save alanc/147e18981842406cea06afc2bbf3dc33 to your computer and use it in GitHub Desktop.
Man page changes in Solaris 11.4.45
Man page changes between Solaris 11.4.42 & 11.4.45, including changes for:
14882547 quota checking should be off by default for NFS client filesystems
16835713 want ability to make files retained until a future date
23214605 libucrypto man pages need update for policy mechanism
24816089 KZ LZR should support capped-memory on SPARC
28867418 format(8) does not explain -f and exit codes
30063967 Incomplete list of basic privileges in privileges(7)
30079830 sstoreadm should allow for the cleaning of the repo in one step
31756590 vmstat can use sstore as the backend
32378564 Implement generic in-kernel IOR events
32671310 zoneadm shutdown hangs indefinitely for zone running sysconfig in milestone/config
33469574 drand48 man page has incorrect function args
33546785 solaris10(7) manpage needs a section on firewall
33581773 Add kernel zone support for sparc LDOM migration-class2
33585045 restore mremap() for SRU 45
33596893 ld should provide -zstrip-class=compcom option
33674722 update libucrypto_encrypt(3lib) man page for in-place decryption
33737322 hg pbchk error - cddlchk scans binary files and throws unicode exception
33752229 strftime(3C) examples should show ISO 8601:2019 format
33780003 mistake on retention.period.min in zfs.8
33784223 Example 10 with length() in awk(1) is wrong
33815686 ::delete's help is ambiguous
33828345 Assorted fixes for string API man pages
33842102 link resolution failures in ON man pages
33866611 rw_enter_sig should have a entry in rwlock.9f
33867864 pool with mandatory retention dataset should not be allowed to split
33890481 Expand limitations on x86 CPU hotplug in zones manpages
33907103 getnameinfo(3c) should document EAI_NONAME error if sin6_scope_id is incorrect
33909250 Missing explanation of EPERM in certain file operations
33947547 Another batch of improper sample values in man pages
33947559 sxadm(8) man page updates for 29187370
33981943 system attributes should be better documented in man pages
33983323 re-sync translations of manpages for SRU 45
Copyright (c) 1983, 2022, Oracle and/or its affiliates.
diff -NurbBw 11.4.42/man1/awk.1 11.4.45/man1/awk.1
--- 11.4.42/man1/awk.1 2022-05-17 14:50:11.644580932 -0700
+++ 11.4.45/man1/awk.1 2022-05-17 14:50:54.523512370 -0700
@@ -1209,7 +1209,7 @@
Example 10 Write lines longer than 72 characters:
- {length($0) > 72}
+ length($0) > 72 {print}
Example 11 Write first two fields in opposite order separated by the
@@ -1379,4 +1379,4 @@
-Oracle Solaris 11.4 11 May 2021 awk(1)
+Oracle Solaris 11.4 24 Jan 2022 awk(1)
diff -NurbBw 11.4.42/man1/chmod.1 11.4.45/man1/chmod.1
--- 11.4.42/man1/chmod.1 2022-05-17 14:50:11.706572457 -0700
+++ 11.4.45/man1/chmod.1 2022-05-17 14:50:54.569191784 -0700
@@ -868,6 +868,10 @@
sensitive T
+
+ See the sysattr(7) manual page for definitions of these system
+ attributes.
+
OPTIONS
The following options are supported:
@@ -1871,7 +1875,7 @@
SEE ALSO
ls(1), chmod(2), fgetattr(3C), acl(7), attributes(7), environ(7),
- fsattr(7), privileges(7), standards(7)
+ fsattr(7), privileges(7), standards(7), sysattr(7)
Managing ZFS File Systems in Oracle Solaris 11.4
@@ -1905,4 +1909,4 @@
-Oracle Solaris 11.4 3 Nov 2021 chmod(1)
+Oracle Solaris 11.4 21 Mar 2022 chmod(1)
diff -NurbBw 11.4.42/man1/elfcompress.1 11.4.45/man1/elfcompress.1
--- 11.4.42/man1/elfcompress.1 2022-05-17 14:50:11.754504143 -0700
+++ 11.4.45/man1/elfcompress.1 2022-05-17 14:50:54.598694593 -0700
@@ -48,8 +48,14 @@
specified, elfcompress will default to the annotate and debug
classes.
- Each section class token can be prepended with a '!' to indicate
- that the class should not be a candidate.
+ Some classes cause other classes to be implicitly included, or
+ encapsulated. Such cases are noted in the class descriptions below.
+ Each class token can be prepended with a '!' to indicate that the
+ class should not be included. This definition can be useful to pre-
+ vent a class from including another normally encapsulated class.
+ For example, while the symbol class encapsulates non-allocable sort
+ sections, symbol,!sort targets the non-allocable symbol table, but
+ excludes any associated ELF sort sections.
The following classes of section can be defined.
@@ -75,13 +81,20 @@
having a .comment section name.
+ compcom
+
+ Compress any compiler commentary section. These sections are
+ identified by having a .compcom section name.
+
+
debug
Process sections commonly used to contain debugging data. Debug
- sections are identified by having a .compcom, .debug*, .line,
- .stab*, .SUNW_ctf, or .zdebug* section name. These sections are
- also identified by having an SHT_PROGBITS, SHT_SUNW_DEBUG, or
- SHT_SUNW_DEBUGSTR section type.
+ sections are identified by having a .debug*, .line, .stab*,
+ .SUNW_ctf, or .zdebug* section name. These sections are also
+ identified by having an SHT_PROGBITS, SHT_SUNW_DEBUG, or
+ SHT_SUNW_DEBUGSTR section type. This class also encapsulates
+ the compcom class.
shstrtab
@@ -267,4 +280,4 @@
-Oracle Solaris 11.4 6 January 2020 elfcompress(1)
+Oracle Solaris 11.4 2 December 2021 elfcompress(1)
diff -NurbBw 11.4.42/man1/ld.1 11.4.45/man1/ld.1
--- 11.4.42/man1/ld.1 2022-05-17 14:50:11.818250909 -0700
+++ 11.4.45/man1/ld.1 2022-05-17 14:50:54.676867742 -0700
@@ -765,10 +765,14 @@
The compress class descriptions that follow only apply to non-allo-
catable sections.
+ Some classes cause other classes to be implicitly included, or
+ encapsulated. Such cases are noted in the class descriptions below.
Each class token can be prepended with a '!' to indicate that the
- class should not be a compression candidate. For example, using
- -z compress-class=symbol,!sort targets the non-allocable symbol ta-
- ble, but excludes any associated ELF sort sections.
+ class should not be included. This definition can be useful to pre-
+ vent a class from including another normally encapsulated class.
+ For example, while the symbol class encapsulates non-allocable sort
+ sections, -z compress-class=symbol,!sort targets the non-allocable
+ symbol table, but excludes any associated ELF sort sections.
The following classes of section can be defined.
@@ -794,13 +798,20 @@
having a .comment section name.
+ compcom
+
+ Compress any compiler commentary section. These sections are
+ identified by having a .compcom section name.
+
+
debug
Compress sections commonly used to contain debugging data.
- Debug sections are identified by having a .compcom, .debug*,
- .line, .stab*, .SUNW_ctf, or .zdebug* section name. These sec-
- tions are also identified by having an SHT_PROGBITS,
- SHT_SUNW_DEBUG, or SHT_SUNW_DEBUGSTR section type.
+ Debug sections are identified by having a .debug*, .line,
+ .stab*, .SUNW_ctf, or .zdebug* section name. These sections are
+ also identified by having an SHT_PROGBITS, SHT_SUNW_DEBUG, or
+ SHT_SUNW_DEBUGSTR section type. This class also encapsulates
+ the compcom class.
shstrtab
@@ -832,10 +843,10 @@
symbol
- Compress any non-allocatable symbol table. This class also
- encapsulates the sort classes. These sections are identified by
- having a SHT_SYMTAB section type. Any associated string table
- or symbol sort sections are also compressed.
+ Compress any non-allocatable symbol table. These sections are
+ identified by having a SHT_SYMTAB section type. Any associated
+ string table is also compressed. This class also encapsulates
+ the sort_sym classes.
@@ -1449,11 +1460,14 @@
The strip class descriptions that follow only apply to non-allocat-
able sections.
+ Some classes cause other classes to be implicitly included, or
+ encapsulated. Such cases are noted in the class descriptions below.
Each class token can be prepended with a '!' to indicate that the
- class should not be removed. This definition can be useful when
- combined with the nonalloc class. For example, using -z strip-
- class=nonalloc,!note removes all non-allocatable sections except
- for the note section.
+ class should not be removed. This definition can be useful to pre-
+ vent a class from including another normally encapsulated class.
+ For example, while the nonalloc class encapsulates all non-alloca-
+ ble sections, -z strip-class=nonalloc,!note removes all non-allo-
+ catable sections except for the note section.
Stripped sections are completely removed from the output object.
The use of the -z ancillary option alters this behavior with regard
@@ -1491,12 +1505,19 @@
ity is commonly used to manipulate comment sections.
+ compcom
+
+ Strip any compiler commentary section. These sections are iden-
+ tified by having a .compcom section name.
+
+
debug
Strip sections commonly used to contain debugging data. These
- sections are identified by having a .compcom, .line, .stab*,
- .debug*, or .zdebug* section name. These sections are also
- identified by having a SHT_SUNW_DEBUG* section type.
+ sections are identified by having a .line, .stab*, .debug*, or
+ .zdebug* section name. These sections are also identified by
+ having a SHT_SUNW_DEBUG* section type. This class also encapsu-
+ lates the compcom class.
exclude
@@ -1564,8 +1585,9 @@
Strip any non-allocatable symbol table, providing the output
file is not a relocatable object. These sections are identified
- by having a SHT_SYMTAB section type. Any associated string ta-
- ble or symbol sort sections are also removed.
+ by having a SHT_SYMTAB section type. This class encapsulates
+ the sort_sym classes. Any associated string table or symbol
+ sort sections are also removed.
@@ -2440,4 +2462,4 @@
-Oracle Solaris 11.4 11 May 2021 ld(1)
+Oracle Solaris 11.4 2 December 2021 ld(1)
diff -NurbBw 11.4.42/man1/ls.1 11.4.45/man1/ls.1
--- 11.4.42/man1/ls.1 2022-05-17 14:50:11.865705147 -0700
+++ 11.4.45/man1/ls.1 2022-05-17 14:50:54.747419554 -0700
@@ -6,22 +6,22 @@
ls - list contents of directory
SYNOPSIS
- /usr/bin/ls [-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@]
- [-/ c | -/v] [-% atime | crtime | ctime | mtime | all]
+ /usr/bin/ls [-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@] [-/ c | v]
+ [-% atime | crtime | ctime | mtime | rtime | all]
[--block-size size] [--color[=when]] [--file-type]
[--scale[=item1,item2,...]] [--si] [--time-style style]
[file]...
- /usr/xpg4/bin/ls [-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@]
- [-/ c | -/v] [-% atime | crtime | ctime | mtime | all]
+ /usr/xpg4/bin/ls [-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@] [-/ c | v]
+ [-% atime | crtime | ctime | mtime | rtime | all]
[--block-size size] [--color[=when]] [--file-type]
[--scale[=item1,item2,...]] [--si] [--time-style style]
[file]...
- /usr/xpg6/bin/ls [-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@]
- [-/ c | -/v] [-% atime | crtime | ctime | mtime | all]
+ /usr/xpg6/bin/ls [-aAbcCdeEfFghHiklLmnopqrRsStuUwvVx1@] [-/ c | v]
+ [-% atime | crtime | ctime | mtime | rtime | all]
[--block-size size] [--color[=when]] [--file-type]
[--scale[=item1,item2,...]] [--si] [--time-style style]
[file]...
@@ -102,13 +102,11 @@
$ ls -/ c file
-rw-r--r-- 1 root root 0 May 10 14:17 file
- {AHRSadim-u}
+ {AHRSadim-u---}
$ ls -/ v file
-rw-r--r-- 1 root root 0 May 10 14:17 file
- {archive,hidden,readonly,system,appendonly\
- nodump,immutable, av_modified,\
- noav_quarantined,nounlink}
+ {archive,hidden,readonly,system,appendonly,nodump,immutable,av_modified,noav_quarantined,nounlink,nooffline,nosparse,nosensitive}
$ ls -l -% all file
-rw-r--r-- 1 root root 0 May 10 14:17 file
@@ -742,97 +740,8 @@
(verbose mode). Displays the long listing, same as -l. In addition,
displays the extended system attributes associated with the file
when extended system attributes are fully supported by the underly-
- ing file system.
-
-
- appendonly
-
- Allows a file to be modified only at offset EOF. Attempts to
- modify a file at a location other than EOF fails with EPERM.
-
-
- archive
-
- Indicates if a file has been modified since it was last backed
- up. Whenever the modification time (mtime) of a file is changed
- the archive attribute is set.
-
-
- av_modified
-
- ZFS sets the anti-virus attribute which whenever a file's con-
- tent or size changes or when the file is renamed.
-
-
- av_quarantined
-
- Anti-virus software sets to mark a file as quarantined.
-
-
- crtime
-
- Timestamp when a file is created.
-
-
- hidden
-
- Marks a file as hidden.
-
-
- immutable
-
- Prevents the content of a file from being modified. Also pre-
- vents all metadata changes, except for access time updates.
- When placed on a directory, prevents the deletion and creation
- of files in the directories. Attempts to modify the content of
- a file or directory marked as immutable fail with EPERM.
- Attempts to modify any attributes (with the exception of access
- time and, with the proper privileges, the immutable) of a file
- marked as immutable fails with EPERM.
-
-
- nodump
-
- Solaris systems have no special semantics for this attribute.
-
-
- nounlink
-
- Prevents a file from being deleted. On a directory, the
- attribute also prevents any changes to the contents of the
- directory. That is, no files within the directory can be
- removed or renamed. The errno EPERM is returned when attempt-
- ing to unlink or rename files and directories that are marked
- as nounlink.
-
-
- readonly
-
- Marks a file as readonly. Once a file is marked as readonly the
- content data of the file cannot be modified. Other metadata for
- the file can still be modified.
-
-
- sparse
-
- This attribute is available to users and applications to indi-
- cate that a file can be interpreted as sparse. It does not
- indicate whether or not the file is actually sparse and it has
- no special semantics on the Solaris operating system. The
- sparse attribute will be cleared if the file is truncated to
- zero length.
-
-
- system
-
- Solaris systems have no special semantics for this attribute.
-
-
- sensitive
-
- Some Solaris utilities may take different actions based on this
- attribute. For example, not recording the contents of such
- files in administrative logs.
+ ing file system. See the sysattr(7) manual page for definitions of
+ the extended system attributes.
The display characters used in compact mode (-/ c) are as follows:
@@ -856,33 +765,34 @@
The display in verbose mode (-/ v) uses full attribute names when
it is set and the name prefixed by no when it is not set.
- Attributes representing timestamps, such as crtime, are handled by
- the -% option described below, and are not listed by the -/ option.
+ Attributes representing timestamps - crtime and rtime - are handled
+ by the -% option described below, and are not listed by the -/
+ option.
The display positions are as follows:
- {||||||||||}
+ {||||||||||||||}
|||||||||||||+ T (sensitive)
- |||||||||||+- s (sparse)
- ||||||||||+-- O (offline)
- |||||||||+--- u (nounlink)
- ||||||||+---- q (av_quarantined)
- |||||||+----- m (av_modified)
- ||||||+------ i (immutable)
- |||||+------- d (nodump)
- ||||+-------- a (appendonly)
- |||+--------- S (system)
- ||+---------- R (readonly)
- |+----------- H (hidden)
- +------------ A (archive)
+ |||||||||||+-- s (sparse)
+ ||||||||||+--- O (offline)
+ |||||||||+---- u (nounlink)
+ ||||||||+----- q (av_quarantined)
+ |||||||+------ m (av_modified)
+ ||||||+------- i (immutable)
+ |||||+-------- d (nodump)
+ ||||+--------- a (appendonly)
+ |||+---------- S (system)
+ ||+----------- R (readonly)
+ |+------------ H (hidden)
+ +------------- A (archive)
- -% atime | crtime | ctime | mtime | all
+ -% atime | crtime | ctime | mtime | rtime | all
atime Uses the last access time of the file for sorting or
@@ -901,16 +811,25 @@
mtime Uses the last modification time of the file contents for
sorting or printing.
+
+ rtime Uses the retention time of the file contents for sorting
+ or printing.
+
+
If extended system attributes are not supported, or if the user
does not have read permission on the file, or if the crtime
extended attribute is not set, crtime is treated as a synonym for
mtime.
+ If extended system attributes are not supported, if the user does
+ not have read permission on the file, or if the rtime extended
+ attribute is not set, the retention time is not displayed.
+
When option argument all is specified, all available timestamps are
printed which includes atime, ctime, mtime, and on the extended
- system attribute supporting file systems, crtime (create time). The
- option -% all does not affect which timestamp is displayed in long
- format and does not affect sorting.
+ system attribute supporting file systems, crtime (create time) and
+ rtime (retention time). The option -% all does not affect which
+ timestamp is displayed in long format and does not affect sorting.
--block-size size
@@ -1488,7 +1407,7 @@
example% ls -/ c file (extended system attribute in compact mode)
-rw-r--r-- 1 root root 0 May 10 14:17 file
- {AHRSadim-u}
+ {AHRSadim-u---}
@@ -1501,9 +1420,7 @@
example% ls -/ v file (extended system attribute in verbose mode)
-rw-r--r-- 1 root root 0 May 10 14:17 file
- {archive,hidden,readonly,system,appendonly\
- nodump,immutable,av_modified,\
- noav_quarantined,nounlink}
+ {archive,hidden,readonly,system,appendonly,nodump,immutable,av_modified,noav_quarantined,nounlink,nooffline,nosparse,nosensitive}
example% ls -/ v file (no extended system attribute)
-rw-r--r-- 1 root staff 0 May 16 14:48 file
@@ -1513,7 +1430,7 @@
supported file system)
-rw-r--r-- 1 root staff 3 Jun 4 22:04 file
- {A------m--}
+ {A------m-----}
@@ -1524,8 +1441,8 @@
example% ls -/ c -%crtime file
- -rw-r--r-- root root 0 May 10 14:17 file
- {AHRSadim-u}
+ -rw-r--r-- 1 root root 0 May 10 14:17 file
+ {AHRSadim-u---}
@@ -1672,7 +1589,7 @@
SEE ALSO
chmod(1), cp(1), fgetattr(3C), strftime(3C), terminfo(5), acl(7),
- attributes(7), environ(7), fsattr(7), standards(7)
+ attributes(7), environ(7), fsattr(7), standards(7), sysattr(7)
NOTES
Unprintable characters in file names can confuse the columnar output
@@ -1692,4 +1609,4 @@
-Oracle Solaris 11.4 22 September 2021 ls(1)
+Oracle Solaris 11.4 21 Mar 2022 ls(1)
diff -NurbBw 11.4.42/man1/mdb.1 11.4.45/man1/mdb.1
--- 11.4.42/man1/mdb.1 2022-05-17 14:50:11.954450378 -0700
+++ 11.4.45/man1/mdb.1 2022-05-17 14:50:54.883131956 -0700
@@ -1802,11 +1802,11 @@
-- Specifies the end of option processing
- [ address ] ::delete [ id | all ]
- [ address ] :d [ id | all ]
+ [ address ] ::delete [ id ... | all ]
+ [ address ] :d [ id ... | all ]
- Delete the event specifiers with the given id number. The id number
- argument is interpreted in decimal by default. If an optional
+ Delete the event specifiers with the given id numbers. The id num-
+ ber arguments are interpreted in decimal by default. If an optional
address is specified preceding the dcmd, all event specifiers that
are associated with the given virtual address are deleted (for
example, all breakpoints or watchpoints affecting that address). If
@@ -4249,4 +4249,4 @@
-Oracle Solaris 11.4 11 November 2021 mdb(1)
+Oracle Solaris 11.4 7 February 2022 mdb(1)
diff -NurbBw 11.4.42/man1/proc.1 11.4.45/man1/proc.1
--- 11.4.42/man1/proc.1 2022-05-17 14:50:12.308142553 -0700
+++ 11.4.45/man1/proc.1 2022-05-17 14:50:55.249272922 -0700
@@ -417,4 +417,4 @@
-Oracle Solaris 11.4 18 Deptember 2021 proc(1)
+Oracle Solaris 11.4 18 September 2021 proc(1)
diff -NurbBw 11.4.42/man1/sstoreadm.1 11.4.45/man1/sstoreadm.1
--- 11.4.42/man1/sstoreadm.1 2022-05-17 14:50:12.770917772 -0700
+++ 11.4.45/man1/sstoreadm.1 2022-05-17 14:50:55.621545438 -0700
@@ -21,6 +21,9 @@
/usr/bin/sstoreadm purge [[-t start-time] [-e end-time]
[-i step]] ssid [ssid... ]
+
+ /usr/bin/sstoreadm purge -a [[-t start-time] [-e end-time] [-i step]]
+
DESCRIPTION
sstoreadm provides the ability to administer the sstore configuration.
@@ -68,6 +71,12 @@
If you do not specify a time range, then all data is purged for the
given ssids.
+ Use the start-time and end-time arguments to purge the data between
+ this timespan. For example,
+
+
+ # sstoreadm purge -t 2021-11-24T03:19:01 -e now ssid
+
Use the step argument to set an upper limit on the granularity of
the purged data as shown in the following example:
@@ -82,6 +91,15 @@
specification options.
+ sstoreadm purge -a [[-t start-time] [-e end-time] [-i step]]
+
+ Use the -a argument to purge all the historical data from sstore.
+ Even the data under enabled/disabled collections will be lost.
+ Specifying the ssid list is incompatible with this argument.
+
+ You can also specify a time range and step with this option.
+
+
EXIT STATUS
The following exit values are returned:
@@ -120,4 +138,4 @@
-Oracle Solaris 11.4 8 May 2018 sstoreadm(1)
+Oracle Solaris 11.4 16 Nov 2021 sstoreadm(1)
diff -NurbBw 11.4.42/man1/strip.1 11.4.45/man1/strip.1
--- 11.4.42/man1/strip.1 2022-05-17 14:50:12.799451012 -0700
+++ 11.4.45/man1/strip.1 2022-05-17 14:50:55.668165475 -0700
@@ -47,11 +47,14 @@
The strip class descriptions that follow only apply to non-allocat-
able sections.
+ Some classes cause other classes to be implicitly included, or
+ encapsulated. Such cases are noted in the class descriptions below.
Each class token can be prepended with a '!' to indicate that the
- class should not be removed. This definition can be useful when
- combined with the nonalloc class. For example, using -c=nonal-
- loc,!note removes all non-allocatable sections except for the note
- section.
+ class should not be removed. This definition can be useful to pre-
+ vent a class from including another normally encapsulated class.
+ For example, while the nonalloc class encapsulates all non-alloca-
+ ble sections, -z strip-class=nonalloc,!note removes all non-allo-
+ catable sections except for the note section.
Stripped sections are completely removed from the output object.
@@ -81,13 +84,19 @@
ity is commonly used to manipulate comment sections.
+ compcom
+
+ Strip any compiler commentary section. These sections are iden-
+ tified by having a .compcom section name.
+
+
debug
Strip sections commonly used to contain debugging data. These
- sections are identified by having a .compcom, .debug*, .line,
- .stab* .SUNW_ctf, or .zdebug* section name. These sections are
- also identified by having a SHT_SUNW_DEBUG or SHT_SUNW_DEBUGSTR
- section type.
+ sections are identified by having a .debug*, .stab*, .SUNW_ctf,
+ or .zdebug* section name. These sections are also identified by
+ having a SHT_SUNW_DEBUG or SHT_SUNW_DEBUGSTR section type. This
+ class also encapsulates the compcom, and line classes.
exclude
@@ -146,8 +155,8 @@
Strip any non-allocatable symbol table, providing the file is
not a relocatable object. These sections are identified by hav-
ing a SHT_SYMTAB section type. This class also encapsulates the
- sort classes. Any associated string table or symbol sort sec-
- tions are also removed.
+ sort_sym classes. Any associated string table or symbol sort
+ sections are also removed.
@@ -235,4 +244,4 @@
-Oracle Solaris 11.4 6 January 2020 strip(1)
+Oracle Solaris 11.4 2 December 2021 strip(1)
diff -NurbBw 11.4.42/man1/touch.1 11.4.45/man1/touch.1
--- 11.4.42/man1/touch.1 2022-05-17 14:50:12.836103313 -0700
+++ 11.4.45/man1/touch.1 2022-05-17 14:50:55.722453191 -0700
@@ -6,13 +6,13 @@
touch, settime - change file access and modification times
SYNOPSIS
- /usr/bin/touch [-acm] [-r ref_file | -t time | -d date_time] file...
+ /usr/bin/touch [-acmR] [-r ref_file | -t time | -d date_time] file...
- /usr/bin/touch [-acm] [time_spec] file...
+ /usr/bin/touch [-acmR] [time_spec] file...
- /usr/xpg7/bin/touch [-acm] [-r ref_file | -t time | -d date_time] file...
+ /usr/xpg7/bin/touch [-acmR] [-r ref_file | -t time | -d date_time] file...
/usr/bin/settime [-f ref_file] [time_spec] file...
@@ -163,6 +163,12 @@
If SS is not given, it is assumed to be 0.
+ -R
+
+ Changes the retention time of file.
+
+
+
settime
The following option is supported for the settime utility:
@@ -339,4 +345,4 @@
-Oracle Solaris 11.4 19 Jul 2021 touch(1)
+Oracle Solaris 11.4 17 Jan 2022 touch(1)
diff -NurbBw 11.4.42/man1/vacation.1 11.4.45/man1/vacation.1
--- 11.4.42/man1/vacation.1 2022-05-17 14:50:12.866780421 -0700
+++ 11.4.45/man1/vacation.1 2022-05-17 14:50:55.769173966 -0700
@@ -129,7 +129,7 @@
- The -l option is neither for initialization nor configuration., but for
+ The -l option is neither for initialization nor configuration, but for
reporting. The -foption can also be used in conjunction with the -l.
-l Lists the addresses to which a reply has been sent since the last
@@ -192,14 +192,12 @@
A sample filter file might look like the following:
-
-
- !host.subdomain.sun.com
- sun.com
- !wife@mydomain.com
- mydomain.com
- onefriend@hisisp.com
- anotherfriend@herisp.com
+ !host.subdomain.example.com
+ example.com
+ !wife@mydomain.example
+ mydomain.example
+ onefriend@example.net
+ anotherfriend@example.org
@@ -235,4 +233,4 @@
-Oracle Solaris 11.4 19 May 2017 vacation(1)
+Oracle Solaris 11.4 9 Mar 2022 vacation(1)
diff -NurbBw 11.4.42/man2/acl.2 11.4.45/man2/acl.2
--- 11.4.42/man2/acl.2 2022-05-17 14:50:12.905859793 -0700
+++ 11.4.45/man2/acl.2 2022-05-17 14:50:55.807712951 -0700
@@ -124,6 +124,9 @@
EPERM The effective user ID does not match the owner of the file
and the process does not have appropriate privilege.
+ The file has one or more of the immutable or rtime system
+ attributes set.
+
EROFS The cmd argument is SETACL or ACE_SETACL and the file speci-
fied by pathp resides on a file system that is mounted read-
@@ -141,8 +144,8 @@
+-----------------------------+-----------------------------+
SEE ALSO
- aclcheck(3SEC), aclsort(3SEC), acl(7)
+ aclcheck(3SEC), aclsort(3SEC), acl(7), sysattr(7)
-Oracle Solaris 11.4 13 May 2015 acl(2)
+Oracle Solaris 11.4 21 Mar 2022 acl(2)
diff -NurbBw 11.4.42/man2/chmod.2 11.4.45/man2/chmod.2
--- 11.4.42/man2/chmod.2 2022-05-17 14:50:12.943181189 -0700
+++ 11.4.45/man2/chmod.2 2022-05-17 14:50:55.875947178 -0700
@@ -157,6 +157,20 @@
owned executable, additional restrictions apply. See privi-
leges(7).
+ The file has the immutable system attribute set.
+
+ The file has the rtime system attribute set, but does not have
+ the appendonly system attribute set.
+
+ The file has both the rtime and the appendonly system
+ attributes set, and the mode argument specifies changes to
+ bits other than the write permission bits.
+
+ The file has both the rtime and the appendonly system
+ attributes set, has a size greater than zero bytes, and the
+ mode argument specifies changes to bits other than removing
+ the write permission bits.
+
EROFS The file referred to by path resides on a read-only file sys-
tem.
@@ -369,7 +383,7 @@
SEE ALSO
chmod(1), chown(2), creat(2), fcntl(2), mknod(2), open(2), read(2),
rename(2), stat(2), write(2), fattach(3C), mkfifo(3C), stat.h(3HEAD),
- attributes(7), privileges(7), standards(7)
+ attributes(7), privileges(7), standards(7), sysattr(7)
HISTORY
The chmod() and fchmod() functions have been included in all Sun and
@@ -381,4 +395,4 @@
-Oracle Solaris 11.4 2 Mar 2021 chmod(2)
+Oracle Solaris 11.4 21 Mar 2022 chmod(2)
diff -NurbBw 11.4.42/man2/chown.2 11.4.45/man2/chown.2
--- 11.4.42/man2/chown.2 2022-05-17 14:50:12.971077703 -0700
+++ 11.4.45/man2/chown.2 2022-05-17 14:50:55.925594724 -0700
@@ -99,6 +99,9 @@
privilege is not asserted in the effective set of the calling
process.
+ The file has one or more of the immutable or rtime system
+ attributes set.
+
The chown(), lchown(), and fchownat() functions will fail if:
@@ -227,7 +230,7 @@
SEE ALSO
chgrp(1), chown(1), getconf(1), chmod(2), fpathconf(2), system(5),
- attributes(7), privileges(7), standards(7)
+ attributes(7), privileges(7), standards(7), sysattr(7)
HISTORY
The chown(), fchown(), and lchown() functions have been included in all
@@ -238,4 +241,4 @@
-Oracle Solaris 11.4 3 Nov 2021 chown(2)
+Oracle Solaris 11.4 21 Mar 2022 chown(2)
diff -NurbBw 11.4.42/man2/fcntl.2 11.4.45/man2/fcntl.2
--- 11.4.42/man2/fcntl.2 2022-05-17 14:50:13.275142371 -0700
+++ 11.4.45/man2/fcntl.2 2022-05-17 14:50:56.194444622 -0700
@@ -619,6 +619,13 @@
object of type off64_t.
+ EPERM
+
+ The cmd argument is F_ALLOCSP, F_ALLOCSP64, F_FREESP, or
+ F_FREESP64, and the file has one or more of the appendonly, read-
+ only, immutable, or rtime system attributes set.
+
+
The fcntl() function may fail if:
@@ -657,7 +664,7 @@
SEE ALSO
chmod(2), close(2), creat(2), dup(2), exec(2), fork(2), mmap(2),
open(2), pipe(2), read(2), sigaction(2), write(2), dup2(3C),
- fcntl.h(3HEAD), attributes(7), standards(7), lockd(8)
+ fcntl.h(3HEAD), attributes(7), standards(7), sysattr(7), lockd(8)
NOTES
In the past, the variable errno was set to EACCES rather than EAGAIN
@@ -693,4 +700,4 @@
-Oracle Solaris 11.4 22 Jan 2018 fcntl(2)
+Oracle Solaris 11.4 21 Mar 2022 fcntl(2)
diff -NurbBw 11.4.42/man2/futimens.2 11.4.45/man2/futimens.2
--- 11.4.42/man2/futimens.2 2022-05-17 14:50:13.304271918 -0700
+++ 11.4.45/man2/futimens.2 2022-05-17 14:50:56.224134044 -0700
@@ -110,6 +110,14 @@
of the file, and {PRIV_FILE_OWNER} is not asserted in the
effective set of the calling process.
+ The arguments specify a change to the modification time and
+ the file has one or more of the immutable or rtime system
+ attributes set.
+
+ The file has the rtime system attribute set and the arguments
+ specify a change to the access time that would cause the
+ file's retention time to be reduced.
+
EROFS The file system containing the file is read-only.
@@ -182,7 +190,8 @@
+-----------------------------+-----------------------------+
SEE ALSO
- stat(2), utime(2), utimes(2), attributes(7), fsattr(7), privileges(7)
+ stat(2), utime(2), utimes(2), attributes(7), fsattr(7), privileges(7),
+ sysattr(7)
HISTORY
The futimens() and utimensat() functions were added to Solaris in
@@ -190,4 +199,4 @@
-Oracle Solaris 11.4 3 Nov 2021 futimens(2)
+Oracle Solaris 11.4 21 Mar 2022 futimens(2)
diff -NurbBw 11.4.42/man2/Intro.2 11.4.45/man2/Intro.2
--- 11.4.42/man2/Intro.2 2022-05-17 14:50:13.476547479 -0700
+++ 11.4.45/man2/Intro.2 2022-05-17 14:50:56.354445860 -0700
@@ -997,6 +997,11 @@
Otherwise, the corresponding permissions are denied.
+
+ Note that processes that have permission to write to a file may be
+ blocked from doing so if certain system attributes are set on the file.
+ See the sysattr(7) manual page for details.
+
File Descriptor
A file descriptor is a small integer used to perform I/O operations on
a file. The value of a file descriptor is from 0 to (NOFILES-1). A
@@ -1643,8 +1648,9 @@
This notice shall appear on any product containing this material.
SEE ALSO
- acl(7), privileges(7), resource-controls(7), standards(7), threads(7)
+ acl(7), privileges(7), resource-controls(7), standards(7), sysattr(7),
+ threads(7)
-Oracle Solaris 11.4 3 Nov 2021 Intro(2)
+Oracle Solaris 11.4 21 Mar 2022 Intro(2)
diff -NurbBw 11.4.42/man2/mmap.2 11.4.45/man2/mmap.2
--- 11.4.42/man2/mmap.2 2022-05-17 14:50:13.549313412 -0700
+++ 11.4.45/man2/mmap.2 2022-05-17 14:50:56.419379233 -0700
@@ -482,6 +482,9 @@
for write and PROT_WRITE was specified for a MAP_SHARED
type mapping.
+ PROT_READ or PROT_EXEC was specified for a file with the
+ av_quarantined system attribute set.
+
EAGAIN The mapping could not be locked in memory.
@@ -578,6 +581,11 @@
description associated with fildes.
+ EPERM PROT_WRITE was specified for a file with one or more of
+ the appendonly, readonly, immutable, or rtime system
+ attributes set.
+
+
The mmap() function may fail if:
@@ -657,9 +665,9 @@
SEE ALSO
close(2), exec(2), fcntl(2), fork(2), getrlimit(2), memcntl(2),
- mmapobj(2), mprotect(2), munmap(2), shmat(2), lockf(3C), mlockall(3C),
- msync(3C), plock(3C), sysconf(3C), null(4D), zero(4D), attributes(7),
- lf64(7), standards(7), resource-controls(7)
+ mmapobj(2), mprotect(2), mremap(2), munmap(2), shmat(2), lockf(3C),
+ mlockall(3C), msync(3C), plock(3C), sysconf(3C), null(4D), zero(4D),
+ attributes(7), lf64(7), standards(7), sysattr(7), resource-controls(7)
HISTORY
The mmap() function and the flags MAP_SHARED, MAP_PRIVATE, MAP_FIXED,
@@ -688,4 +696,4 @@
-Oracle Solaris 11.4 1 May 2020 mmap(2)
+Oracle Solaris 11.4 21 Mar 2022 mmap(2)
diff -NurbBw 11.4.42/man2/mremap.2 11.4.45/man2/mremap.2
--- 11.4.42/man2/mremap.2 1969-12-31 16:00:00.000000000 -0800
+++ 11.4.45/man2/mremap.2 2022-05-17 14:50:56.448590120 -0700
@@ -0,0 +1,134 @@
+mremap(2) System Calls mremap(2)
+
+
+
+NAME
+ mremap - re-map pages of memory
+
+SYNOPSIS
+ #include <sys/mman.h>
+
+ void *mremap(void *addr, size_t len, size_t newlen, int flags, ...
+ /* void *newaddr */);
+
+DESCRIPTION
+ The mremap() function re-maps a portion of a process's address space
+ previously mapped using mmap().
+
+
+ pa = mremap(addr, len, newlen, flags, newaddr);
+
+
+ Using mremap(), a virtual memory segment can be expanded, shrunk, or
+ moved to a new location in the address space of a process.
+
+
+ The mremap() function is supported only for mapped files and anonymous
+ memory.
+
+
+ The flags argument provides information about how to handle the call.
+ The value of the flags is the bitwise inclusive OR of one or more of
+ the other flags in the following table, defined in the header
+ <sys/mman.h>:
+
+ MREMAP_MAYMOVE The kernel may move the existing mapping if there is
+ not space to expand the mapping at its current loca-
+ tion.
+
+
+ MREMAP_FIXED Re-map addr starting at newaddr. If MREMAP_FIXED is
+ not specified, the value of newaddr is ignored and
+ need not be passed. Use of this flag requires that
+ the MREMAP_MAYMOVE flag is also specified.
+
+
+RETURN VALUES
+ Upon successful completion, the mremap() function returns the address
+ at which the mapping was placed (pa); otherwise, it returns a value of
+ MAP_FAILED and sets errno to indicate the error. The symbol MAP_FAILED
+ is defined in the header <sys/mman.h>. No successful return from
+ mremap() will return the value MAP_FAILED.
+
+ERRORS
+ The mremap() function will fail if:
+
+ EAGAIN The mapping could not be locked in memory.
+
+ There was insufficient room to reserve swap space for the
+ mapping.
+
+ The flag is MAP_ADI and the memory identified by this
+ operation would exceed a limit or resource control on ADI
+ memory or the total amount of system memory is temporarily
+ insufficient to allocate ADI metadata.
+
+
+ EEXIST A mapping already exists that conflicts with the requested
+ operation.
+
+
+ EFBIG The mremap() system call returns EFBIG when it tries to
+ map a section of a file at an offset equal or larger than
+ 0x7fffffff from a NFSv2 filesystem.
+
+
+ EINVAL The arguments addr (and newaddr if MREMAP_FIXED was speci-
+ fied) are not multiples of the page size as returned by
+ sysconf().
+
+ The arguments len or newlen are not multiples of the page
+ size as returned by sysconf().
+
+ The flags argument is invalid (flags other than
+ MREMAP_MAYMOVE or MREMAP_FIXED were specified).
+
+ MREMAP_FIXED was specified without MREMAP_MAYMOVE.
+
+ The argument len or newlen has a value equal to 0.
+
+ The memory region specified by addr and len is not a
+ mapped file or anonymous memory.
+
+
+ ENOMEM There is insufficient room in the address space to effect
+ the mapping.
+
+ The mapping could not be locked in memory, if required by
+ mlockall(3C), because it would require more space than the
+ system is able to supply.
+
+ The operation would exceed RLIMIT_VMEM (see getrlimit(2)).
+
+
+ EOVERFLOW The file is a regular file and the mapping would exceed
+ the maximum offset established by the existing mapping to
+ the file.
+
+
+USAGE
+ Use of mremap() may reduce the amount of memory available to other mem-
+ ory allocation functions.
+
+ATTRIBUTES
+ See attributes(7) for descriptions of the following attributes:
+
+
+ +-----------------------------+-----------------------------+
+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+ +-----------------------------+-----------------------------+
+ |Interface Stability |Committed |
+ +-----------------------------+-----------------------------+
+ |MT-Level |Async-Signal-Safe |
+ +-----------------------------+-----------------------------+
+
+SEE ALSO
+ getrlimit(2), memcntl(2), mmap(2), mprotect(2), munmap(2), mlock-
+ all(3C), sysconf(3C), adi(7), attributes(7), resource-controls(7)
+
+HISTORY
+ The mremap() function was added in the Solaris 11.4.45 release.
+
+
+
+Oracle Solaris 11.4 18 Oct 2021 mremap(2)
diff -NurbBw 11.4.42/man2/open.2 11.4.45/man2/open.2
--- 11.4.42/man2/open.2 2022-05-17 14:50:13.585557042 -0700
+++ 11.4.45/man2/open.2 2022-05-17 14:50:56.488118675 -0700
@@ -517,6 +517,20 @@
sented correctly in an object of type off64_t.
+ EPERM The named file has the appendonly system attribute set
+ and oflag indicated the file should be opened for writ-
+ ing (O_WRONLY or O_RDWR) but did not have the O_APPEND
+ flag set.
+
+ The O_TRUNC flag was set for an existing file with a
+ non-zero size and one or more of the appendonly, read-
+ only, immutable, or rtime system attributes set.
+
+ The arguments specified creating a new file over an
+ existing file that has one or more of the immutable or
+ rtime system attributes set.
+
+
EROFS The named file resides on a read-only file system and
either O_WRONLY, O_RDWR, O_CREAT (if file does not
exist), or O_TRUNC is set in the oflag argument.
@@ -658,7 +672,7 @@
getrlimit(2), Intro(2), lseek(2), putmsg(2), read(2), setpflags(2),
stat(2), umask(2), write(2), attropen(3C), unlockpt(3C),
fcntl.h(3HEAD), stat.h(3HEAD), streamio(4I), connld(4M), attributes(7),
- lf64(7), privileges(7), standards(7), tpd(7)
+ lf64(7), privileges(7), standards(7), sysattr(7), tpd(7)
NOTES
Hierarchical Storage Management (HSM) file systems can sometimes cause
@@ -685,4 +699,4 @@
-Oracle Solaris 11.4 20 May 2020 open(2)
+Oracle Solaris 11.4 21 Mar 2022 open(2)
diff -NurbBw 11.4.42/man2/read.2 11.4.45/man2/read.2
--- 11.4.42/man2/read.2 2022-05-17 14:50:13.730656674 -0700
+++ 11.4.45/man2/read.2 2022-05-17 14:50:56.642644559 -0700
@@ -236,6 +236,8 @@
ERRORS
The read(), readv(), and pread() functions will fail if:
+ EACCES The file has the av_quarantined system attribute set.
+
EADI The buffer pointed to by buf or a buffer specified in the
iov array is enabled for ADI, and an ADI version mismatch is
@@ -359,8 +361,8 @@
SEE ALSO
chmod(2), creat(2), dup(2), fcntl(2), getmsg(2), Intro(2), ioctl(2),
lseek(2), open(2), pipe(2), streamio(4I), termio(4I), attributes(7),
- lf64(7), standards(7)
+ lf64(7), standards(7), sysattr(7)
-Oracle Solaris 11.4 06 May 2016 read(2)
+Oracle Solaris 11.4 21 Mar 2022 read(2)
diff -NurbBw 11.4.42/man2/rename.2 11.4.45/man2/rename.2
--- 11.4.42/man2/rename.2 2022-05-17 14:50:13.810504657 -0700
+++ 11.4.45/man2/rename.2 2022-05-17 14:50:56.799174858 -0700
@@ -125,6 +125,9 @@
denies write permissions; or write permission is denied
by a directory pointed to by old or new.
+ The file named by old has the av_quarantined system
+ attribute set.
+
EBUSY The new or old argument is a directory and the mount
point for a mounted file system.
@@ -191,6 +194,25 @@
reference a directory.
+ EPERM The file named by old or its parent directory has the
+ immutable or nounlink system attribute set.
+
+ The file named by old has the rtime system attribute
+ set.
+
+ The old parameter specifies a non-empty directory on a
+ filesystem with File Retention enabled.
+
+ An existing file named by new or the parent directory
+ named by new has the immutable or nounlink system
+ attribute set.
+
+ An existing file named by new has the rtime system
+ attribute set and the conditions of the filesystem's
+ retention policy for removing it are not met. See
+ retention.policy in the zfs(8) manual page.
+
+
EROFS The requested operation requires writing in a directory
on a read-only file system.
@@ -221,7 +243,8 @@
+-----------------------------+-----------------------------+
SEE ALSO
- chmod(2), link(2), unlink(2), attributes(7), fsattr(7), standards(7)
+ chmod(2), link(2), unlink(2), attributes(7), fsattr(7), standards(7),
+ sysattr(7)
NOTES
The system can deadlock if there is a loop in the file system graph.
@@ -235,4 +258,4 @@
-Oracle Solaris 11.4 17 Aug 2018 rename(2)
+Oracle Solaris 11.4 21 Mar 2022 rename(2)
diff -NurbBw 11.4.42/man2/rmdir.2 11.4.45/man2/rmdir.2
--- 11.4.42/man2/rmdir.2 2022-05-17 14:50:13.876954965 -0700
+++ 11.4.45/man2/rmdir.2 2022-05-17 14:50:56.856097485 -0700
@@ -95,6 +95,10 @@
ENOTDIR A component of the path prefix is not a directory.
+ EPERM The directory to be removed or the parent directory has
+ the immutable or nounlink system attribute set.
+
+
EROFS The directory entry to be removed is part of a read-
only file system.
@@ -114,8 +118,9 @@
+-----------------------------+-----------------------------+
SEE ALSO
- mkdir(1), rm(1), mkdir(2), attributes(7), privileges(7), standards(7)
+ mkdir(1), rm(1), mkdir(2), attributes(7), privileges(7), standards(7),
+ sysattr(7)
-Oracle Solaris 11.4 18 May 2007 rmdir(2)
+Oracle Solaris 11.4 21 Mar 2022 rmdir(2)
diff -NurbBw 11.4.42/man2/unlink.2 11.4.45/man2/unlink.2
--- 11.4.42/man2/unlink.2 2022-05-17 14:50:13.912238569 -0700
+++ 11.4.45/man2/unlink.2 2022-05-17 14:50:56.891998686 -0700
@@ -122,6 +122,14 @@
EPERM The named file is a directory; the implementation does
not support unlink() or unlinkat() on directories.
+ The file or the parent directory has the immutable or
+ nounlink system attribute set.
+
+ The file has the rtime system attribute set and the
+ conditions of the filesystem's retention policy for
+ removing it are not met. See retention.policy in the
+ zfs(8) manual page.
+
EROFS The directory entry to be unlinked is part of a read-
only file system.
@@ -156,8 +164,8 @@
SEE ALSO
rm(1), close(2), link(2), open(2), rmdir(2), remove(3C), attributes(7),
- fsattr(7), privileges(7)
+ fsattr(7), privileges(7), sysattr(7)
-Oracle Solaris 11.4 30 Nov 2015 unlink(2)
+Oracle Solaris 11.4 21 Mar 2022 unlink(2)
diff -NurbBw 11.4.42/man2/utime.2 11.4.45/man2/utime.2
--- 11.4.42/man2/utime.2 2022-05-17 14:50:14.033695781 -0700
+++ 11.4.45/man2/utime.2 2022-05-17 14:50:56.965569268 -0700
@@ -90,6 +90,14 @@
the effective set of the calling process, and times is
not NULL.
+ The arguments specify a change to the modification time
+ and the file has one or more of the immutable or rtime
+ system attributes set.
+
+ The file has the rtime system attribute set and the
+ arguments specify a change to the access time that
+ would cause the file's retention time to be reduced.
+
EROFS The file system containing the file is mounted read-
only.
@@ -111,8 +119,8 @@
SEE ALSO
futimens(2), stat(2), utimes(2), attributes(7), privileges(7), stan-
- dards(7)
+ dards(7), sysattr(7)
-Oracle Solaris 11.4 1 Sep 2009 utime(2)
+Oracle Solaris 11.4 21 Mar 2022 utime(2)
diff -NurbBw 11.4.42/man2/utimes.2 11.4.45/man2/utimes.2
--- 11.4.42/man2/utimes.2 2022-05-17 14:50:14.125939145 -0700
+++ 11.4.45/man2/utimes.2 2022-05-17 14:50:57.030858459 -0700
@@ -105,6 +105,14 @@
calling process does not have the appropriate privi-
leges.
+ The arguments specify a change to the modification time
+ and the file has one or more of the immutable or rtime
+ system attributes set.
+
+ The file has the rtime system attribute set and the
+ arguments specify a change to the access time that
+ would cause the file's retention time to be reduced.
+
EROFS The file system containing the file is read-only.
@@ -132,8 +140,9 @@
For utimes(), see standards(7).
SEE ALSO
- futimens(2), stat(2), utime(2), attributes(7), fsattr(7), standards(7)
+ futimens(2), stat(2), utime(2), attributes(7), fsattr(7), standards(7),
+ sysattr(7)
-Oracle Solaris 11.4 1 Sep 2009 utimes(2)
+Oracle Solaris 11.4 21 Mar 2022 utimes(2)
diff -NurbBw 11.4.42/man2/write.2 11.4.45/man2/write.2
--- 11.4.42/man2/write.2 2022-05-17 14:50:14.160422199 -0700
+++ 11.4.45/man2/write.2 2022-05-17 14:50:57.077352434 -0700
@@ -331,6 +330,13 @@
ENXIO A hangup occurs on the stream being written to.
+ EPERM The file has the appendonly system attribute set but the
+ file descriptor does not have the O_APPEND flag set.
+
+ The file has one or more of the readonly, immutable, or
+ rtime system attributes set.
+
+
EPIPE An attempt is made to write to a pipe or a FIFO that is not
open for reading by any process, or that has only one end
open (or to a file descriptor created by socket, using type
@@ -409,8 +415,8 @@
SEE ALSO
chmod(2), creat(2), dup(2), fcntl(2), getrlimit(2), Intro(2), ioctl(2),
lseek(2), open(2), pipe(2), ulimit(2), streamio(4I), attributes(7),
- lf64(7), standards(7)
+ lf64(7), standards(7), sysattr(7)
-Oracle Solaris 11.4 27 Nov 2017 write(2)
+Oracle Solaris 11.4 21 Mar 2022 write(2)
diff -NurbBw 11.4.42/man3c/b64_encode.3c 11.4.45/man3c/b64_encode.3c
--- 11.4.42/man3c/b64_encode.3c 2022-05-17 14:50:14.364247315 -0700
+++ 11.4.45/man3c/b64_encode.3c 2022-05-17 14:50:57.347819781 -0700
@@ -27,6 +27,11 @@
const char *BASE32_HEX_ALPHABET;
DESCRIPTION
+ These functions convert sequences of bytes to and from single-byte
+ character strings using the Base64 and Base32 encoding schemes defined
+ in RFC 4648. By default, the characters used in the strings are a sub-
+ set of the US-ASCII printable character set.
+
b64_encode(), b32_encode()
The argument inbuf points to an array of bytes, the argument outbuf
@@ -74,14 +79,13 @@
tain the decoding of the string pointed to by inbuf.
-
RETURN VALUES
Upon successful completion, the functions return the number of bytes
- written or -1 in an error condition. If outbuf is a null pointer and
- outbufsz is 0, then instead of returning the number of bytes written,
- an estimate of the number of bytes required to hold the output string
- or data is returned. This estimate is guaranteed to be at least as
- large as the size of the actual output.
+ written. The functions return -1 in an error condition. If outbuf is a
+ null pointer and outbufsz is 0, then instead of returning the number of
+ bytes written, an estimate of the number of bytes required to hold the
+ output string or data is returned. This estimate is guaranteed to be at
+ least as large as the size of the actual output.
ERRORS
The b64_encode() and b32_encode() functions will fail if:
@@ -117,14 +117,20 @@
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
+ |Standard |None |
+ +-----------------------------+-----------------------------+
SEE ALSO
- RFC 4648 The Base16, Base32, and Base64 Data Encodings
+ uuencode(1C), ascii(7)
+
+
+ Josefsson, S. RFC 4648: The Base16, Base32, and Base64 Data Encodings.
+ October 2006. https://tools.ietf.org/html/rfc4648
HISTORY
The b64_encode(), b64_decode(), b32_encode(), and b32_decode() func-
- tions were added to Oracle Solaris in the 11.4 release.
+ tions were added to Oracle Solaris in the 11.4.0 release.
-Oracle Solaris 11.4 9 Jul 2018 b64_encode(3C)
+Oracle Solaris 11.4 28 Feb 2022 b64_encode(3C)
diff -NurbBw 11.4.42/man3c/bstring.3c 11.4.45/man3c/bstring.3c
--- 11.4.42/man3c/bstring.3c 2022-05-17 14:50:14.442167374 -0700
+++ 11.4.45/man3c/bstring.3c 2022-05-17 14:50:57.440442460 -0700
@@ -46,9 +46,14 @@
longer needed sensitive data to ensure that it does not remain accessi-
ble in process memory.
+USAGE
+ These functions are provided for compatibility with older code. The
+ memcpy(), memcmp(), and memset() functions defined by the C standards
+ are more portable and preferred in newly written code.
+
WARNINGS
- The bcopy() function takes parameters backwards from memcpy(). See mem-
- ory(3C).
+ The bcopy() function takes the first two parameters in the opposite
+ order of memcpy(). See memory(3C).
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -61,12 +66,38 @@
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
- |Standard |See standards(7). |
+ |Standard |See below |
+ +-----------------------------+-----------------------------+
+
+ Standard
+ See standards(7) for descriptions of the following standards:
+
+
+ +-----------------------------+-----------------------------+
+ | INTERFACES | APPLICABLE STANDARDS |
+ +-----------------------------+-----------------------------+
+ |bcopy(), bcmp(), bzero() | POSIX.1-2001 through |
+ | | 2004, |
+ | | SUS through SUSv3, |
+ | | XPG4v2 through XPG6 |
+ | | |
+ +-----------------------------+-----------------------------+
+ |explicit_bzero() |None |
+-----------------------------+-----------------------------+
SEE ALSO
- timingsafe_bcmp(3C), memory(3C), attributes(7), standards(7)
+ timingsafe_bcmp(3C), freezero(3C), memory(3C), string(3C),
+ attributes(7), standards(7)
+
+HISTORY
+ The explicit_bzero() function first appeared in OpenBSD 5.5 and was
+ added to Oracle Solaris in the Solaris 11.4.12 release.
+
+
+ The bcopy(), bcmp(), and bzero() functions were added to libc in the
+ Solaris 2.5 release. In Solaris 2 releases prior to 2.5 they were in
+ the libucb library.
-Oracle Solaris 11.4 16 April 2019 bstring(3C)
+Oracle Solaris 11.4 28 Feb 2022 bstring(3C)
diff -NurbBw 11.4.42/man3c/drand48.3c 11.4.45/man3c/drand48.3c
--- 11.4.42/man3c/drand48.3c 2022-05-17 14:50:14.603466269 -0700
+++ 11.4.45/man3c/drand48.3c 2022-05-17 14:50:57.567956238 -0700
@@ -12,19 +12,19 @@
double drand48(void)
- double erand48(unsigned short x(i)[3]);
+ double erand48(unsigned short xsubi[3]);
long lrand48(void)
- long nrand48(unsigned short x(i)[3]);
+ long nrand48(unsigned short xsubi[3]);
long mrand48(void)
- long jrand48(unsigned short x(i)[3]);
+ long jrand48(unsigned short xsubi[3]);
void srand48(long seedval);
@@ -90,9 +90,9 @@
lrand48(), or mrand48() is called. (Although it is not recommended
practice, constant default initializer values will be supplied automat-
ically if drand48(), lrand48(), or mrand48() is called without a prior
- call to an initialization entry point.) Functions erand48(),
- nrand48(), and jrand48() do not require an initialization entry point
- to be called first.
+ call to an initialization entry point.) Functions erand48(), nrand48(),
+ and jrand48() do not require an initialization entry point to be called
+ first.
All the routines work by generating a sequence of 48-bit integer val-
@@ -103,8 +103,8 @@
The parameter m = 2^48; hence 48-bit integer arithmetic is performed.
- Unless lcong48() has been invoked, the multiplier value aand the addend
- value care given by
+ Unless lcong48() has been invoked, the multiplier value a and the
+ addend value c are given by
a = 5DEECE66D(16) = 273673163155(8)
c = B(16) = 13(8)
@@ -187,10 +187,12 @@
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
+ |Standard |See standards(7). |
+ +-----------------------------+-----------------------------+
SEE ALSO
getrandom(2), rand(3C), random(4D), attributes(7), standards(7)
-Oracle Solaris 11.4 9 Jun 2018 drand48(3C)
+Oracle Solaris 11.4 10 Mar 2022 drand48(3C)
diff -NurbBw 11.4.42/man3c/ffs.3c 11.4.45/man3c/ffs.3c
--- 11.4.42/man3c/ffs.3c 2022-05-17 14:50:14.741434313 -0700
+++ 11.4.45/man3c/ffs.3c 2022-05-17 14:50:57.682096711 -0700
@@ -12,6 +12,8 @@
int ffs(int value);
+ #include <string.h>
+
int ffsl(long value);
@@ -31,14 +33,14 @@
value and return the position of that bit.
- The fls(), fssl(), and flsll() functions find the last bit set in value
+ The fls(), flsl(), and flsll() functions find the last bit set in value
and return the position of that bit.
Bits are numbered starting at one (the least significant bit).
RETURN VALUES
- These functions return the position of the first bit set, or 0 if no
+ These functions return the position of the requested bit, or 0 if no
bits are set in value.
ERRORS
@@ -55,12 +57,40 @@
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
- |Standard |See standards(7). |
+ |Standard |See below |
+ +-----------------------------+-----------------------------+
+
+ Standard
+ See standards(7) for descriptions of the following standards:
+
+
+ +-----------------------------+-----------------------------+
+ | INTERFACES | APPLICABLE STANDARDS |
+ +-----------------------------+-----------------------------+
+ |ffs() | POSIX.1-2001 through |
+ | | 2008, |
+ | | SUS through SUSv4, |
+ | | XPG4v2 through XPG7 |
+ | | |
+ +-----------------------------+-----------------------------+
+ |ffsl(), ffsll(), fls(), |None |
+ |flsl(), flsll() | |
+-----------------------------+-----------------------------+
SEE ALSO
attributes(7), standards(7)
+HISTORY
+ The ffsl(), fls(), and flsl() functions appeared in FreeBSD 5.3. The
+ ffsll() and flsll() functions appeared in FreeBSD 7.1. All of these
+ functions were added to Oracle Solaris in the Solaris 11.0 release.
+
+
+ The ffs() function appeared in 4.3BSD. It was added to Solaris in the
+ Solaris 2.0 release, with a prototype in the <string.h> header. The
+ prototype for ffs() was added to the <strings.h> header in the Solaris
+ 2.6 release as required by the XPG4v2 standard.
+
-Oracle Solaris 11.4 25 Mar 2020 ffs(3C)
+Oracle Solaris 11.4 28 Feb 2022 ffs(3C)
diff -NurbBw 11.4.42/man3c/fgetattr.3c 11.4.45/man3c/fgetattr.3c
--- 11.4.42/man3c/fgetattr.3c 2022-05-17 14:50:14.827226189 -0700
+++ 11.4.45/man3c/fgetattr.3c 2022-05-17 14:50:57.764836138 -0700
@@ -74,6 +74,7 @@
XATTR_VIEW_READONLY A_FSID uint64_value
A_OPAQUE boolean_value
A_AV_SCANSTAMP uint8_array[]
+ A_NORETAIN boolean_value
XATTR_VIEW_READWRITE A_READONLY boolean_value
A_SENSITIVE boolean_value
A_HIDDEN boolean_value
@@ -92,6 +93,7 @@
A_GROUPSID nvlist composed of
uint32_value and
string
+ A_RETENTIONTIME uint64_array[2]
RETURN VALUES
@@ -125,6 +127,24 @@
EPERM There are insufficient privileges to manipulate attributes.
+
+ The fsetattr() and setattrat() functions will fail if:
+
+ EINVAL One of the specified attributes cannot be set on the type
+ of file specified by the parameters. See sysattr(7) for
+ the requirements to change each attribute.
+
+
+ EOVERFLOW Adding the current number of seconds since the epoch to
+ the retention period default is too large to fit into an
+ unsigned 64-bit variable.
+
+
+ EPERM The caller does not have the required privileges to make
+ the specified attribute changes. See sysattr(7) for the
+ requirements to change each attribute.
+
+
EXAMPLES
Example 1 Obtain an nvlist of readonly system attributes for an open
file object.
@@ -239,8 +257,8 @@
SEE ALSO
creat(2), dup(2), fcntl(2), fstat(2), fstatat(2), open(2), pipe(2),
- libnvpair(3LIB), attributes(7), fsattr(7)
+ libnvpair(3LIB), attributes(7), fsattr(7), sysattr(7)
-Oracle Solaris 11.4 17 Aug 2018 fgetattr(3C)
+Oracle Solaris 11.4 21 Mar 2022 fgetattr(3C)
diff -NurbBw 11.4.42/man3c/getnameinfo.3c 11.4.45/man3c/getnameinfo.3c
--- 11.4.42/man3c/getnameinfo.3c 2022-05-17 14:50:15.100311705 -0700
+++ 11.4.45/man3c/getnameinfo.3c 2022-05-17 14:50:57.987165039 -0700
@@ -114,6 +114,11 @@
NI_NAMEREQD is set and the host's name cannot be
located, or both nodename and servname were NULL.
+ The sa parameter has a family of AF_INET6 and a non-
+ zero value in the sin6_scope_id field, but the appro-
+ priate bits of the address to mark it as a locally
+ scoped address are not set.
+
EAI_SYSTEM A system error occurred. The error code can be found in
errno.
@@ -172,4 +177,4 @@
-Oracle Solaris 11.4 20 Jan 2021 getnameinfo(3C)
+Oracle Solaris 11.4 9 Mar 2022 getnameinfo(3C)
diff -NurbBw 11.4.42/man3c/hsearch.3c 11.4.45/man3c/hsearch.3c
--- 11.4.42/man3c/hsearch.3c 2022-05-17 14:50:15.209533723 -0700
+++ 11.4.45/man3c/hsearch.3c 2022-05-17 14:50:58.094696654 -0700
@@ -20,18 +20,18 @@
The hsearch() function is a hash-table search routine generalized from
Knuth (6.4) Algorithm D. It returns a pointer into a hash table indi-
cating the location at which an entry can be found. The comparison
- function used by hsearch() is strcmp() (see string(3C)). The item argu-
- ment is a structure of type ENTRY (defined in the <search.h> header)
- containing two pointers: item.key points to the comparison key, and
- item.data points to any other data to be associated with that key.
- (Pointers to types other than void should be cast to pointer-to-void.)
- The action argument is a member of an enumeration type ACTION (defined
- in <search.h>) indicating the disposition of the entry if it cannot be
- found in the table. ENTER indicates that the item should be inserted in
- the table at an appropriate point. Given a duplicate of an existing
- item, the new item is not entered and hsearch() returns a pointer to
- the existing item. FIND indicates that no entry should be made. Unsuc-
- cessful resolution is indicated by the return of a null pointer.
+ function used by hsearch() is strcmp(3C). The item argument is a struc-
+ ture of type ENTRY (defined in the <search.h> header) containing two
+ pointers: item.key points to the comparison key, and item.data points
+ to any other data to be associated with that key. (Pointers to types
+ other than void should be cast to pointer-to-void.) The action argument
+ is a member of an enumeration type ACTION (defined in <search.h>) indi-
+ cating the disposition of the entry if it cannot be found in the table.
+ ENTER indicates that the item should be inserted in the table at an
+ appropriate point. Given a duplicate of an existing item, the new item
+ is not entered and hsearch() returns a pointer to the existing item.
+ FIND indicates that no entry should be made. Unsuccessful resolution is
+ indicated by the return of a null pointer.
The hcreate() function allocates sufficient space for the table, and
@@ -78,7 +78,9 @@
int age, room; /* other than the key */
};
#define NUM_EMPL 5000 /* # of elements in search table */
- main( )
+
+ int
+ main(void)
{
/* space to store strings */
char string_space[NUM_EMPL*20];
@@ -139,7 +141,7 @@
+-----------------------------+-----------------------------+
SEE ALSO
- bsearch(3C), lsearch(3C), malloc(3C), string(3C), tsearch(3C), mal-
+ bsearch(3C), lsearch(3C), malloc(3C), strcmp(3C), tsearch(3C), mal-
loc(3MALLOC), attributes(7), standards(7)
@@ -148,4 +150,4 @@
-Oracle Solaris 11.4 17 Aug 2018 hsearch(3C)
+Oracle Solaris 11.4 28 Feb 2022 hsearch(3C)
diff -NurbBw 11.4.42/man3c/index.3c 11.4.45/man3c/index.3c
--- 11.4.42/man3c/index.3c 2022-05-17 14:50:15.235192046 -0700
+++ 11.4.45/man3c/index.3c 2022-05-17 14:50:58.123644550 -0700
@@ -30,16 +30,9 @@
part of the string.
USAGE
- On most modern computer systems, you can not use a null pointer to
- indicate a null string. A null pointer is an error and results in an
- abort of the program. If you wish to indicate a null string, you must
- use a pointer that points to an explicit null string. On some machines
- and with some implementations of the C programming language, a null
- pointer, if dereferenced, would yield a null string. Though often used,
- this practice is not always portable. Programmers using a null pointer
- to represent an empty string should be aware of this portability issue.
- Even on machines where dereferencing a null pointer does not cause an
- abort of the program, it does not necessarily yield a null string.
+ These functions are provided for compatibility with older code. The
+ strchr() and strrchr() functions defined by the C standards are more
+ portable and preferred in newly written code.
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -48,12 +41,24 @@
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
- |Interface Stability |Standard |
+ |Interface Stability |Committed |
+ +-----------------------------+-----------------------------+
+ |MT-Level |MT-Safe |
+ +-----------------------------+-----------------------------+
+ |Standard | POSIX.1-2001, |
+ | | SUS through SUSv3, |
+ | | XPG4v2 through XPG6 |
+ | | |
+-----------------------------+-----------------------------+
SEE ALSO
- string(3C), bstring(3C), malloc(3C), standards(7), attributes(7)
+ bstring(3C), strchr(3C), attributes(7), standards(7)
+
+HISTORY
+ The index() and rindex() functions were added to libc in the Solaris
+ 2.5 release. In Solaris 2 releases prior to 2.5 they were in the libucb
+ library.
-Oracle Solaris 11.4 24 Jul 2002 index(3C)
+Oracle Solaris 11.4 28 Feb 2022 index(3C)
diff -NurbBw 11.4.42/man3c/lsearch.3c 11.4.45/man3c/lsearch.3c
--- 11.4.42/man3c/lsearch.3c 2022-05-17 14:50:15.497431070 -0700
+++ 11.4.45/man3c/lsearch.3c 2022-05-17 14:50:58.301187000 -0700
@@ -84,7 +84,8 @@
#define TABSIZE 50
#define ELSIZE 120
- main()
+ int
+ main(void)
{
char line[ELSIZE]; /* buffer to hold input string */
char tab[TABSIZE][ELSIZE]; /* table of strings */
@@ -115,7 +116,7 @@
+-----------------------------+-----------------------------+
SEE ALSO
- bsearch(3C), hsearch(3C), string(3C), tsearch(3C), attributes(7), stan-
+ bsearch(3C), hsearch(3C), strcmp(3C), tsearch(3C), attributes(7), stan-
dards(7)
@@ -124,4 +125,4 @@
-Oracle Solaris 11.4 17 Aug 2018 lsearch(3C)
+Oracle Solaris 11.4 28 Feb 2022 lsearch(3C)
diff -NurbBw 11.4.42/man3c/memory.3c 11.4.45/man3c/memory.3c
--- 11.4.42/man3c/memory.3c 2022-05-17 14:50:15.899663416 -0700
+++ 11.4.45/man3c/memory.3c 2022-05-17 14:50:58.662299992 -0700
@@ -4,9 +4,7 @@
NAME
memory, memccpy, memchr, memcmp, memcpy, memmove, memset, explicit_mem-
- set, memmem - memory operations
- memcpy_s, memmove_s, memset_s - memory operations with additional
- safety checks
+ set, memmem, memcpy_s, memmove_s, memset_s - memory operations
SYNOPSIS
#include <string.h>
@@ -36,7 +34,7 @@
void *memmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen);
-
+ C11 Bounds Checking Interfaces
#define __STDC_WANT_LIB_EXT1__ 1
#include <string.h>
@@ -64,13 +62,18 @@
These functions operate as efficiently as possible on memory areas
(arrays of bytes bounded by a count, not terminated by a null charac-
ter). They do not check for the overflow of any receiving memory area.
+ Except for the C11 Bounds Checking Interfaces, they do not check for
+ null pointers, and programs may crash if passing null or otherwise
+ invalid pointers to these functions. Use of adi(7) may help in detect-
+ ing invalid pointer usage in code.
The memccpy() function copies bytes from memory area s2 into s1, stop-
ping after the first occurrence of c (converted to an unsigned char)
has been copied, or after n bytes have been copied, whichever comes
first. It returns a pointer to the byte after the copy of c in s1, or a
- null pointer if c was not found in the first n bytes of s2.
+ null pointer if c was not found in the first n bytes of s2. If copying
+ takes place between objects that overlap, the behavior is undefined.
The memchr() function returns a pointer to the first occurrence of c
@@ -81,14 +84,17 @@
The memcmp() function compares its arguments, looking at the first n
bytes (each interpreted as an unsigned char), and returns an integer
- less than, equal to, or greater than 0, according as s1 is lexicograph-
- ically less than, equal to, or greater than s2 when taken to be
- unsigned characters.
+ less than, equal to, or greater than 0, according to whether s1 is lex-
+ icographically less than, equal to, or greater than s2 when taken to be
+ unsigned characters. The execution time of the memcmp() function may
+ depend on the sequences being compared. For uses such as cryptography
+ where invariant timing is desired, see timingsafe_memcmp(3C) instead.
The memcpy() function copies n bytes from memory area s2 to s1. It
returns s1. If copying takes place between objects that overlap, the
- behavior is undefined.
+ behavior is undefined - the memmove() function should be used instead
+ for overlapping copies.
The memmove() function copies n bytes from memory area s2 to memory
@@ -113,7 +119,7 @@
or NULL if the substring is not found. If needlelen is zero, haystack
is returned. If haystacklen is less than needlelen, NULL is returned.
-
+ C11 Bounds Checking Interfaces
The memcpy_s(), memmove_s(), and memset_s() functions are part of the
C11 bounds checking interfaces specified in the C11 standard, Annex K.
Each provide equivalent functionality to the respective memcpy(), mem-
@@ -122,14 +128,20 @@
in the C11 standard. See runtime_constraint_handler(3C) and
INCITS/ISO/IEC 9899:2011.
-RETURN VALUES
+
If no runtime-constraint violation is detected, the memcpy_s(), mem-
- move_s(), and memset_s() functions return zero. Otherwise they return a
- non-zero value.
+ move_s(), and memset_s() functions return zero. If a runtime constraint
+ violation is detected and the handler returns, they return a non-zero
+ value.
ERRORS
- The memcpy_s() function will fail if:
+ No errors are defined for the memccpy(), memchr(), memcmp(), memcpy(),
+ memmove(), memset(), explicit_memset(), or memmem() functions. The
+ behavior of these functions is undefined if null or invalid pointers
+ are passed for any of their pointer arguments.
+
+ The memcpy_s() function will fail if:
EINVAL NULL pointer passed or source and destination overlap.
@@ -178,13 +185,13 @@
+-----------------------------+-----------------------------+
|MT-Level |See below |
+-----------------------------+-----------------------------+
- |Standard |See standards(7). |
+ |Standard |See below |
+-----------------------------+-----------------------------+
-
- The memcpy(), memccpy(), memchr(), memcmp(), memcpy(), memmove(), mem-
- set(), explicit_memset(), and memmem() functions can be used safely in
- multithreaded applications.
+ MT-Level
+ The memccpy(), memchr(), memcmp(), memcpy(), memmove(), memset(),
+ explicit_memset(), and memmem() functions can be used safely in multi-
+ threaded applications.
The memcpy_s(), memmove_s(), and memset_s() functions cannot be used
@@ -192,9 +199,40 @@
handler. For more information, see the runtime_constraint_handler(3C)
man page.
+ Standard
+ See standards(7) for descriptions of the following standards:
+
+
+ +----------------------------+-----------------------------------+
+ | INTERFACES | APPLICABLE STANDARDS |
+ +----------------------------+-----------------------------------+
+ |memchr(), memcmp(), | C89 through C11, |
+ |memcpy(), memset() | POSIX.1-1990 through 2008, |
+ | | SUS through SUSv4, |
+ | | XPG1 through XPG7 |
+ | | |
+ +----------------------------+-----------------------------------+
+ |memmove() | C89 through C11, |
+ | | POSIX.1-1990 through 2008, |
+ | | SUS through SUSv4, |
+ | | XPG4 through XPG7 |
+ | | |
+ +----------------------------+-----------------------------------+
+ |memccpy() | POSIX.1-2001 through 2008, |
+ | | SUS through SUSv4, |
+ | | XPG1 through XPG7 |
+ | | |
+ +----------------------------+-----------------------------------+
+ |memcpy_s(), memmove_s(), | C11 Annex K |
+ |memset_s() | |
+ +----------------------------+-----------------------------------+
+ |explicit_memset(), memmem() | None |
+ +----------------------------+-----------------------------------+
+
SEE ALSO
- timingsafe_memcmp(3C), string(3C), attributes(7), standards(7), run-
- time_constraint_handler(3C)
+ freezero(3C), string(3C), timingsafe_memcmp(3C), wmemchr(3C), wmem-
+ cmp(3C), wmemcpy(3C), wmemmove(3C), wmemset(3C), attributes(7), stan-
+ dards(7), runtime_constraint_handler(3C)
NOTES
Overlap between objects being copied can arise even when their (vir-
@@ -202,6 +240,22 @@
memory-mapping overlapping portions of the same underlying file, or of
attaching the same shared memory segment more than once.
+HISTORY
+ The explicit_memset() function was added to Oracle Solaris in the
+ Solaris 11.4.12 release.
+
+
+ The memcpy_s(), memmove_s(), and memset_s() functions were added to
+ Oracle Solaris in the Solaris 11.4.0 release.
+
+
+ The memmem() function was added to Oracle Solaris in the Solaris 11.0.0
+ release.
+
+
+ The memccpy(), memchr(), memcmp(), memcpy(), memmove(), annd memset()
+ functions have been included in Solaris since the Solaris 2.0 release.
+
-Oracle Solaris 11.4 3 July 2020 memory(3C)
+Oracle Solaris 11.4 28 Feb 2022 memory(3C)
diff -NurbBw 11.4.42/man3c/posix_fallocate.3c 11.4.45/man3c/posix_fallocate.3c
--- 11.4.42/man3c/posix_fallocate.3c 2022-05-17 14:50:16.152649859 -0700
+++ 11.4.45/man3c/posix_fallocate.3c 2022-05-17 14:50:58.953178883 -0700
@@ -76,6 +76,10 @@
tem storage media.
+ EPERM The file has one or more of the appendonly, readonly,
+ immutable, or rtime system attributes set.
+
+
ESPIPE The fd argument is associated with a pipe or FIFO.
@@ -99,8 +103,8 @@
SEE ALSO
chmod(2), creat(2), open(2), unlink(2), ftruncate(3C), spawn.h(3HEAD),
- attributes(7), standards(7)
+ attributes(7), standards(7), sysattr(7)
-Oracle Solaris 11.4 17 Aug 2018 posix_fallocate(3C)
+Oracle Solaris 11.4 21 Mar 2022 posix_fallocate(3C)
diff -NurbBw 11.4.42/man3c/sendfile.3c 11.4.45/man3c/sendfile.3c
--- 11.4.42/man3c/sendfile.3c 2022-05-17 14:50:16.264696404 -0700
+++ 11.4.45/man3c/sendfile.3c 2022-05-17 14:50:59.060009626 -0700
@@ -83,6 +83,14 @@
EOPNOTSUPP The socket type is not supported.
+ EPERM The output file has the appendonly system attribute set
+ but the out_fd file descriptor does not have the
+ O_APPEND flag set.
+
+ The output file has one or more of the readonly,
+ immutable, or rtime system attributes set.
+
+
EPIPE The out_fd argument is no longer connected to the peer
endpoint.
@@ -209,7 +217,7 @@
+-----------------------------+-----------------------------+
SEE ALSO
- open(2), sendfilev(3C), socket(3C), attributes(7), lf64(7)
+ open(2), sendfilev(3C), socket(3C), attributes(7), lf64(7), sysattr(7)
HISTORY
The sendfile() function was added to Oracle Solaris in the Solaris 9
@@ -217,4 +225,4 @@
-Oracle Solaris 11.4 2 Feb 2021 sendfile(3C)
+Oracle Solaris 11.4 21 Mar 2022 sendfile(3C)
diff -NurbBw 11.4.42/man3c/sendfilev.3c 11.4.45/man3c/sendfilev.3c
--- 11.4.42/man3c/sendfilev.3c 2022-05-17 14:50:16.311749644 -0700
+++ 11.4.45/man3c/sendfilev.3c 2022-05-17 14:50:59.094365959 -0700
@@ -129,6 +129,14 @@
so that the call may be retried.
+ EPERM The output file has the appendonly system attribute set
+ but the fildes file descriptor does not have the
+ O_APPEND flag set.
+
+ The output file has one or more of the readonly,
+ immutable, or rtime system attributes set.
+
+
EPIPE The fildes argument is a socket that has been shut down
for writing.
@@ -187,7 +195,7 @@
+-----------------------------+-----------------------------+
SEE ALSO
- open(2), writev(2), sendfile(3C), socket(3C), attributes(7)
+ open(2), writev(2), sendfile(3C), socket(3C), attributes(7), sysattr(7)
HISTORY
The sendfilev() function was added to Oracle Solaris in the Solaris 8
@@ -195,4 +203,4 @@
-Oracle Solaris 11.4 2 Feb 2021 sendfilev(3C)
+Oracle Solaris 11.4 21 Mar 2022 sendfilev(3C)
diff -NurbBw 11.4.42/man3c/strcat.3c 11.4.45/man3c/strcat.3c
--- 11.4.42/man3c/strcat.3c 2022-05-17 14:50:16.765840853 -0700
+++ 11.4.45/man3c/strcat.3c 2022-05-17 14:50:59.533732828 -0700
@@ -1,31 +1,13 @@
-Standard C Library Functions string(3C)
+Standard C Library Functions strcat(3C)
NAME
- string, strcasecmp, strncasecmp, strcasecmp_l, strncasecmp_l, strcat,
- strncat, strlcat, strchr, strrchr, strchrnul, strcmp, strncmp, strcpy,
- strncpy, strlcpy, stpcpy, stpncpy, strcspn, strspn, strdup, strndup,
- strdupa, strndupa, strlen, strnlen, strpbrk, strsep, strstr, strnstr,
- strcasestr, strtok, strtok_r - string operations
- strcpy_s, strncpy_s, strcat_s, strncat_s, strtok_s, strerror_s, str-
- errorlen_s, strnlen_s - string operations with additional safety checks
+ strcat, strncat, strlcat, strcpy, strncpy, strlcpy, stpcpy, stpncpy,
+ strcpy_s, strncpy_s, strcat_s, strncat_s - string copying and concate-
+ nation operations
SYNOPSIS
- #include <strings.h>
-
- int strcasecmp(const char *s1, const char *s2);
-
-
- int strncasecmp(const char *s1, const char *s2, size_t n);
-
-
- int strcasecmp_l(const char *s1, const char *s2, locale_t locale);
-
-
- int strncasecmp_l(const char *s1, const char *s2, size_t n, locale_t locale);
-
-
#include <string.h>
char *strcat(char *restrict s1, const char *restrict s2);
@@ -37,21 +19,6 @@
size_t strlcat(char *dst, const char *src, size_t dstsize);
- char *strchr(const char *s, int c);
-
-
- char *strrchr(const char *s, int c);
-
-
- char *strchrnul(const char *s, int c);
-
-
- int strcmp(const char *s1, const char *s2);
-
-
- int strncmp(const char *s1, const char *s2, size_t n);
-
-
char *strcpy(char *restrict s1, const char *restrict s2);
@@ -66,54 +33,9 @@
char *stpncpy(char *restrict s1, const char *restrict s2, size_t n);
-
- size_t strcspn(const char *s1, const char *s2);
-
-
- size_t strspn(const char *s1, const char *s2);
-
-
- char *strdup(const char *s);
-
-
- char *strndup(const char *s, size_t size);
-
-
- char *strdupa(const char *s);
-
-
- char *strndupa(const char *s, size_t size);
-
-
- size_t strlen(const char *s);
-
-
- size_t strnlen(const char *s, size_t n);
-
-
- char *strpbrk(const char *s1, const char *s2);
-
-
- char *strsep(char **stringp, const char *delim);
-
-
- char *strstr(const char *s1, const char *s2);
-
-
- char *strnstr(const char *s1, const char *s2, size_t n);
-
-
- char *strcasestr(const char *s1, const char *s2);
-
-
- char *strtok(char *restrict s1, const char *restrict s2);
-
-
- char *strtok_r(char *s1, const char *s2, char **lasts);
-
-
+ C11 Bounds Checking Interfaces
#define __STDC_WANT_LIB_EXT1__ 1
- #include <stdlib.h>
+ #include <string.h>
errno_t strcpy_s(char *restrict s1, rsize_t s1max,
const char *restrict s2);
@@ -130,75 +52,29 @@
errno_t strncat_s(char *restrict s1, rsize_t s1max,
const char *restrict s2, rsize_t n);
-
- char *strtok_s(char *restrict s1, rsize_t *restrict s1max,
- const char *restrict s2, char **restrict ptr);
-
-
- errno_t strerror_s(char *s, rsize_t maxsize, errno_t errnum);
-
-
- size_t strerrorlen_s(errno_t errnum);
-
-
- size_t strnlen_s(const char *s, size_t maxsize);
-
- ISO C++
- #include <string.h>
-
- const char *strchr(const char *s, int c);
-
-
- const char *strpbrk(const char *s1, const char *s2);
-
-
- const char *strrchr(const char *s, int c);
-
-
- const char *strstr(const char *s1, const char *s2);
-
-
- #include <cstring>
-
- char *std::strchr(char *s, int c);
-
-
- char *std::strpbrk(char *s1, const char *s2);
-
-
- char *std::strrchr(char *s, int c);
-
-
- char *std::strstr(char *s1, const char *s2);
-
DESCRIPTION
- The arguments s, s1, and s2 point to strings (arrays of characters ter-
- minated by a null character). The strcat(), strncat(), strlcat(), str-
- cpy(), strncpy(), strlcpy(), strsep(), strtok(), and strtok_r() func-
- tions all alter their first argument. Additionally, the strcat() and
- strcpy() functions do not check for overflow of the array.
-
- strcasecmp(), strncasecmp()
- The strcasecmp() and strncasecmp() functions are case-insensitive ver-
- sions of strcmp() and strncmp() respectively, described below. They
- ignore differences in case when comparing lower and uppercase charac-
- ters, using the current locale of the process to determine the case of
- the characters.
-
- strcasecmp_l(), strncasecmp_l()
- The strcasecmp_l() and strncasecmp_l() functions are versions of str-
- casecmp() and strncasecmp() respectively. They use locale represented
- by <locale>, instead of current locale of the process.
-
-
- The behavior is undefined if the <locale> argument is the special
- locale object LC_GLOBAL_LOCALE or is not a valid locale object handle.
+ These functions copy data from one string (array of characters) to
+ another. Depending on the function, strings may be either terminated by
+ a null character or consist of a length of n bytes. All character
+ counts are measured in individual bytes, even if a string with multi-
+ byte characters is used, which may result in copying only part of a
+ multibyte character if the full character does not fit within the byte
+ count specified. They do not check for null pointers, and programs may
+ crash if passing null or otherwise invalid pointers to these functions,
+ or specifying sizes larger than the memory allocation in use for the
+ string. Use of adi(7) may help in detecting buffer overflows or invalid
+ pointer usage in code.
+
+
+ The strcat(), stpcpy(), and strcpy() functions do not check for over-
+ flow of the array. Use of one of the bounds-checking variants is recom-
+ mended instead of those functions.
strcat(), strncat(), strlcat()
The strcat() function appends a copy of string s2, including the termi-
nating null character, to the end of string s1. The strncat() function
- appends at most n characters. Each returns a pointer to the null-termi-
- nated result. The initial character of s2 overrides the null character
+ appends at most n bytes. Each returns a pointer to the null-terminated
+ result. The initial character of s2 is written over the null character
at the end of s1. If copying takes place between objects that overlap,
the behavior of strcat(), strncat(), and strlcat() is undefined.
@@ -212,39 +88,13 @@
initial character of src will override the null character at the end of
dst. If the string pointed to by dst is longer than dstsize bytes when
strlcat() is called, the string pointed to by dst will not be changed.
- The function returns min{dstsize,strlen(dst)}+ strlen(src). Buffer
- overflow can be checked as follows:
+ The function returns min{dstsize, strlen(dst)} + strlen(src). Insuffi-
+ cient space can be checked for as follows:
if (strlcat(dst, src, dstsize) >= dstsize)
return -1;
- strchr(), strrchr(), strchrnul()
- The strchr() function returns a pointer to the first occurrence of c
- (converted to a char) in string s, or a null pointer if c does not
- occur in the string.
-
-
- The strrchr() function returns a pointer to the last occurrence of c.
- The null character terminating a string is considered to be part of the
- string.
-
-
- The strchrnul() function is similar to strchr() except that if c is not
- found in s, it returns a pointer to the null byte at the end of s,
- rather than NULL.
-
- strcmp(), strncmp()
- The strcmp() function compares two strings byte-by-byte, according to
- the ordering of your machine's character set. The function returns an
- integer greater than, equal to, or less than 0, if the string pointed
- to by s1 is greater than, equal to, or less than the string pointed to
- by s2 respectively. The sign of a non-zero return value is determined
- by the sign of the difference between the values of the first pair of
- bytes that differ in the strings being compared. The strncmp() function
- makes the same comparison but looks at a maximum of n bytes. Bytes fol-
- lowing a null byte are not compared.
-
strcpy(), stpcpy(), strncpy(), stpncpy(), strlcpy()
The strcpy() and stpcpy() functions copy string s2 to s1, including the
terminating null character, stopping after the null character has been
@@ -257,15 +107,16 @@
to the array pointed to by s1. If the array pointed to by s2 is a
string that is shorter than n bytes, null bytes are appended to the
copy in the array pointed to by s1, until n bytes in all are written.
- The stpcpy() function returns s1. If s1 contains null bytes, stpncpy()
- returns a pointer to the first such null byte. Otherwise, it returns
- &s1[n].
+ If the array pointed to by s2 is a string that is n bytes or longer,
+ the resulting s1 will not be null terminated. The strncpy() function
+ returns s1. If s1 contains null bytes, stpncpy() returns a pointer to
+ the first such null byte. Otherwise, it returns &s1[n].
The strlcpy() function copies at most dstsize-1 characters (dstsize
being the size of the string buffer dst) from src to dst, truncating
src if necessary. The result is always null-terminated. The function
- returns strlen(src). Buffer overflow can be checked as follows:
+ returns strlen(src). Insufficient space can be checked for as follows:
if (strlcpy(dst, src, dstsize) >= dstsize)
return -1;
@@ -275,285 +126,59 @@
If copying takes place between objects that overlap, the behavior of
these functions is undefined.
- strcspn(), strspn()
- The strcspn() function returns the length of the initial segment of
- string s1 that consists entirely of characters not from string s2. The
- strspn() function returns the length of the initial segment of string
- s1 that consists entirely of characters from string s2.
-
- strdup(), strndup(), strdupa(), strndupa()
- The strdup() function returns a pointer to a new string that is a
- duplicate of the string pointed to by s. The returned pointer can be
- passed to free(). The space for the new string is obtained using mal-
- loc(3C). If the new string cannot be created, a null pointer is
- returned and errno may be set to ENOMEM to indicate that the storage
- space available is insufficient.
-
-
- The strndup() function is similar to strdup(), except that it copies at
- most size bytes. If the length of s is larger than size, only size
- bytes are copied and a terminating null byte is added. If size is
- larger than the length of s, all bytes in s are copied, including the
- terminating null character.
-
-
- The strdupa() and strndupa() functions are similar to strdup() and
- strndup(), respectively, but use alloca(3C) to allocate the buffer.
-
- strlen(), strnlen()
- The strlen() function returns the number of bytes in s, not including
- the terminating null character.
-
-
- The strnlen() function returns the smaller of n or the number of bytes
- in s, not including the terminating null character. The strnlen() func-
- tion never examines more than n bytes of the string pointed to by s.
-
- strpbrk()
- The strpbrk() function returns a pointer to the first occurrence in
- string s1 of any character from string s2, or a null pointer if no
- character from s2 exists in s1.
-
- strsep()
- The strsep() function locates, in the null-terminated string referenced
- by *stringp, the first occurrence of any character in the string delim
- (or the terminating '\0' character) and replaces it with a '\0'. The
- location of the next character after the delimiter character (or NULL,
- if the end of the string was reached) is stored in *stringp. The origi-
- nal value of *stringp is returned.
-
-
- An "empty" field (one caused by two adjacent delimiter characters) can
- be detected by comparing the location referenced by the pointer
- returned by strsep() to '\0'.
-
-
- If *stringp is initially NULL, strsep() returns NULL.
-
- strstr(), strnstr(), strcasestr()
- The strstr() function locates the first occurrence of the string s2
- (excluding the terminating null character) in string s1 and returns a
- pointer to the located string, or a null pointer if the string is not
- found. If s2 points to a string with zero length (that is, the string
- ""), the function returns s1.
-
-
- The strnstr() function locates the first occurrence of the null-termi-
- nated string s2 in the string s1, where not more than n characters are
- searched. Characters that appear after a '\0' character are not
- searched.
-
-
- The strcasestr() function is similar to strstr(), but ignores the case
- of both strings.
-
- strtok()
- A sequence of calls to strtok() breaks the string pointed to by s1 into
- a sequence of tokens, each of which is delimited by a byte from the
- string pointed to by s2. The first call in the sequence has s1 as its
- first argument, and is followed by calls with a null pointer as their
- first argument. The separator string pointed to by s2 can be different
- from call to call.
-
-
- The first call in the sequence searches the string pointed to by s1 for
- the first byte that is not contained in the current separator string
- pointed to by s2. If no such byte is found, then there are no tokens in
- the string pointed to by s1 and strtok() returns a null pointer. If
- such a byte is found, it is the start of the first token.
-
-
- The strtok() function then searches from there for a byte that is con-
- tained in the current separator string. If no such byte is found, the
- current token extends to the end of the string pointed to by s1, and
- subsequent searches for a token return a null pointer. If such a byte
- is found, it is overwritten by a null byte that terminates the current
- token. The strtok() function saves a pointer to the following byte in
- thread-specific data, from which the next search for a token starts.
-
-
- Each subsequent call, with a null pointer as the value of the first
- argument, starts searching from the saved pointer and behaves as
- described above.
-
-
- See Example 1, 2, and 3 in the EXAMPLES section for examples of str-
- tok() usage and the explanation in NOTES.
-
- strtok_r()
- The strtok_r() function considers the null-terminated string s1 as a
- sequence of zero or more text tokens separated by spans of one or more
- characters from the separator string s2. The argument lasts points to a
- user-provided pointer which points to stored information necessary for
- strtok_r() to continue scanning the same string.
-
-
- In the first call to strtok_r(), s1 points to a null-terminated string,
- s2 to a null-terminated string of separator characters, and the value
- pointed to by lasts is ignored. The strtok_r() function returns a
- pointer to the first character of the first token, writes a null char-
- acter into s1 immediately following the returned token, and updates the
- pointer to which lasts points.
-
-
- In subsequent calls, s1 is a null pointer and lasts is unchanged from
- the previous call so that subsequent calls move through the string s1,
- returning successive tokens until no tokens remain. The separator
- string s2 can be different from call to call. When no token remains in
- s1, a null pointer is returned.
-
-
- See Example 3 in the EXAMPLES section for an example of strtok_r()
- usage and the explanation in NOTES.
-
C11 Bounds Checking Interfaces
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(),
- strlen_s(), strerror_s(), and strerrorlen_s() functions are part of the
- C11 bounds checking interfaces specified in the C11 standard, Annex K.
- With the exception of strerrorlen_s(), each provide similar functional-
- ity to their respective non-bounds checking functions, but with addi-
- tional safety checks in the form of explicit runtime constraints as
- defined in the C11 standard. See runtime_constraint_handler(3C) and
- INCITS/ISO/IEC 9899:2011.
+ The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), and strlen_s()
+ functions are part of the C11 bounds checking interfaces specified in
+ the C11 standard, Annex K. Each of these functions provides similar
+ functionality to their respective non-bounds checking counterpart func-
+ tions, but with additional safety checks in the form of explicit run-
+ time constraints as defined in the C11 standard. See runtime_con-
+ straint_handler(3C) and INCITS/ISO/IEC 9899:2011.
If no runtime constraint violation is detected, the strcpy_s(),
- strncpy_s(), strcat_s() and strncat_s() functions return zero, other-
- wise, they return a non-zero value.
-
-
- If a runtime constraint violation is detected, or there is no token,
- the strtok_s() function returns a null pointer, otherwise a pointer to
- the first character of the token is returned.
-
-
- If the length of the requested string is less than maxsize, and no run-
- time-constraint violation is detected, the strerror_s() function
- returns zero, otherwise, a non-zero value is returned.
-
-
- The strerrorlen_s() function returns the length (not including the null
- terminator) in the message string strerror_s() would return.
-
-
- The strnlen_s() function returns zero if s is a null pointer. Other-
- wise, the number of bytes preceding the terminating null character is
- returned. If there is no terminating null character in the first max-
- size characters pointed to by s, strnlen_s() returns maxsize.
-
-RETURN VALUES
- The functions will fail if:
+ strncpy_s(), strcat_s() and strncat_s() functions return zero. If a
+ runtime constraint violation is detected and the handler returns, they
+ return a non-zero value.
+ERRORS
+ The C11 bounds checking interface functions will fail if:
EINVAL Null pointer is passed or source and destination overlap
- ERANGE size argument is not valid value
+ ERANGE A size argument is not a valid value
EOVERFLOW Destination array is too small
-EXAMPLES
- Example 1 Search for word separators
-
-
-
- The following example searches for tokens separated by space charac-
- ters.
-
-
- #include <string.h>
- ...
- char *token;
- char line[] = "LINE TO BE SEPARATED";
- char *search = " ";
-
- /* Token will point to "LINE". */
- token = strtok(line, search);
-
- /* Token will point to "TO". */
- token = strtok(NULL, search);
-
+ The other functions described in this page do not check if a null
+ pointer is passed, and programs passing null pointers to them may
+ crash.
+USAGE
+ Usage of the strlcat() and strlcpy() functions is recommended over the
+ other variants to avoid buffer overflows and make code easier to review
+ and maintain.
- Example 2 Break a Line.
+ It is not possible to limit the strcat() and strcpy() functions to a
+ maximum buffer size. Although one can calculate the amount of space
+ needed before calling strcat or strcpy, the use of these functions will
+ always force reviewers to follow the logic, and hinder automated scan-
+ ning of source code for vulnerabilities.
- The following example uses strtok() to break a line into two character
- strings separated by any combination of SPACEs, TABs, or NEWLINEs.
-
-
- #include <string.h>
- ...
- struct element {
- char *key;
- char *data;
- };
- ...
- char line[LINE_MAX];
- char *key, *data;
- ...
- key = strtok(line, " \n");
- data = strtok(NULL, " \n");
-
-
-
- Example 3 Search for tokens
-
-
-
- The following example uses both strtok() and strtok_r() to search for
- tokens separated by one or more characters from the string pointed to
- by the second argument, "/".
-
-
- #define __EXTENSIONS__
- #include <stdio.h>
- #include <string.h>
-
- int main {
- char buf[8]="5/90/45";
- char buf1[14] = "//5//90//45//";
- char *token;
- char *lasts;
-
- printf("tokenizing \"%s\" with strtok:\n", buf);
- if ((token = strtok(buf, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok(NULL, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
-
- printf("\ntokenizing \"%s\" with strtok_r:\n", buf);
- if ((token = strtok_r(buf1, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok_r(NULL, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
- }
-
-
-
-
- When compiled and run, this example produces the following output:
-
-
- tokenizing "5/90/45" with strtok():
- token = "5"
- token = "90"
- token = "45"
-
- tokenizing "//5//90//45//" with strtok_r():
- token = "5"
- token = "90"
- token = "45"
+ strncpy() is not guaranteed to null-terminate the destination buffer.
+ This fact, together with the side effect that it will add null bytes if
+ there is space left make it a useful function for updating fixed-length
+ structures that reside on disk, for example, wtmpx(5).
+ strncat() is hard to use safely as it requires the remaining size of
+ the destination buffer to be calculated by the caller.
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -570,62 +195,65 @@
+-----------------------------+-----------------------------+
MT-Level
- The strtok() and strdup() functions are MT-Safe.
+ The strcat(), strncat(), strlcat(), strcpy(), strncpy(), strlcpy(),
+ stpcpy(), and stpncpy() functions are Async-Signal-Safe.
- The string(), strcasecmp(), strncasecmp(), strcasecmp_l(), strn-
- casecmp_l(), strcat(), strncat(), strlcat(), strchr(), strrchr(),
- strchrnul(), strcmp(), strncmp(), strcpy(), strncpy(), strlcpy(),
- stpcpy(), stpncpy(), strcspn(), strspn(), strndup(), strdupa(),
- strndupa(), strlen(), strnlen(), strpbrk(), strsep(), strstr(), strn-
- str(), strcasestr(), strtok_r() functions are Async-Signal-Safe.
-
-
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(), str-
- error_s(), strerrorlen_s(), and strnlen_s() functions cannot be used
- safely in a multithreaded application due to the runtime constraint
- handler. For more information, see the runtime_constraint_handler(3C)
- man page.
+ The strcpy_s(), strncpy_s(), strcat_s(), and strncat_s() functions can-
+ not be used safely in a multithreaded application due to the runtime
+ constraint handler. For more information, see the runtime_con-
+ straint_handler(3C) man page.
Standard
- For all except strlcat(), strlcpy(), and strsep(), see the standards(7)
- man page.
+ See standards(7) for descriptions of the following standards:
-SEE ALSO
- alloca(3C), malloc(3C), setlocale(3C), strxfrm(3C), attributes(7),
- standards(7), runtime_constraint_handler(3C)
-NOTES
- A single-threaded application can gain access to strtok_r() only by
- defining __EXTENSIONS__ or by defining _POSIX_C_SOURCE to a value
- greater than or equal to 199506L.
+ +--------------------------+--------------------------------+
+ | INTERFACES | APPLICABLE STANDARDS |
+ +--------------------------+--------------------------------+
+ |strcat(), strcpy(), | C89 through C11, |
+ |strncat(), strncpy() | POSIX.1-1990 through 2008, |
+ | | SUS through SUSv4, |
+ | | XPG1 through XPG7 |
+ | | |
+ +--------------------------+--------------------------------+
+ |stpcpy(), stpncpy() | POSIX.1-2008, |
+ | | SUSv4, |
+ | | XPG7 |
+ | | |
+ +--------------------------+--------------------------------+
+ |strcat_s(), strcpy_s(), |C11 Annex K |
+ |strncat_s(), strncpy_s() | |
+ +--------------------------+--------------------------------+
+ |strlcat(), strlcpy() |None |
+ +--------------------------+--------------------------------+
+SEE ALSO
+ strdup(3C), string(3C), wcscat(3C), wcscpy(3C), attributes(7), stan-
+ dards(7), runtime_constraint_handler(3C)
- All of these functions assume the default locale "C." For some locales,
- strxfrm(3C) should be applied to the strings before they are passed to
- the functions.
+ Appendix E, Security Considerations When Using C Functions, in Devel-
+ oper's Guide to Oracle Solaris 11.4 Security
- The strtok() function is safe to use in multithreaded applications
- because it saves its internal state in a thread-specific data area.
- However, its use is discouraged, even for single-threaded applications.
- The strtok_r() function should be used instead.
+HISTORY
+ Support for the following functions is available in Oracle Solaris
+ starting with the listed release:
- Do not pass the address of a character string literal as the argument
- s1 to either strtok() or strtok_r(). Similarly, do not pass a pointer
- to the address of a character string literal as the argument stringp to
- strsep(). These functions can modify the storage pointed to by s1 in
- the case of strtok() and strtok_r() or *stringp in the case of
- strsep(). The C99 standard specifies that attempting to modify the
- storage occupied by a string literal results in undefined behavior.
- This allows compilers (including gcc, clang, and the Oracle Developer
- Studio compilers) to place string literals in read-only memory. Note
- that in Example 1 above, this problem is avoided because the variable
- line is declared as a writable array of type char that is initialized
- by a string literal rather than a pointer to char that points to a
- string literal.
+ +-------------------------------------------------+---------+
+ | FUNCTION |RELEASE |
+ +-------------------------------------------------+---------+
+ |strcat_s(), strcpy_s(), strncat_s(), |11.4.0 |
+ |strncpy_s() | |
+ +-------------------------------------------------+---------+
+ |stpcpy(), stpncpy() |11.0.0 |
+ +-------------------------------------------------+---------+
+ |strlcat(), strlcpy() |8 |
+ +-------------------------------------------------+---------+
+ |strcat(), strcpy(), strncat(), strncpy() |1.0 |
+ +-------------------------------------------------+---------+
-Oracle Solaris 11.4 11 May 2021 string(3C)
+Oracle Solaris 11.4 28 Feb 2022 strcat(3C)
diff -NurbBw 11.4.42/man3c/strchr.3c 11.4.45/man3c/strchr.3c
--- 11.4.42/man3c/strchr.3c 2022-05-17 14:50:16.819505066 -0700
+++ 11.4.45/man3c/strchr.3c 2022-05-17 14:50:59.575618066 -0700
@@ -1,42 +1,14 @@
-Standard C Library Functions string(3C)
+Standard C Library Functions strchr(3C)
NAME
- string, strcasecmp, strncasecmp, strcasecmp_l, strncasecmp_l, strcat,
- strncat, strlcat, strchr, strrchr, strchrnul, strcmp, strncmp, strcpy,
- strncpy, strlcpy, stpcpy, stpncpy, strcspn, strspn, strdup, strndup,
- strdupa, strndupa, strlen, strnlen, strpbrk, strsep, strstr, strnstr,
- strcasestr, strtok, strtok_r - string operations
- strcpy_s, strncpy_s, strcat_s, strncat_s, strtok_s, strerror_s, str-
- errorlen_s, strnlen_s - string operations with additional safety checks
+ strchr, strrchr, strchrnul, strcspn, strspn, strpbrk, strstr, strnstr,
+ strcasestr - string search operations
SYNOPSIS
- #include <strings.h>
-
- int strcasecmp(const char *s1, const char *s2);
-
-
- int strncasecmp(const char *s1, const char *s2, size_t n);
-
-
- int strcasecmp_l(const char *s1, const char *s2, locale_t locale);
-
-
- int strncasecmp_l(const char *s1, const char *s2, size_t n, locale_t locale);
-
-
#include <string.h>
- char *strcat(char *restrict s1, const char *restrict s2);
-
-
- char *strncat(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcat(char *dst, const char *src, size_t dstsize);
-
-
char *strchr(const char *s, int c);
@@ -46,57 +18,15 @@
char *strchrnul(const char *s, int c);
- int strcmp(const char *s1, const char *s2);
-
-
- int strncmp(const char *s1, const char *s2, size_t n);
-
-
- char *strcpy(char *restrict s1, const char *restrict s2);
-
-
- char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcpy(char *dst, const char *src, size_t dstsize);
-
-
- char *stpcpy(char *restrict s1, const char *restrict s2);
-
-
- char *stpncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
size_t strcspn(const char *s1, const char *s2);
size_t strspn(const char *s1, const char *s2);
- char *strdup(const char *s);
-
-
- char *strndup(const char *s, size_t size);
-
-
- char *strdupa(const char *s);
-
-
- char *strndupa(const char *s, size_t size);
-
-
- size_t strlen(const char *s);
-
-
- size_t strnlen(const char *s, size_t n);
-
-
char *strpbrk(const char *s1, const char *s2);
- char *strsep(char **stringp, const char *delim);
-
-
char *strstr(const char *s1, const char *s2);
@@ -105,44 +35,6 @@
char *strcasestr(const char *s1, const char *s2);
-
- char *strtok(char *restrict s1, const char *restrict s2);
-
-
- char *strtok_r(char *s1, const char *s2, char **lasts);
-
-
- #define __STDC_WANT_LIB_EXT1__ 1
- #include <stdlib.h>
-
- errno_t strcpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- errno_t strcat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- char *strtok_s(char *restrict s1, rsize_t *restrict s1max,
- const char *restrict s2, char **restrict ptr);
-
-
- errno_t strerror_s(char *s, rsize_t maxsize, errno_t errnum);
-
-
- size_t strerrorlen_s(errno_t errnum);
-
-
- size_t strnlen_s(const char *s, size_t maxsize);
-
ISO C++
#include <string.h>
@@ -172,52 +64,17 @@
char *std::strstr(char *s1, const char *s2);
DESCRIPTION
- The arguments s, s1, and s2 point to strings (arrays of characters ter-
- minated by a null character). The strcat(), strncat(), strlcat(), str-
- cpy(), strncpy(), strlcpy(), strsep(), strtok(), and strtok_r() func-
- tions all alter their first argument. Additionally, the strcat() and
- strcpy() functions do not check for overflow of the array.
-
- strcasecmp(), strncasecmp()
- The strcasecmp() and strncasecmp() functions are case-insensitive ver-
- sions of strcmp() and strncmp() respectively, described below. They
- ignore differences in case when comparing lower and uppercase charac-
- ters, using the current locale of the process to determine the case of
- the characters.
-
- strcasecmp_l(), strncasecmp_l()
- The strcasecmp_l() and strncasecmp_l() functions are versions of str-
- casecmp() and strncasecmp() respectively. They use locale represented
- by <locale>, instead of current locale of the process.
-
-
- The behavior is undefined if the <locale> argument is the special
- locale object LC_GLOBAL_LOCALE or is not a valid locale object handle.
-
- strcat(), strncat(), strlcat()
- The strcat() function appends a copy of string s2, including the termi-
- nating null character, to the end of string s1. The strncat() function
- appends at most n characters. Each returns a pointer to the null-termi-
- nated result. The initial character of s2 overrides the null character
- at the end of s1. If copying takes place between objects that overlap,
- the behavior of strcat(), strncat(), and strlcat() is undefined.
-
-
- The strlcat() function appends at most (dstsize-strlen(dst)-1) charac-
- ters of src to dst (dstsize being the size of the string buffer dst).
- If the string pointed to by dst contains a null-terminated string that
- fits into dstsize bytes when strlcat() is called, the string pointed to
- by dst will be a null-terminated string that fits in dstsize bytes
- (including the terminating null character) when it completes, and the
- initial character of src will override the null character at the end of
- dst. If the string pointed to by dst is longer than dstsize bytes when
- strlcat() is called, the string pointed to by dst will not be changed.
- The function returns min{dstsize,strlen(dst)}+ strlen(src). Buffer
- overflow can be checked as follows:
-
- if (strlcat(dst, src, dstsize) >= dstsize)
- return -1;
-
+ These functions perform various operations on strings (arrays of char-
+ acters), which are given as arguments s, s1, and s2 that point to
+ strings. Depending on the function, strings may be either terminated by
+ a null character or consist of a length of n bytes. They are designed
+ for use with encodings representing each character as a single byte,
+ and all character counts are measured in individual bytes, even if a
+ string with multibyte characters is used. They do not check for null
+ pointers, and programs may crash if passing null or otherwise invalid
+ pointers to these functions, or specifying sizes larger than the memory
+ allocation in use for the string. Use of adi(7) may help in detecting
+ out-of-bounds access or invalid pointer usage in code.
strchr(), strrchr(), strchrnul()
The strchr() function returns a pointer to the first occurrence of c
@@ -225,110 +82,32 @@
occur in the string.
- The strrchr() function returns a pointer to the last occurrence of c.
+ The strrchr() function returns a pointer to the last occurrence of c
+ (converted to a char) in string s, or a null pointer if c does not
+ occur in the string.
+
+
The null character terminating a string is considered to be part of the
- string.
+ string, and a pointer to it will be returned if c is 0.
The strchrnul() function is similar to strchr() except that if c is not
found in s, it returns a pointer to the null byte at the end of s,
rather than NULL.
- strcmp(), strncmp()
- The strcmp() function compares two strings byte-by-byte, according to
- the ordering of your machine's character set. The function returns an
- integer greater than, equal to, or less than 0, if the string pointed
- to by s1 is greater than, equal to, or less than the string pointed to
- by s2 respectively. The sign of a non-zero return value is determined
- by the sign of the difference between the values of the first pair of
- bytes that differ in the strings being compared. The strncmp() function
- makes the same comparison but looks at a maximum of n bytes. Bytes fol-
- lowing a null byte are not compared.
-
- strcpy(), stpcpy(), strncpy(), stpncpy(), strlcpy()
- The strcpy() and stpcpy() functions copy string s2 to s1, including the
- terminating null character, stopping after the null character has been
- copied. The strcpy() function returns s1. The stpcpy() function returns
- a pointer to the terminating null character copied into the s1 array.
-
-
- The strncpy() and stpncpy() functions copy not more than n bytes (bytes
- that follow a null byte are not copied) from the array pointed to by s2
- to the array pointed to by s1. If the array pointed to by s2 is a
- string that is shorter than n bytes, null bytes are appended to the
- copy in the array pointed to by s1, until n bytes in all are written.
- The stpcpy() function returns s1. If s1 contains null bytes, stpncpy()
- returns a pointer to the first such null byte. Otherwise, it returns
- &s1[n].
-
-
- The strlcpy() function copies at most dstsize-1 characters (dstsize
- being the size of the string buffer dst) from src to dst, truncating
- src if necessary. The result is always null-terminated. The function
- returns strlen(src). Buffer overflow can be checked as follows:
-
- if (strlcpy(dst, src, dstsize) >= dstsize)
- return -1;
-
-
- If copying takes place between objects that overlap, the behavior of
- these functions is undefined.
+ These functions only work with single byte characters.
strcspn(), strspn()
The strcspn() function returns the length of the initial segment of
- string s1 that consists entirely of characters not from string s2. The
- strspn() function returns the length of the initial segment of string
- s1 that consists entirely of characters from string s2.
-
- strdup(), strndup(), strdupa(), strndupa()
- The strdup() function returns a pointer to a new string that is a
- duplicate of the string pointed to by s. The returned pointer can be
- passed to free(). The space for the new string is obtained using mal-
- loc(3C). If the new string cannot be created, a null pointer is
- returned and errno may be set to ENOMEM to indicate that the storage
- space available is insufficient.
-
-
- The strndup() function is similar to strdup(), except that it copies at
- most size bytes. If the length of s is larger than size, only size
- bytes are copied and a terminating null byte is added. If size is
- larger than the length of s, all bytes in s are copied, including the
- terminating null character.
-
-
- The strdupa() and strndupa() functions are similar to strdup() and
- strndup(), respectively, but use alloca(3C) to allocate the buffer.
-
- strlen(), strnlen()
- The strlen() function returns the number of bytes in s, not including
- the terminating null character.
-
-
- The strnlen() function returns the smaller of n or the number of bytes
- in s, not including the terminating null character. The strnlen() func-
- tion never examines more than n bytes of the string pointed to by s.
+ string s1 that consists entirely of bytes not from string s2. The str-
+ spn() function returns the length of the initial segment of string s1
+ that consists entirely of bytes from string s2.
strpbrk()
The strpbrk() function returns a pointer to the first occurrence in
- string s1 of any character from string s2, or a null pointer if no
- character from s2 exists in s1.
-
- strsep()
- The strsep() function locates, in the null-terminated string referenced
- by *stringp, the first occurrence of any character in the string delim
- (or the terminating '\0' character) and replaces it with a '\0'. The
- location of the next character after the delimiter character (or NULL,
- if the end of the string was reached) is stored in *stringp. The origi-
- nal value of *stringp is returned.
-
-
- An "empty" field (one caused by two adjacent delimiter characters) can
- be detected by comparing the location referenced by the pointer
- returned by strsep() to '\0'.
-
-
- If *stringp is initially NULL, strsep() returns NULL.
+ string s1 of any byte from string s2, or a null pointer if no byte from
+ s2 exists in s1.
strstr(), strnstr(), strcasestr()
The strstr() function locates the first occurrence of the string s2
@@ -339,222 +118,16 @@
The strnstr() function locates the first occurrence of the null-termi-
- nated string s2 in the string s1, where not more than n characters are
+ nated string s2 in the string s1, where not more than n bytes are
searched. Characters that appear after a '\0' character are not
searched.
- The strcasestr() function is similar to strstr(), but ignores the case
- of both strings.
-
- strtok()
- A sequence of calls to strtok() breaks the string pointed to by s1 into
- a sequence of tokens, each of which is delimited by a byte from the
- string pointed to by s2. The first call in the sequence has s1 as its
- first argument, and is followed by calls with a null pointer as their
- first argument. The separator string pointed to by s2 can be different
- from call to call.
-
-
- The first call in the sequence searches the string pointed to by s1 for
- the first byte that is not contained in the current separator string
- pointed to by s2. If no such byte is found, then there are no tokens in
- the string pointed to by s1 and strtok() returns a null pointer. If
- such a byte is found, it is the start of the first token.
-
-
- The strtok() function then searches from there for a byte that is con-
- tained in the current separator string. If no such byte is found, the
- current token extends to the end of the string pointed to by s1, and
- subsequent searches for a token return a null pointer. If such a byte
- is found, it is overwritten by a null byte that terminates the current
- token. The strtok() function saves a pointer to the following byte in
- thread-specific data, from which the next search for a token starts.
-
-
- Each subsequent call, with a null pointer as the value of the first
- argument, starts searching from the saved pointer and behaves as
- described above.
-
-
- See Example 1, 2, and 3 in the EXAMPLES section for examples of str-
- tok() usage and the explanation in NOTES.
-
- strtok_r()
- The strtok_r() function considers the null-terminated string s1 as a
- sequence of zero or more text tokens separated by spans of one or more
- characters from the separator string s2. The argument lasts points to a
- user-provided pointer which points to stored information necessary for
- strtok_r() to continue scanning the same string.
-
-
- In the first call to strtok_r(), s1 points to a null-terminated string,
- s2 to a null-terminated string of separator characters, and the value
- pointed to by lasts is ignored. The strtok_r() function returns a
- pointer to the first character of the first token, writes a null char-
- acter into s1 immediately following the returned token, and updates the
- pointer to which lasts points.
-
-
- In subsequent calls, s1 is a null pointer and lasts is unchanged from
- the previous call so that subsequent calls move through the string s1,
- returning successive tokens until no tokens remain. The separator
- string s2 can be different from call to call. When no token remains in
- s1, a null pointer is returned.
-
-
- See Example 3 in the EXAMPLES section for an example of strtok_r()
- usage and the explanation in NOTES.
-
- C11 Bounds Checking Interfaces
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(),
- strlen_s(), strerror_s(), and strerrorlen_s() functions are part of the
- C11 bounds checking interfaces specified in the C11 standard, Annex K.
- With the exception of strerrorlen_s(), each provide similar functional-
- ity to their respective non-bounds checking functions, but with addi-
- tional safety checks in the form of explicit runtime constraints as
- defined in the C11 standard. See runtime_constraint_handler(3C) and
- INCITS/ISO/IEC 9899:2011.
-
-
- If no runtime constraint violation is detected, the strcpy_s(),
- strncpy_s(), strcat_s() and strncat_s() functions return zero, other-
- wise, they return a non-zero value.
-
-
- If a runtime constraint violation is detected, or there is no token,
- the strtok_s() function returns a null pointer, otherwise a pointer to
- the first character of the token is returned.
-
-
- If the length of the requested string is less than maxsize, and no run-
- time-constraint violation is detected, the strerror_s() function
- returns zero, otherwise, a non-zero value is returned.
-
-
- The strerrorlen_s() function returns the length (not including the null
- terminator) in the message string strerror_s() would return.
-
-
- The strnlen_s() function returns zero if s is a null pointer. Other-
- wise, the number of bytes preceding the terminating null character is
- returned. If there is no terminating null character in the first max-
- size characters pointed to by s, strnlen_s() returns maxsize.
-
-RETURN VALUES
- The functions will fail if:
-
-
- EINVAL Null pointer is passed or source and destination overlap
-
-
- ERANGE size argument is not valid value
-
-
- EOVERFLOW Destination array is too small
-
-
-
-EXAMPLES
- Example 1 Search for word separators
-
-
-
- The following example searches for tokens separated by space charac-
+ The strcasestr() function is similar to strstr(), but ignores differ-
+ ences in case when comparing lowercase and uppercase characters, using
+ the current locale of the process to determine the case of the charac-
ters.
-
- #include <string.h>
- ...
- char *token;
- char line[] = "LINE TO BE SEPARATED";
- char *search = " ";
-
- /* Token will point to "LINE". */
- token = strtok(line, search);
-
- /* Token will point to "TO". */
- token = strtok(NULL, search);
-
-
-
- Example 2 Break a Line.
-
-
-
- The following example uses strtok() to break a line into two character
- strings separated by any combination of SPACEs, TABs, or NEWLINEs.
-
-
- #include <string.h>
- ...
- struct element {
- char *key;
- char *data;
- };
- ...
- char line[LINE_MAX];
- char *key, *data;
- ...
- key = strtok(line, " \n");
- data = strtok(NULL, " \n");
-
-
-
- Example 3 Search for tokens
-
-
-
- The following example uses both strtok() and strtok_r() to search for
- tokens separated by one or more characters from the string pointed to
- by the second argument, "/".
-
-
- #define __EXTENSIONS__
- #include <stdio.h>
- #include <string.h>
-
- int main {
- char buf[8]="5/90/45";
- char buf1[14] = "//5//90//45//";
- char *token;
- char *lasts;
-
- printf("tokenizing \"%s\" with strtok:\n", buf);
- if ((token = strtok(buf, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok(NULL, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
-
- printf("\ntokenizing \"%s\" with strtok_r:\n", buf);
- if ((token = strtok_r(buf1, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok_r(NULL, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
- }
-
-
-
-
- When compiled and run, this example produces the following output:
-
-
- tokenizing "5/90/45" with strtok():
- token = "5"
- token = "90"
- token = "45"
-
- tokenizing "//5//90//45//" with strtok_r():
- token = "5"
- token = "90"
- token = "45"
-
-
-
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -564,68 +137,40 @@
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
- |MT-Level |See below |
+ |MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
|Standard |See below |
+-----------------------------+-----------------------------+
- MT-Level
- The strtok() and strdup() functions are MT-Safe.
-
-
- The string(), strcasecmp(), strncasecmp(), strcasecmp_l(), strn-
- casecmp_l(), strcat(), strncat(), strlcat(), strchr(), strrchr(),
- strchrnul(), strcmp(), strncmp(), strcpy(), strncpy(), strlcpy(),
- stpcpy(), stpncpy(), strcspn(), strspn(), strndup(), strdupa(),
- strndupa(), strlen(), strnlen(), strpbrk(), strsep(), strstr(), strn-
- str(), strcasestr(), strtok_r() functions are Async-Signal-Safe.
-
-
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(), str-
- error_s(), strerrorlen_s(), and strnlen_s() functions cannot be used
- safely in a multithreaded application due to the runtime constraint
- handler. For more information, see the runtime_constraint_handler(3C)
- man page.
-
Standard
- For all except strlcat(), strlcpy(), and strsep(), see the standards(7)
- man page.
-
-SEE ALSO
- alloca(3C), malloc(3C), setlocale(3C), strxfrm(3C), attributes(7),
- standards(7), runtime_constraint_handler(3C)
+ See standards(7) for descriptions of the following standards:
-NOTES
- A single-threaded application can gain access to strtok_r() only by
- defining __EXTENSIONS__ or by defining _POSIX_C_SOURCE to a value
- greater than or equal to 199506L.
+ +--------------------------+--------------------------------+
+ | INTERFACES | APPLICABLE STANDARDS |
+ +--------------------------+--------------------------------+
+ |strchr(), strcspn(), | C89 through C11, |
+ |strpbrk(), strrchr(), | POSIX.1-1990 through 2008, |
+ |strspn(), strstr() | SUS through SUSv4, |
+ | | XPG1 through XPG7 |
+ | | |
+ +--------------------------+--------------------------------+
+ |strcasestr(), |None |
+ |strchrnul(), strnstr() | |
+ +--------------------------+--------------------------------+
- All of these functions assume the default locale "C." For some locales,
- strxfrm(3C) should be applied to the strings before they are passed to
- the functions.
-
+SEE ALSO
+ memchr(3C), setlocale(3C), string(3C), strtok(3C), wcschr(3C), wmem-
+ chr(3C), attributes(7), standards(7)
- The strtok() function is safe to use in multithreaded applications
- because it saves its internal state in a thread-specific data area.
- However, its use is discouraged, even for single-threaded applications.
- The strtok_r() function should be used instead.
+HISTORY
+ The strcasestr(), strchrnul(), and strnstr() functions were added to
+ Oracle Solaris in the Solaris 11.0.0 release.
- Do not pass the address of a character string literal as the argument
- s1 to either strtok() or strtok_r(). Similarly, do not pass a pointer
- to the address of a character string literal as the argument stringp to
- strsep(). These functions can modify the storage pointed to by s1 in
- the case of strtok() and strtok_r() or *stringp in the case of
- strsep(). The C99 standard specifies that attempting to modify the
- storage occupied by a string literal results in undefined behavior.
- This allows compilers (including gcc, clang, and the Oracle Developer
- Studio compilers) to place string literals in read-only memory. Note
- that in Example 1 above, this problem is avoided because the variable
- line is declared as a writable array of type char that is initialized
- by a string literal rather than a pointer to char that points to a
- string literal.
+ The strchr(), strcspn(), strpbrk(), strrchr(), strspn(), and strstr()
+ functions have been included in all Sun and Oracle releases of Solaris.
-Oracle Solaris 11.4 11 May 2021 string(3C)
+Oracle Solaris 11.4 28 Feb 2022 strchr(3C)
diff -NurbBw 11.4.42/man3c/strcmp.3c 11.4.45/man3c/strcmp.3c
--- 11.4.42/man3c/strcmp.3c 2022-05-17 14:50:16.891512405 -0700
+++ 11.4.45/man3c/strcmp.3c 2022-05-17 14:50:59.643704400 -0700
@@ -1,242 +1,47 @@
-Standard C Library Functions string(3C)
+Standard C Library Functions strcmp(3C)
NAME
- string, strcasecmp, strncasecmp, strcasecmp_l, strncasecmp_l, strcat,
- strncat, strlcat, strchr, strrchr, strchrnul, strcmp, strncmp, strcpy,
- strncpy, strlcpy, stpcpy, stpncpy, strcspn, strspn, strdup, strndup,
- strdupa, strndupa, strlen, strnlen, strpbrk, strsep, strstr, strnstr,
- strcasestr, strtok, strtok_r - string operations
- strcpy_s, strncpy_s, strcat_s, strncat_s, strtok_s, strerror_s, str-
- errorlen_s, strnlen_s - string operations with additional safety checks
+ strcmp, strncmp, strcasecmp, strncasecmp, strcasecmp_l, strncasecmp_l -
+ string comparison
SYNOPSIS
- #include <strings.h>
-
- int strcasecmp(const char *s1, const char *s2);
-
-
- int strncasecmp(const char *s1, const char *s2, size_t n);
-
-
- int strcasecmp_l(const char *s1, const char *s2, locale_t locale);
-
-
- int strncasecmp_l(const char *s1, const char *s2, size_t n, locale_t locale);
-
-
#include <string.h>
- char *strcat(char *restrict s1, const char *restrict s2);
-
-
- char *strncat(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcat(char *dst, const char *src, size_t dstsize);
-
-
- char *strchr(const char *s, int c);
-
-
- char *strrchr(const char *s, int c);
-
-
- char *strchrnul(const char *s, int c);
-
-
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);
- char *strcpy(char *restrict s1, const char *restrict s2);
-
-
- char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcpy(char *dst, const char *src, size_t dstsize);
-
-
- char *stpcpy(char *restrict s1, const char *restrict s2);
-
-
- char *stpncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strcspn(const char *s1, const char *s2);
-
-
- size_t strspn(const char *s1, const char *s2);
-
-
- char *strdup(const char *s);
-
-
- char *strndup(const char *s, size_t size);
-
-
- char *strdupa(const char *s);
-
-
- char *strndupa(const char *s, size_t size);
-
-
- size_t strlen(const char *s);
-
-
- size_t strnlen(const char *s, size_t n);
-
-
- char *strpbrk(const char *s1, const char *s2);
-
-
- char *strsep(char **stringp, const char *delim);
-
-
- char *strstr(const char *s1, const char *s2);
-
-
- char *strnstr(const char *s1, const char *s2, size_t n);
-
-
- char *strcasestr(const char *s1, const char *s2);
-
-
- char *strtok(char *restrict s1, const char *restrict s2);
-
-
- char *strtok_r(char *s1, const char *s2, char **lasts);
-
-
- #define __STDC_WANT_LIB_EXT1__ 1
- #include <stdlib.h>
-
- errno_t strcpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- errno_t strcat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- char *strtok_s(char *restrict s1, rsize_t *restrict s1max,
- const char *restrict s2, char **restrict ptr);
-
-
- errno_t strerror_s(char *s, rsize_t maxsize, errno_t errnum);
-
-
- size_t strerrorlen_s(errno_t errnum);
-
-
- size_t strnlen_s(const char *s, size_t maxsize);
-
- ISO C++
- #include <string.h>
-
- const char *strchr(const char *s, int c);
-
-
- const char *strpbrk(const char *s1, const char *s2);
-
-
- const char *strrchr(const char *s, int c);
-
-
- const char *strstr(const char *s1, const char *s2);
-
-
- #include <cstring>
+ #include <strings.h>
- char *std::strchr(char *s, int c);
+ int strcasecmp(const char *s1, const char *s2);
- char *std::strpbrk(char *s1, const char *s2);
+ int strncasecmp(const char *s1, const char *s2, size_t n);
- char *std::strrchr(char *s, int c);
+ int strcasecmp_l(const char *s1, const char *s2, locale_t locale);
- char *std::strstr(char *s1, const char *s2);
+ int strncasecmp_l(const char *s1, const char *s2, size_t n,
+ locale_t locale);
DESCRIPTION
- The arguments s, s1, and s2 point to strings (arrays of characters ter-
- minated by a null character). The strcat(), strncat(), strlcat(), str-
- cpy(), strncpy(), strlcpy(), strsep(), strtok(), and strtok_r() func-
- tions all alter their first argument. Additionally, the strcat() and
- strcpy() functions do not check for overflow of the array.
-
- strcasecmp(), strncasecmp()
- The strcasecmp() and strncasecmp() functions are case-insensitive ver-
- sions of strcmp() and strncmp() respectively, described below. They
- ignore differences in case when comparing lower and uppercase charac-
- ters, using the current locale of the process to determine the case of
- the characters.
-
- strcasecmp_l(), strncasecmp_l()
- The strcasecmp_l() and strncasecmp_l() functions are versions of str-
- casecmp() and strncasecmp() respectively. They use locale represented
- by <locale>, instead of current locale of the process.
-
-
- The behavior is undefined if the <locale> argument is the special
- locale object LC_GLOBAL_LOCALE or is not a valid locale object handle.
-
- strcat(), strncat(), strlcat()
- The strcat() function appends a copy of string s2, including the termi-
- nating null character, to the end of string s1. The strncat() function
- appends at most n characters. Each returns a pointer to the null-termi-
- nated result. The initial character of s2 overrides the null character
- at the end of s1. If copying takes place between objects that overlap,
- the behavior of strcat(), strncat(), and strlcat() is undefined.
-
-
- The strlcat() function appends at most (dstsize-strlen(dst)-1) charac-
- ters of src to dst (dstsize being the size of the string buffer dst).
- If the string pointed to by dst contains a null-terminated string that
- fits into dstsize bytes when strlcat() is called, the string pointed to
- by dst will be a null-terminated string that fits in dstsize bytes
- (including the terminating null character) when it completes, and the
- initial character of src will override the null character at the end of
- dst. If the string pointed to by dst is longer than dstsize bytes when
- strlcat() is called, the string pointed to by dst will not be changed.
- The function returns min{dstsize,strlen(dst)}+ strlen(src). Buffer
- overflow can be checked as follows:
-
- if (strlcat(dst, src, dstsize) >= dstsize)
- return -1;
-
-
- strchr(), strrchr(), strchrnul()
- The strchr() function returns a pointer to the first occurrence of c
- (converted to a char) in string s, or a null pointer if c does not
- occur in the string.
-
-
- The strrchr() function returns a pointer to the last occurrence of c.
- The null character terminating a string is considered to be part of the
- string.
-
-
- The strchrnul() function is similar to strchr() except that if c is not
- found in s, it returns a pointer to the null byte at the end of s,
- rather than NULL.
+ These functions compare two strings (arrays of characters), and return
+ an integer greater than, equal to, or less than 0, if the string
+ pointed to by s1 is greater than, equal to, or less than the string
+ pointed to by s2 respectively. The strcmp(), strcasecmp(), and str-
+ casecmp_l() functions require the strings to be terminated by a '\0'
+ character. The strncmp(), strncasecmp(), and strncasecmp_l() functions
+ limit their comparisons to no more than n bytes, allowing comparions of
+ either an initial subset of the strings or of non-terminated strings.
strcmp(), strncmp()
The strcmp() function compares two strings byte-by-byte, according to
- the ordering of your machine's character set. The function returns an
+ the ordering of the "C" locale's character set. The function returns an
integer greater than, equal to, or less than 0, if the string pointed
to by s1 is greater than, equal to, or less than the string pointed to
by s2 respectively. The sign of a non-zero return value is determined
@@ -245,315 +50,20 @@
makes the same comparison but looks at a maximum of n bytes. Bytes fol-
lowing a null byte are not compared.
- strcpy(), stpcpy(), strncpy(), stpncpy(), strlcpy()
- The strcpy() and stpcpy() functions copy string s2 to s1, including the
- terminating null character, stopping after the null character has been
- copied. The strcpy() function returns s1. The stpcpy() function returns
- a pointer to the terminating null character copied into the s1 array.
-
-
- The strncpy() and stpncpy() functions copy not more than n bytes (bytes
- that follow a null byte are not copied) from the array pointed to by s2
- to the array pointed to by s1. If the array pointed to by s2 is a
- string that is shorter than n bytes, null bytes are appended to the
- copy in the array pointed to by s1, until n bytes in all are written.
- The stpcpy() function returns s1. If s1 contains null bytes, stpncpy()
- returns a pointer to the first such null byte. Otherwise, it returns
- &s1[n].
-
-
- The strlcpy() function copies at most dstsize-1 characters (dstsize
- being the size of the string buffer dst) from src to dst, truncating
- src if necessary. The result is always null-terminated. The function
- returns strlen(src). Buffer overflow can be checked as follows:
-
- if (strlcpy(dst, src, dstsize) >= dstsize)
- return -1;
-
-
-
- If copying takes place between objects that overlap, the behavior of
- these functions is undefined.
-
- strcspn(), strspn()
- The strcspn() function returns the length of the initial segment of
- string s1 that consists entirely of characters not from string s2. The
- strspn() function returns the length of the initial segment of string
- s1 that consists entirely of characters from string s2.
-
- strdup(), strndup(), strdupa(), strndupa()
- The strdup() function returns a pointer to a new string that is a
- duplicate of the string pointed to by s. The returned pointer can be
- passed to free(). The space for the new string is obtained using mal-
- loc(3C). If the new string cannot be created, a null pointer is
- returned and errno may be set to ENOMEM to indicate that the storage
- space available is insufficient.
-
-
- The strndup() function is similar to strdup(), except that it copies at
- most size bytes. If the length of s is larger than size, only size
- bytes are copied and a terminating null byte is added. If size is
- larger than the length of s, all bytes in s are copied, including the
- terminating null character.
-
-
- The strdupa() and strndupa() functions are similar to strdup() and
- strndup(), respectively, but use alloca(3C) to allocate the buffer.
-
- strlen(), strnlen()
- The strlen() function returns the number of bytes in s, not including
- the terminating null character.
-
-
- The strnlen() function returns the smaller of n or the number of bytes
- in s, not including the terminating null character. The strnlen() func-
- tion never examines more than n bytes of the string pointed to by s.
-
- strpbrk()
- The strpbrk() function returns a pointer to the first occurrence in
- string s1 of any character from string s2, or a null pointer if no
- character from s2 exists in s1.
-
- strsep()
- The strsep() function locates, in the null-terminated string referenced
- by *stringp, the first occurrence of any character in the string delim
- (or the terminating '\0' character) and replaces it with a '\0'. The
- location of the next character after the delimiter character (or NULL,
- if the end of the string was reached) is stored in *stringp. The origi-
- nal value of *stringp is returned.
-
-
- An "empty" field (one caused by two adjacent delimiter characters) can
- be detected by comparing the location referenced by the pointer
- returned by strsep() to '\0'.
-
-
- If *stringp is initially NULL, strsep() returns NULL.
-
- strstr(), strnstr(), strcasestr()
- The strstr() function locates the first occurrence of the string s2
- (excluding the terminating null character) in string s1 and returns a
- pointer to the located string, or a null pointer if the string is not
- found. If s2 points to a string with zero length (that is, the string
- ""), the function returns s1.
-
-
- The strnstr() function locates the first occurrence of the null-termi-
- nated string s2 in the string s1, where not more than n characters are
- searched. Characters that appear after a '\0' character are not
- searched.
-
-
- The strcasestr() function is similar to strstr(), but ignores the case
- of both strings.
-
- strtok()
- A sequence of calls to strtok() breaks the string pointed to by s1 into
- a sequence of tokens, each of which is delimited by a byte from the
- string pointed to by s2. The first call in the sequence has s1 as its
- first argument, and is followed by calls with a null pointer as their
- first argument. The separator string pointed to by s2 can be different
- from call to call.
-
-
- The first call in the sequence searches the string pointed to by s1 for
- the first byte that is not contained in the current separator string
- pointed to by s2. If no such byte is found, then there are no tokens in
- the string pointed to by s1 and strtok() returns a null pointer. If
- such a byte is found, it is the start of the first token.
-
-
- The strtok() function then searches from there for a byte that is con-
- tained in the current separator string. If no such byte is found, the
- current token extends to the end of the string pointed to by s1, and
- subsequent searches for a token return a null pointer. If such a byte
- is found, it is overwritten by a null byte that terminates the current
- token. The strtok() function saves a pointer to the following byte in
- thread-specific data, from which the next search for a token starts.
-
-
- Each subsequent call, with a null pointer as the value of the first
- argument, starts searching from the saved pointer and behaves as
- described above.
-
-
- See Example 1, 2, and 3 in the EXAMPLES section for examples of str-
- tok() usage and the explanation in NOTES.
-
- strtok_r()
- The strtok_r() function considers the null-terminated string s1 as a
- sequence of zero or more text tokens separated by spans of one or more
- characters from the separator string s2. The argument lasts points to a
- user-provided pointer which points to stored information necessary for
- strtok_r() to continue scanning the same string.
-
-
- In the first call to strtok_r(), s1 points to a null-terminated string,
- s2 to a null-terminated string of separator characters, and the value
- pointed to by lasts is ignored. The strtok_r() function returns a
- pointer to the first character of the first token, writes a null char-
- acter into s1 immediately following the returned token, and updates the
- pointer to which lasts points.
-
-
- In subsequent calls, s1 is a null pointer and lasts is unchanged from
- the previous call so that subsequent calls move through the string s1,
- returning successive tokens until no tokens remain. The separator
- string s2 can be different from call to call. When no token remains in
- s1, a null pointer is returned.
-
-
- See Example 3 in the EXAMPLES section for an example of strtok_r()
- usage and the explanation in NOTES.
-
- C11 Bounds Checking Interfaces
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(),
- strlen_s(), strerror_s(), and strerrorlen_s() functions are part of the
- C11 bounds checking interfaces specified in the C11 standard, Annex K.
- With the exception of strerrorlen_s(), each provide similar functional-
- ity to their respective non-bounds checking functions, but with addi-
- tional safety checks in the form of explicit runtime constraints as
- defined in the C11 standard. See runtime_constraint_handler(3C) and
- INCITS/ISO/IEC 9899:2011.
-
-
- If no runtime constraint violation is detected, the strcpy_s(),
- strncpy_s(), strcat_s() and strncat_s() functions return zero, other-
- wise, they return a non-zero value.
-
-
- If a runtime constraint violation is detected, or there is no token,
- the strtok_s() function returns a null pointer, otherwise a pointer to
- the first character of the token is returned.
-
-
- If the length of the requested string is less than maxsize, and no run-
- time-constraint violation is detected, the strerror_s() function
- returns zero, otherwise, a non-zero value is returned.
-
-
- The strerrorlen_s() function returns the length (not including the null
- terminator) in the message string strerror_s() would return.
-
-
- The strnlen_s() function returns zero if s is a null pointer. Other-
- wise, the number of bytes preceding the terminating null character is
- returned. If there is no terminating null character in the first max-
- size characters pointed to by s, strnlen_s() returns maxsize.
-
-RETURN VALUES
- The functions will fail if:
-
-
- EINVAL Null pointer is passed or source and destination overlap
-
-
- ERANGE size argument is not valid value
-
-
- EOVERFLOW Destination array is too small
-
-
-
-EXAMPLES
- Example 1 Search for word separators
-
-
-
- The following example searches for tokens separated by space charac-
- ters.
-
-
- #include <string.h>
- ...
- char *token;
- char line[] = "LINE TO BE SEPARATED";
- char *search = " ";
-
- /* Token will point to "LINE". */
- token = strtok(line, search);
-
- /* Token will point to "TO". */
- token = strtok(NULL, search);
-
-
-
- Example 2 Break a Line.
-
-
-
- The following example uses strtok() to break a line into two character
- strings separated by any combination of SPACEs, TABs, or NEWLINEs.
-
-
- #include <string.h>
- ...
- struct element {
- char *key;
- char *data;
- };
- ...
- char line[LINE_MAX];
- char *key, *data;
- ...
- key = strtok(line, " \n");
- data = strtok(NULL, " \n");
-
-
-
- Example 3 Search for tokens
-
-
-
- The following example uses both strtok() and strtok_r() to search for
- tokens separated by one or more characters from the string pointed to
- by the second argument, "/".
-
-
- #define __EXTENSIONS__
- #include <stdio.h>
- #include <string.h>
-
- int main {
- char buf[8]="5/90/45";
- char buf1[14] = "//5//90//45//";
- char *token;
- char *lasts;
-
- printf("tokenizing \"%s\" with strtok:\n", buf);
- if ((token = strtok(buf, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok(NULL, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
-
- printf("\ntokenizing \"%s\" with strtok_r:\n", buf);
- if ((token = strtok_r(buf1, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok_r(NULL, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
- }
-
-
-
+ strcasecmp(), strncasecmp()
+ The strcasecmp() and strncasecmp() functions are case-insensitive ver-
+ sions of strcmp() and strncmp() respectively. They ignore differences
+ in case when comparing lowercase and uppercase characters, using the
+ current locale of the process to determine the case of the characters.
- When compiled and run, this example produces the following output:
-
-
- tokenizing "5/90/45" with strtok():
- token = "5"
- token = "90"
- token = "45"
-
- tokenizing "//5//90//45//" with strtok_r():
- token = "5"
- token = "90"
- token = "45"
+ strcasecmp_l(), strncasecmp_l()
+ The strcasecmp_l() and strncasecmp_l() functions are versions of str-
+ casecmp() and strncasecmp() respectively. They use the locale repre-
+ sented by locale, instead of the current locale of the process.
+ The behavior is undefined if the locale argument is the special locale
+ object LC_GLOBAL_LOCALE or is not a valid locale object handle.
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -564,68 +74,52 @@
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
- |MT-Level |See below |
+ |MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
|Standard |See below |
+-----------------------------+-----------------------------+
- MT-Level
- The strtok() and strdup() functions are MT-Safe.
-
+ Standard
+ See standards(7) for descriptions of the following standards:
- The string(), strcasecmp(), strncasecmp(), strcasecmp_l(), strn-
- casecmp_l(), strcat(), strncat(), strlcat(), strchr(), strrchr(),
- strchrnul(), strcmp(), strncmp(), strcpy(), strncpy(), strlcpy(),
- stpcpy(), stpncpy(), strcspn(), strspn(), strndup(), strdupa(),
- strndupa(), strlen(), strnlen(), strpbrk(), strsep(), strstr(), strn-
- str(), strcasestr(), strtok_r() functions are Async-Signal-Safe.
-
-
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(), str-
- error_s(), strerrorlen_s(), and strnlen_s() functions cannot be used
- safely in a multithreaded application due to the runtime constraint
- handler. For more information, see the runtime_constraint_handler(3C)
- man page.
- Standard
- For all except strlcat(), strlcpy(), and strsep(), see the standards(7)
- man page.
+ +--------------------------------+---------------------------------+
+ | INTERFACES | APPLICABLE STANDARDS |
+ +--------------------------------+---------------------------------+
+ |strcmp(), strncmp() | C89 through C11, |
+ | | POSIX.1-1990 through 2008, |
+ | | SUS through SUSv4, |
+ | | XPG1 through XPG7 |
+ | | |
+ +--------------------------------+---------------------------------+
+ |strcasecmp(), strncasecmp() | POSIX.1-2001 through 2008, |
+ | | SUSv3 through SUSv4, |
+ | | XPG6 through XPG7 |
+ | | |
+ +--------------------------------+---------------------------------+
+ |strcasecmp_l(), strncasecmp_l() | POSIX.1-2008, |
+ | | SUSv4, |
+ | | XPG7 |
+ | | |
+ +--------------------------------+---------------------------------+
SEE ALSO
- alloca(3C), malloc(3C), setlocale(3C), strxfrm(3C), attributes(7),
- standards(7), runtime_constraint_handler(3C)
+ memcmp(3C), newlocale(3C), setlocale(3C), strcoll(3C), string(3C),
+ strxfrm(3C), u8_strcmp(3C), wcscmp(3C), wcscoll(3C), attributes(7),
+ standards(7)
NOTES
- A single-threaded application can gain access to strtok_r() only by
- defining __EXTENSIONS__ or by defining _POSIX_C_SOURCE to a value
- greater than or equal to 199506L.
-
-
- All of these functions assume the default locale "C." For some locales,
- strxfrm(3C) should be applied to the strings before they are passed to
- the functions.
-
+ For some locales, strxfrm(3C) should be applied to the strings before
+ they are passed to the functions.
- The strtok() function is safe to use in multithreaded applications
- because it saves its internal state in a thread-specific data area.
- However, its use is discouraged, even for single-threaded applications.
- The strtok_r() function should be used instead.
+HISTORY
+ The strcasecmp_l() and strncasecmp_l() functions were added to Oracle
+ Solaris in the Solaris 11.4.0 release.
- Do not pass the address of a character string literal as the argument
- s1 to either strtok() or strtok_r(). Similarly, do not pass a pointer
- to the address of a character string literal as the argument stringp to
- strsep(). These functions can modify the storage pointed to by s1 in
- the case of strtok() and strtok_r() or *stringp in the case of
- strsep(). The C99 standard specifies that attempting to modify the
- storage occupied by a string literal results in undefined behavior.
- This allows compilers (including gcc, clang, and the Oracle Developer
- Studio compilers) to place string literals in read-only memory. Note
- that in Example 1 above, this problem is avoided because the variable
- line is declared as a writable array of type char that is initialized
- by a string literal rather than a pointer to char that points to a
- string literal.
+ The strcmp(), strcasecmp(), strncasecmp(), strncmp() functions have
+ been included in all Sun and Oracle releases of Solaris.
-Oracle Solaris 11.4 11 May 2021 string(3C)
+Oracle Solaris 11.4 28 Feb 2022 strcmp(3C)
diff -NurbBw 11.4.42/man3c/strcoll.3c 11.4.45/man3c/strcoll.3c
--- 11.4.42/man3c/strcoll.3c 2022-05-17 14:50:16.945260493 -0700
+++ 11.4.45/man3c/strcoll.3c 2022-05-17 14:50:59.747872574 -0700
@@ -14,18 +14,11 @@
int strcoll_l(const char *s1, const char *s2, locale_t locale);
DESCRIPTION
- Both strcoll() and strxfrm(3C) provide for locale-specific string sort-
- ing. strcoll() is intended for applications in which the number of com-
- parisons per string is small. When strings are to be compared a number
- of times, strxfrm(3C) is a more appropriate function because the trans-
- formation process occurs only once. Same applies between strcoll_l()
- and strxfrm_l(3C).
-
-
The strcoll() and strcoll_l() functions compare the string pointed to
- by s1 to the string pointed to by s2, both interpreted as appropriate
- to the LC_COLLATE category of the current locale, or of the locale rep-
- resented by locale, respectively.
+ by s1 to the string pointed to by s2. For strcoll(), both strings are
+ interpreted as appropriate to the LC_COLLATE category of the current
+ locale. For strcoll_l(), both strings are interpreted as appropriate to
+ the LC_COLLATE category of the locale represented by locale.
The strcoll() and strcoll_l() functions do not change the setting of
@@ -37,9 +30,9 @@
strcoll() or strcoll_l(), then check errno.
- The behavior is undefined if the <locale> argument to strcoll_l() is
- the special locale object LC_GLOBAL_LOCALE or is not a valid locale
- object handle.
+ The behavior is undefined if the locale argument to strcoll_l() is the
+ special locale object LC_GLOBAL_LOCALE or is not a valid locale object
+ handle.
RETURN VALUES
Upon successful completion, strcoll() and strcoll_l() return an integer
@@ -53,8 +46,16 @@
On error, strcoll() and strcoll_l() may set errno, but no return value
is reserved to indicate an error.
+USAGE
+ Both strcoll() and strxfrm(3C) provide for locale-specific string sort-
+ ing. strcoll() is intended for applications in which the number of com-
+ parisons per string is small. When strings are to be compared a number
+ of times, strxfrm(3C) is a more appropriate function because the trans-
+ formation process occurs only once. The same applies between str-
+ coll_l() and strxfrm_l(3C).
+
ERRORS
- The strcoll() and strcoll_l() function may fail if:
+ The strcoll() and strcoll_l() functions may fail if:
EINVAL The s1 or s2 arguments contain characters outside the domain
of the collating sequence.
@@ -83,10 +84,23 @@
+-----------------------------+-----------------------------+
SEE ALSO
- wsxfrm(3C), localedef(1), duplocale(3C), freelocale(3C), newlocale(3C),
- setlocale(3C), string(3C), strxfrm(3C), uselocale(3C), attributes(7),
- environ(7), standards(7)
+ localedef(1), duplocale(3C), freelocale(3C), newlocale(3C), setlo-
+ cale(3C), strcmp(3C), string(3C), strxfrm(3C), wcscoll(3C),
+ wcsxfrm(3C), u8_strcmp(3C), uselocale(3C), attributes(7), environ(7),
+ standards(7)
+
+
+ Handling Characters and Character Strings in Internationalizing and
+ Localizing Applications in Oracle Solaris
+
+HISTORY
+ The strcoll_l() function was added to Oracle Solaris in the Solaris
+ 11.4.0 release.
+
+
+ The strcoll() function has been included in Solaris since the Solaris
+ 2.0 release.
-Oracle Solaris 11.4 10 Oct 2014 strcoll(3C)
+Oracle Solaris 11.4 28 Feb 2022 strcoll(3C)
diff -NurbBw 11.4.42/man3c/strdup.3c 11.4.45/man3c/strdup.3c
--- 11.4.42/man3c/strdup.3c 2022-05-17 14:50:17.130900867 -0700
+++ 11.4.45/man3c/strdup.3c 2022-05-17 14:50:59.915765190 -0700
@@ -1,78 +1,13 @@
-Standard C Library Functions string(3C)
+Standard C Library Functions strdup(3C)
NAME
- string, strcasecmp, strncasecmp, strcasecmp_l, strncasecmp_l, strcat,
- strncat, strlcat, strchr, strrchr, strchrnul, strcmp, strncmp, strcpy,
- strncpy, strlcpy, stpcpy, stpncpy, strcspn, strspn, strdup, strndup,
- strdupa, strndupa, strlen, strnlen, strpbrk, strsep, strstr, strnstr,
- strcasestr, strtok, strtok_r - string operations
- strcpy_s, strncpy_s, strcat_s, strncat_s, strtok_s, strerror_s, str-
- errorlen_s, strnlen_s - string operations with additional safety checks
+ strdup, strndup, strdupa, strndupa - string duplication
SYNOPSIS
- #include <strings.h>
-
- int strcasecmp(const char *s1, const char *s2);
-
-
- int strncasecmp(const char *s1, const char *s2, size_t n);
-
-
- int strcasecmp_l(const char *s1, const char *s2, locale_t locale);
-
-
- int strncasecmp_l(const char *s1, const char *s2, size_t n, locale_t locale);
-
-
#include <string.h>
- char *strcat(char *restrict s1, const char *restrict s2);
-
-
- char *strncat(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcat(char *dst, const char *src, size_t dstsize);
-
-
- char *strchr(const char *s, int c);
-
-
- char *strrchr(const char *s, int c);
-
-
- char *strchrnul(const char *s, int c);
-
-
- int strcmp(const char *s1, const char *s2);
-
-
- int strncmp(const char *s1, const char *s2, size_t n);
-
-
- char *strcpy(char *restrict s1, const char *restrict s2);
-
-
- char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcpy(char *dst, const char *src, size_t dstsize);
-
-
- char *stpcpy(char *restrict s1, const char *restrict s2);
-
-
- char *stpncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strcspn(const char *s1, const char *s2);
-
-
- size_t strspn(const char *s1, const char *s2);
-
-
char *strdup(const char *s);
@@ -84,210 +19,28 @@
char *strndupa(const char *s, size_t size);
+DESCRIPTION
+ These functions return a pointer to a newly allocated string (array of
+ characters) which is a duplicate of the string s. Depending on the
+ function, the provided strings may be either terminated by a null char-
+ acter or bounded by a maximum length of n bytes. The newly allocated
+ strings will always be null-terminated.
- size_t strlen(const char *s);
-
-
- size_t strnlen(const char *s, size_t n);
-
-
- char *strpbrk(const char *s1, const char *s2);
-
-
- char *strsep(char **stringp, const char *delim);
-
-
- char *strstr(const char *s1, const char *s2);
-
-
- char *strnstr(const char *s1, const char *s2, size_t n);
-
-
- char *strcasestr(const char *s1, const char *s2);
-
-
- char *strtok(char *restrict s1, const char *restrict s2);
-
-
- char *strtok_r(char *s1, const char *s2, char **lasts);
-
-
- #define __STDC_WANT_LIB_EXT1__ 1
- #include <stdlib.h>
-
- errno_t strcpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- errno_t strcat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- char *strtok_s(char *restrict s1, rsize_t *restrict s1max,
- const char *restrict s2, char **restrict ptr);
-
-
- errno_t strerror_s(char *s, rsize_t maxsize, errno_t errnum);
-
-
- size_t strerrorlen_s(errno_t errnum);
-
-
- size_t strnlen_s(const char *s, size_t maxsize);
-
- ISO C++
- #include <string.h>
-
- const char *strchr(const char *s, int c);
-
-
- const char *strpbrk(const char *s1, const char *s2);
-
-
- const char *strrchr(const char *s, int c);
-
-
- const char *strstr(const char *s1, const char *s2);
-
-
- #include <cstring>
-
- char *std::strchr(char *s, int c);
-
-
- char *std::strpbrk(char *s1, const char *s2);
-
-
- char *std::strrchr(char *s, int c);
+ All character counts are measured in individual bytes, even if a string
+ with multibyte characters is used, which may result in copying only
+ part of a multibyte character if the full character does not fit within
+ the byte count specified. They do not check for null pointers, and pro-
+ grams may crash if passing null or otherwise invalid pointers to these
+ functions.
- char *std::strstr(char *s1, const char *s2);
-DESCRIPTION
- The arguments s, s1, and s2 point to strings (arrays of characters ter-
- minated by a null character). The strcat(), strncat(), strlcat(), str-
- cpy(), strncpy(), strlcpy(), strsep(), strtok(), and strtok_r() func-
- tions all alter their first argument. Additionally, the strcat() and
- strcpy() functions do not check for overflow of the array.
-
- strcasecmp(), strncasecmp()
- The strcasecmp() and strncasecmp() functions are case-insensitive ver-
- sions of strcmp() and strncmp() respectively, described below. They
- ignore differences in case when comparing lower and uppercase charac-
- ters, using the current locale of the process to determine the case of
- the characters.
-
- strcasecmp_l(), strncasecmp_l()
- The strcasecmp_l() and strncasecmp_l() functions are versions of str-
- casecmp() and strncasecmp() respectively. They use locale represented
- by <locale>, instead of current locale of the process.
-
-
- The behavior is undefined if the <locale> argument is the special
- locale object LC_GLOBAL_LOCALE or is not a valid locale object handle.
-
- strcat(), strncat(), strlcat()
- The strcat() function appends a copy of string s2, including the termi-
- nating null character, to the end of string s1. The strncat() function
- appends at most n characters. Each returns a pointer to the null-termi-
- nated result. The initial character of s2 overrides the null character
- at the end of s1. If copying takes place between objects that overlap,
- the behavior of strcat(), strncat(), and strlcat() is undefined.
-
-
- The strlcat() function appends at most (dstsize-strlen(dst)-1) charac-
- ters of src to dst (dstsize being the size of the string buffer dst).
- If the string pointed to by dst contains a null-terminated string that
- fits into dstsize bytes when strlcat() is called, the string pointed to
- by dst will be a null-terminated string that fits in dstsize bytes
- (including the terminating null character) when it completes, and the
- initial character of src will override the null character at the end of
- dst. If the string pointed to by dst is longer than dstsize bytes when
- strlcat() is called, the string pointed to by dst will not be changed.
- The function returns min{dstsize,strlen(dst)}+ strlen(src). Buffer
- overflow can be checked as follows:
-
- if (strlcat(dst, src, dstsize) >= dstsize)
- return -1;
-
-
- strchr(), strrchr(), strchrnul()
- The strchr() function returns a pointer to the first occurrence of c
- (converted to a char) in string s, or a null pointer if c does not
- occur in the string.
-
-
- The strrchr() function returns a pointer to the last occurrence of c.
- The null character terminating a string is considered to be part of the
- string.
-
-
- The strchrnul() function is similar to strchr() except that if c is not
- found in s, it returns a pointer to the null byte at the end of s,
- rather than NULL.
-
- strcmp(), strncmp()
- The strcmp() function compares two strings byte-by-byte, according to
- the ordering of your machine's character set. The function returns an
- integer greater than, equal to, or less than 0, if the string pointed
- to by s1 is greater than, equal to, or less than the string pointed to
- by s2 respectively. The sign of a non-zero return value is determined
- by the sign of the difference between the values of the first pair of
- bytes that differ in the strings being compared. The strncmp() function
- makes the same comparison but looks at a maximum of n bytes. Bytes fol-
- lowing a null byte are not compared.
-
- strcpy(), stpcpy(), strncpy(), stpncpy(), strlcpy()
- The strcpy() and stpcpy() functions copy string s2 to s1, including the
- terminating null character, stopping after the null character has been
- copied. The strcpy() function returns s1. The stpcpy() function returns
- a pointer to the terminating null character copied into the s1 array.
-
-
- The strncpy() and stpncpy() functions copy not more than n bytes (bytes
- that follow a null byte are not copied) from the array pointed to by s2
- to the array pointed to by s1. If the array pointed to by s2 is a
- string that is shorter than n bytes, null bytes are appended to the
- copy in the array pointed to by s1, until n bytes in all are written.
- The stpcpy() function returns s1. If s1 contains null bytes, stpncpy()
- returns a pointer to the first such null byte. Otherwise, it returns
- &s1[n].
-
-
- The strlcpy() function copies at most dstsize-1 characters (dstsize
- being the size of the string buffer dst) from src to dst, truncating
- src if necessary. The result is always null-terminated. The function
- returns strlen(src). Buffer overflow can be checked as follows:
-
- if (strlcpy(dst, src, dstsize) >= dstsize)
- return -1;
-
-
-
- If copying takes place between objects that overlap, the behavior of
- these functions is undefined.
-
- strcspn(), strspn()
- The strcspn() function returns the length of the initial segment of
- string s1 that consists entirely of characters not from string s2. The
- strspn() function returns the length of the initial segment of string
- s1 that consists entirely of characters from string s2.
-
- strdup(), strndup(), strdupa(), strndupa()
The strdup() function returns a pointer to a new string that is a
- duplicate of the string pointed to by s. The returned pointer can be
- passed to free(). The space for the new string is obtained using mal-
- loc(3C). If the new string cannot be created, a null pointer is
- returned and errno may be set to ENOMEM to indicate that the storage
- space available is insufficient.
+ duplicate of the null-terminated string pointed to by s. The returned
+ pointer can be passed to free(). The space for the new string is
+ obtained using malloc(3C). If the new string cannot be created, a null
+ pointer is returned and errno may be set to ENOMEM to indicate that the
+ storage space available is insufficient.
The strndup() function is similar to strdup(), except that it copies at
@@ -300,261 +53,6 @@
The strdupa() and strndupa() functions are similar to strdup() and
strndup(), respectively, but use alloca(3C) to allocate the buffer.
- strlen(), strnlen()
- The strlen() function returns the number of bytes in s, not including
- the terminating null character.
-
-
- The strnlen() function returns the smaller of n or the number of bytes
- in s, not including the terminating null character. The strnlen() func-
- tion never examines more than n bytes of the string pointed to by s.
-
- strpbrk()
- The strpbrk() function returns a pointer to the first occurrence in
- string s1 of any character from string s2, or a null pointer if no
- character from s2 exists in s1.
-
- strsep()
- The strsep() function locates, in the null-terminated string referenced
- by *stringp, the first occurrence of any character in the string delim
- (or the terminating '\0' character) and replaces it with a '\0'. The
- location of the next character after the delimiter character (or NULL,
- if the end of the string was reached) is stored in *stringp. The origi-
- nal value of *stringp is returned.
-
-
- An "empty" field (one caused by two adjacent delimiter characters) can
- be detected by comparing the location referenced by the pointer
- returned by strsep() to '\0'.
-
-
- If *stringp is initially NULL, strsep() returns NULL.
-
- strstr(), strnstr(), strcasestr()
- The strstr() function locates the first occurrence of the string s2
- (excluding the terminating null character) in string s1 and returns a
- pointer to the located string, or a null pointer if the string is not
- found. If s2 points to a string with zero length (that is, the string
- ""), the function returns s1.
-
-
- The strnstr() function locates the first occurrence of the null-termi-
- nated string s2 in the string s1, where not more than n characters are
- searched. Characters that appear after a '\0' character are not
- searched.
-
-
- The strcasestr() function is similar to strstr(), but ignores the case
- of both strings.
-
- strtok()
- A sequence of calls to strtok() breaks the string pointed to by s1 into
- a sequence of tokens, each of which is delimited by a byte from the
- string pointed to by s2. The first call in the sequence has s1 as its
- first argument, and is followed by calls with a null pointer as their
- first argument. The separator string pointed to by s2 can be different
- from call to call.
-
-
- The first call in the sequence searches the string pointed to by s1 for
- the first byte that is not contained in the current separator string
- pointed to by s2. If no such byte is found, then there are no tokens in
- the string pointed to by s1 and strtok() returns a null pointer. If
- such a byte is found, it is the start of the first token.
-
-
- The strtok() function then searches from there for a byte that is con-
- tained in the current separator string. If no such byte is found, the
- current token extends to the end of the string pointed to by s1, and
- subsequent searches for a token return a null pointer. If such a byte
- is found, it is overwritten by a null byte that terminates the current
- token. The strtok() function saves a pointer to the following byte in
- thread-specific data, from which the next search for a token starts.
-
-
- Each subsequent call, with a null pointer as the value of the first
- argument, starts searching from the saved pointer and behaves as
- described above.
-
-
- See Example 1, 2, and 3 in the EXAMPLES section for examples of str-
- tok() usage and the explanation in NOTES.
-
- strtok_r()
- The strtok_r() function considers the null-terminated string s1 as a
- sequence of zero or more text tokens separated by spans of one or more
- characters from the separator string s2. The argument lasts points to a
- user-provided pointer which points to stored information necessary for
- strtok_r() to continue scanning the same string.
-
-
- In the first call to strtok_r(), s1 points to a null-terminated string,
- s2 to a null-terminated string of separator characters, and the value
- pointed to by lasts is ignored. The strtok_r() function returns a
- pointer to the first character of the first token, writes a null char-
- acter into s1 immediately following the returned token, and updates the
- pointer to which lasts points.
-
-
- In subsequent calls, s1 is a null pointer and lasts is unchanged from
- the previous call so that subsequent calls move through the string s1,
- returning successive tokens until no tokens remain. The separator
- string s2 can be different from call to call. When no token remains in
- s1, a null pointer is returned.
-
-
- See Example 3 in the EXAMPLES section for an example of strtok_r()
- usage and the explanation in NOTES.
-
- C11 Bounds Checking Interfaces
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(),
- strlen_s(), strerror_s(), and strerrorlen_s() functions are part of the
- C11 bounds checking interfaces specified in the C11 standard, Annex K.
- With the exception of strerrorlen_s(), each provide similar functional-
- ity to their respective non-bounds checking functions, but with addi-
- tional safety checks in the form of explicit runtime constraints as
- defined in the C11 standard. See runtime_constraint_handler(3C) and
- INCITS/ISO/IEC 9899:2011.
-
-
- If no runtime constraint violation is detected, the strcpy_s(),
- strncpy_s(), strcat_s() and strncat_s() functions return zero, other-
- wise, they return a non-zero value.
-
-
- If a runtime constraint violation is detected, or there is no token,
- the strtok_s() function returns a null pointer, otherwise a pointer to
- the first character of the token is returned.
-
-
- If the length of the requested string is less than maxsize, and no run-
- time-constraint violation is detected, the strerror_s() function
- returns zero, otherwise, a non-zero value is returned.
-
-
- The strerrorlen_s() function returns the length (not including the null
- terminator) in the message string strerror_s() would return.
-
-
- The strnlen_s() function returns zero if s is a null pointer. Other-
- wise, the number of bytes preceding the terminating null character is
- returned. If there is no terminating null character in the first max-
- size characters pointed to by s, strnlen_s() returns maxsize.
-
-RETURN VALUES
- The functions will fail if:
-
-
- EINVAL Null pointer is passed or source and destination overlap
-
-
- ERANGE size argument is not valid value
-
-
- EOVERFLOW Destination array is too small
-
-
-
-EXAMPLES
- Example 1 Search for word separators
-
-
-
- The following example searches for tokens separated by space charac-
- ters.
-
-
- #include <string.h>
- ...
- char *token;
- char line[] = "LINE TO BE SEPARATED";
- char *search = " ";
-
- /* Token will point to "LINE". */
- token = strtok(line, search);
-
- /* Token will point to "TO". */
- token = strtok(NULL, search);
-
-
-
- Example 2 Break a Line.
-
-
-
- The following example uses strtok() to break a line into two character
- strings separated by any combination of SPACEs, TABs, or NEWLINEs.
-
-
- #include <string.h>
- ...
- struct element {
- char *key;
- char *data;
- };
- ...
- char line[LINE_MAX];
- char *key, *data;
- ...
- key = strtok(line, " \n");
- data = strtok(NULL, " \n");
-
-
-
- Example 3 Search for tokens
-
-
-
- The following example uses both strtok() and strtok_r() to search for
- tokens separated by one or more characters from the string pointed to
- by the second argument, "/".
-
-
- #define __EXTENSIONS__
- #include <stdio.h>
- #include <string.h>
-
- int main {
- char buf[8]="5/90/45";
- char buf1[14] = "//5//90//45//";
- char *token;
- char *lasts;
-
- printf("tokenizing \"%s\" with strtok:\n", buf);
- if ((token = strtok(buf, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok(NULL, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
-
- printf("\ntokenizing \"%s\" with strtok_r:\n", buf);
- if ((token = strtok_r(buf1, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok_r(NULL, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
- }
-
-
-
-
- When compiled and run, this example produces the following output:
-
-
- tokenizing "5/90/45" with strtok():
- token = "5"
- token = "90"
- token = "45"
-
- tokenizing "//5//90//45//" with strtok_r():
- token = "5"
- token = "90"
- token = "45"
-
-
-
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -570,62 +68,43 @@
+-----------------------------+-----------------------------+
MT-Level
- The strtok() and strdup() functions are MT-Safe.
+ The strdup() and strndup() functions are MT-Safe.
- The string(), strcasecmp(), strncasecmp(), strcasecmp_l(), strn-
- casecmp_l(), strcat(), strncat(), strlcat(), strchr(), strrchr(),
- strchrnul(), strcmp(), strncmp(), strcpy(), strncpy(), strlcpy(),
- stpcpy(), stpncpy(), strcspn(), strspn(), strndup(), strdupa(),
- strndupa(), strlen(), strnlen(), strpbrk(), strsep(), strstr(), strn-
- str(), strcasestr(), strtok_r() functions are Async-Signal-Safe.
-
-
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(), str-
- error_s(), strerrorlen_s(), and strnlen_s() functions cannot be used
- safely in a multithreaded application due to the runtime constraint
- handler. For more information, see the runtime_constraint_handler(3C)
- man page.
+ The strdupa() and strndupa() functions are Async-Signal-Safe.
Standard
- For all except strlcat(), strlcpy(), and strsep(), see the standards(7)
- man page.
-
-SEE ALSO
- alloca(3C), malloc(3C), setlocale(3C), strxfrm(3C), attributes(7),
- standards(7), runtime_constraint_handler(3C)
+ See standards(7) for descriptions of the following standards:
-NOTES
- A single-threaded application can gain access to strtok_r() only by
- defining __EXTENSIONS__ or by defining _POSIX_C_SOURCE to a value
- greater than or equal to 199506L.
+ +--------------------------+--------------------------------+
+ | INTERFACES | APPLICABLE STANDARDS |
+ +--------------------------+--------------------------------+
+ |strdup() | POSIX.1-2001 through 2008, |
+ | | SUSv3 through SUSv4, |
+ | | XPG6 through XPG7 |
+ | | |
+ +--------------------------+--------------------------------+
+ |strndup() | POSIX.1-2008, |
+ | | SUSv4, |
+ | | XPG7 |
+ | | |
+ +--------------------------+--------------------------------+
+ |strdupa(), strndupa() |None |
+ +--------------------------+--------------------------------+
- All of these functions assume the default locale "C." For some locales,
- strxfrm(3C) should be applied to the strings before they are passed to
- the functions.
-
+SEE ALSO
+ alloca(3C), malloc(3C), string(3C), wcsdup(3C), attributes(7), stan-
+ dards(7)
- The strtok() function is safe to use in multithreaded applications
- because it saves its internal state in a thread-specific data area.
- However, its use is discouraged, even for single-threaded applications.
- The strtok_r() function should be used instead.
+HISTORY
+ The strndup(), strdupa(), and strndupa() functions were added to Oracle
+ Solaris in the Solaris 11.0.0 release.
- Do not pass the address of a character string literal as the argument
- s1 to either strtok() or strtok_r(). Similarly, do not pass a pointer
- to the address of a character string literal as the argument stringp to
- strsep(). These functions can modify the storage pointed to by s1 in
- the case of strtok() and strtok_r() or *stringp in the case of
- strsep(). The C99 standard specifies that attempting to modify the
- storage occupied by a string literal results in undefined behavior.
- This allows compilers (including gcc, clang, and the Oracle Developer
- Studio compilers) to place string literals in read-only memory. Note
- that in Example 1 above, this problem is avoided because the variable
- line is declared as a writable array of type char that is initialized
- by a string literal rather than a pointer to char that points to a
- string literal.
+ The strdup() function has been included in all Sun and Oracle releases
+ of Solaris.
-Oracle Solaris 11.4 11 May 2021 string(3C)
+Oracle Solaris 11.4 28 Feb 2022 strdup(3C)
diff -NurbBw 11.4.42/man3c/strerror.3c 11.4.45/man3c/strerror.3c
--- 11.4.42/man3c/strerror.3c 2022-05-17 14:50:17.291255565 -0700
+++ 11.4.45/man3c/strerror.3c 2022-05-17 14:51:00.087647594 -0700
@@ -3,7 +3,8 @@
NAME
- strerror, strerror_l, strerror_r - get error message string
+ strerror, strerror_l, strerror_r, strerror_s, strerrorlen_s - get error
+ message string
SYNOPSIS
#include <string.h>
@@ -16,49 +17,69 @@
int strerror_r(int errnum, char *strerrbuf, size_t buflen);
+ C11 Bounds Checking Interfaces
+ #define __STDC_WANT_LIB_EXT1__ 1
+ #include <string.h>
+
+ errno_t strerror_s(char *strerrbuf, rsize_t maxsize, errno_t errnum);
+
+
+ size_t strerrorlen_s(errno_t errnum);
+
DESCRIPTION
- The strerror() function maps the error number in errnum to a locale-
- dependent error message string determined by the setting of the LC_MES-
- SAGES category in the current locale, and returns a pointer to that
- string. It uses the same set of error messages as perror(3C).
+ The strerror() and strerror_l() functions map the error number in
+ errnum to a locale-dependent error message string, and return a pointer
+ to that string. They use the same set of error messages as perror(3C).
+
+
+ For strerror(), the string is determined by the setting of the LC_MES-
+ SAGES category in the current locale. For strerror_l(), the string is
+ determined by the setting of the LC_MESSAGES category in the locale
+ specified by the locale argument. The behavior is undefined if the
+ locale argument to strerror_l() is the special locale object
+ LC_GLOBAL_LOCALE or is not a valid locale object handle.
The application shall not modify the string returned. The returned
string pointer might be invalidated or the string content might be
- overwritten by a subsequent call to strerror(), or by a subsequent call
- to strerror_l() in the same thread.
+ overwritten by a subsequent call to strerror() or strerror_l() in the
+ same thread. The returned pointer and the string content might also be
+ invalidated if the calling thread is terminated.
- Since no return value is reserved to indicate an error of strerror(),
- an application wishing to check for error situations should set errno
- to 0, then call strerror(), then check errno.
+ Since no return value is reserved to indicate an error of strerror() or
+ strerror_l(), an application wishing to check for error situations
+ should set errno to 0, then call strerror() or strerror_l(), then check
+ errno.
- The strerror_l() function maps the error number in errnum to a locale-
- dependent error message string in the locale represented by locale, and
- returns a pointer to that string. It uses the same set of error mes-
- sages as perror(3C). The returned string should not be overwritten.
-
+ The strerror_r() function maps the error number in errnum to a locale-
+ dependent error message string determined by the setting of the LC_MES-
+ SAGES category in the current locale, and copies the string into the
+ buffer pointed to by strerrbuf, if the string (including the null ter-
+ minator), will fit in the length specified in buflen.
- Since strerror_l() is required to return a string for some errors, an
- application wishing to check for all error situations should set errno
- to 0, then call strerror_l(), then check errno.
+ C11 Bounds Checking Interfaces
+ The strerror_s() and strerrorlen_s() functions are part of the C11
+ bounds checking interfaces specified in the C11 standard, Annex K.
- The behavior is undefined if the <locale> argument to strerror_l() is
- the special locale object LC_GLOBAL_LOCALE or is not a valid locale
- object handle.
+ strerror_s() provides similar functionality to the strerror_r() func-
+ tion, but with additional safety checks in the form of explicit runtime
+ constraints as defined in the C11 standard. See runtime_constraint_han-
+ dler(3C) and INCITS/ISO/IEC 9899:2011.
- The strerror_r() function maps the error number in errnum to an error
- message string and returns the string in the buffer pointed to by str-
- errbuf with length buflen.
+ The strerrorlen_s() function returns the length (not including the null
+ terminator) of the message string strerror_s() would return for the
+ given errnum in the current locale.
RETURN VALUES
Upon successful completion, strerror() and strerror_l() return a
- pointer to the generated message string. Otherwise, it sets errno and
- returns a pointer to an error message string. It returns the string
- "Unknown error" if errnum is not a valid error number.
+ pointer to the generated message string. Otherwise, they set errno and
+ return a pointer to an error message string. They return a locale-
+ dependent version of the string "Unknown error" if errnum is not a
+ valid error number.
Upon successful completion, strerror_r() returns 0. Otherwise it sets
@@ -66,6 +87,16 @@
the string "Unknown error" in the buffer pointed to by strerrbuf if
errnum is not a valid error number.
+
+ If the length of the requested string is less than maxsize, and no run-
+ time-constraint violation is detected, the strerror_s() function
+ returns zero. If a runtime constraint violation is detected and the
+ handler returns, they return a non-zero value.
+
+
+ The strerrorlen_s() function returns the length (not including the null
+ terminator) of the message string strerror_s() would return.
+
ERRORS
These functions may fail if:
@@ -92,15 +123,73 @@
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
- |MT-Level |Safe |
+ |MT-Level |See below. |
+-----------------------------+-----------------------------+
- |Standard |See standards(7). |
+ |Standard |See below. |
+-----------------------------+-----------------------------+
+ MT-Level
+ The strerror() and strerror_r() functions can be used safely in multi-
+ threaded applications, as long as setlocale(3C) is not being called to
+ change the locale.
+
+
+ The strerror_l() function can be used safely in multithreaded applica-
+ tions as long as the locale parameter is not the special locale object
+ LC_GLOBAL_LOCALE.
+
+
+ The strerror_s() and strerrorlen_s() functions cannot be used safely in
+ a multithreaded application due to the runtime constraint handler. For
+ more information, see the runtime_constraint_handler(3C) man page.
+ Additionally, if setlocale(3C) is called in any thread during or
+ between the calls to strerrorlen_s() and strerror_s(), the size
+ returned by strerrorlen_s() may not match the length of the string
+ returned by strerror_s() in the new locale.
+
+ Standard
+ See standards(7) for descriptions of the following standards:
+
+
+ +------------------------------+-----------------------------------+
+ | INTERFACES | APPLICABLE STANDARDS |
+ +------------------------------+-----------------------------------+
+ |strerror() | C89 through C11, |
+ | | POSIX.1-2001 through 2008, |
+ | | SUS through SUSv4, |
+ | | XPG3 through XPG7 |
+ | | |
+ +------------------------------+-----------------------------------+
+ |strerror_r() | POSIX.1-2001 through 2008, |
+ | | SUSv3 through SUSv4, |
+ | | XPG6 through XPG7 |
+ | | |
+ +------------------------------+-----------------------------------+
+ |strerror_l() | POSIX.1-2008, |
+ | | SUSv4, |
+ | | XPG7 |
+ | | |
+ +------------------------------+-----------------------------------+
+ |strerror_s(), strerrorlen_s() | C11 Annex K |
+ +------------------------------+-----------------------------------+
+
SEE ALSO
- duplocale(3C), freelocale(3C), gettext(3C), newlocale(3C), perror(3C),
- setlocale(3C), uselocale(3C), attributes(7), standards(7)
+ Intro(2), duplocale(3C), freelocale(3C), gettext(3C), newlocale(3C),
+ perror(3C), setlocale(3C), strerrordesc_np(3C), uselocale(3C),
+ attributes(7), standards(7)
+
+HISTORY
+ The strerror_l(), strerror_s(), and strerrorlen_s() functions were
+ added to Solaris in the Oracle Solaris 11.4.0 release.
+
+
+ The strerror_r() function was added to Solaris in the Solaris 10 3/05
+ release.
+
+
+ The strerror() function was added to Solaris in the Solaris 2.0
+ release.
-Oracle Solaris 11.4 10 Oct 2014 strerror(3C)
+Oracle Solaris 11.4 28 Feb 2022 strerror(3C)
diff -NurbBw 11.4.42/man3c/strerrordesc_np.3c 11.4.45/man3c/strerrordesc_np.3c
--- 11.4.42/man3c/strerrordesc_np.3c 2022-05-17 14:50:17.316334676 -0700
+++ 11.4.45/man3c/strerrordesc_np.3c 2022-05-17 14:51:00.121113687 -0700
@@ -52,15 +52,17 @@
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
+ |Standard |None |
+ +-----------------------------+-----------------------------+
SEE ALSO
- perror(3C), strerror(3C),
+ Intro(2), perror(3C), strerror(3C)
HISTORY
- The strerrordesc_np(), and strerrorname_np() functions were defined in
+ The strerrordesc_np() and strerrorname_np() functions were defined in
GNU glibc 2.32, and were added to Oracle Solaris in the Oracle Solaris
11.4.30 release.
-Oracle Solaris 11.4 2 November 2020 strerrordesc_np(3C)
+Oracle Solaris 11.4 28 Feb 2022 strerrordesc_np(3C)
diff -NurbBw 11.4.42/man3c/strftime.3c 11.4.45/man3c/strftime.3c
--- 11.4.42/man3c/strftime.3c 2022-05-17 14:50:17.504983999 -0700
+++ 11.4.45/man3c/strftime.3c 2022-05-17 14:51:00.273037223 -0700
@@ -579,21 +579,39 @@
- The following example illustrates the use of strftime() for the POSIX
- locale. It shows what the string in str would look like if the struc-
- ture pointed to by tmptr contains the values corresponding to Thursday,
- August 28, 1986 at 12:44:36.
+ The following example illustrates the use of strftime() to format a
+ date and time in the ISO 8601:2019 extended format. It shows what the
+ string in str would look like if the structure pointed to by tmptr con-
+ tains the values corresponding to Thursday, August 28, 1986 at
+ 12:44:36.
- strftime(str, strsize, "%A %b %d %j", tmptr)
+ strftime(str, strsize, "%FT%T", tmptr)
- This results in str containing "Thursday Aug 28 240".
+ This results in str containing "1986-08-28T12:44:36".
+ Example 2 Locale appropriate date and time
- Example 2 Using flag and field width at conversion specification.
+
+
+ Generate the long form date and time represented by the variable now in
+ the current locale appropriate order. Note that even in two different
+ English locales this results in a string of different lengths and field
+ order:
+
+
+ strftime(str, strsize, "%c", now)
+
+
+
+ o en_US: "January 13, 2022 at 1:38:49 PM GMT"
+
+ o en_GB: "13 January 2022 at 13:38:49 GMT"
+
+ Example 3 Using flag and field width at conversion specification.
@@ -676,4 +694,4 @@
-Oracle Solaris 11.4 11 May 2021 strftime(3C)
+Oracle Solaris 11.4 13 Jan 2022 strftime(3C)
diff -NurbBw 11.4.42/man3c/string.3c 11.4.45/man3c/string.3c
--- 11.4.42/man3c/string.3c 2022-05-17 14:50:17.578638172 -0700
+++ 11.4.45/man3c/string.3c 2022-05-17 14:51:00.299976547 -0700
@@ -3,629 +3,103 @@
NAME
- string, strcasecmp, strncasecmp, strcasecmp_l, strncasecmp_l, strcat,
- strncat, strlcat, strchr, strrchr, strchrnul, strcmp, strncmp, strcpy,
- strncpy, strlcpy, stpcpy, stpncpy, strcspn, strspn, strdup, strndup,
- strdupa, strndupa, strlen, strnlen, strpbrk, strsep, strstr, strnstr,
- strcasestr, strtok, strtok_r - string operations
- strcpy_s, strncpy_s, strcat_s, strncat_s, strtok_s, strerror_s, str-
- errorlen_s, strnlen_s - string operations with additional safety checks
+ string - string operations
SYNOPSIS
- #include <strings.h>
-
- int strcasecmp(const char *s1, const char *s2);
-
-
- int strncasecmp(const char *s1, const char *s2, size_t n);
-
-
- int strcasecmp_l(const char *s1, const char *s2, locale_t locale);
-
-
- int strncasecmp_l(const char *s1, const char *s2, size_t n, locale_t locale);
-
-
- #include <string.h>
-
- char *strcat(char *restrict s1, const char *restrict s2);
-
-
- char *strncat(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcat(char *dst, const char *src, size_t dstsize);
-
-
- char *strchr(const char *s, int c);
-
-
- char *strrchr(const char *s, int c);
-
-
- char *strchrnul(const char *s, int c);
-
-
- int strcmp(const char *s1, const char *s2);
-
-
- int strncmp(const char *s1, const char *s2, size_t n);
-
-
- char *strcpy(char *restrict s1, const char *restrict s2);
-
-
- char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcpy(char *dst, const char *src, size_t dstsize);
-
-
- char *stpcpy(char *restrict s1, const char *restrict s2);
-
-
- char *stpncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strcspn(const char *s1, const char *s2);
-
-
- size_t strspn(const char *s1, const char *s2);
-
-
- char *strdup(const char *s);
-
-
- char *strndup(const char *s, size_t size);
-
-
- char *strdupa(const char *s);
-
-
- char *strndupa(const char *s, size_t size);
-
-
- size_t strlen(const char *s);
-
-
- size_t strnlen(const char *s, size_t n);
-
-
- char *strpbrk(const char *s1, const char *s2);
-
-
- char *strsep(char **stringp, const char *delim);
-
-
- char *strstr(const char *s1, const char *s2);
-
-
- char *strnstr(const char *s1, const char *s2, size_t n);
-
-
- char *strcasestr(const char *s1, const char *s2);
-
-
- char *strtok(char *restrict s1, const char *restrict s2);
-
-
- char *strtok_r(char *s1, const char *s2, char **lasts);
-
-
- #define __STDC_WANT_LIB_EXT1__ 1
- #include <stdlib.h>
-
- errno_t strcpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- errno_t strcat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- char *strtok_s(char *restrict s1, rsize_t *restrict s1max,
- const char *restrict s2, char **restrict ptr);
-
-
- errno_t strerror_s(char *s, rsize_t maxsize, errno_t errnum);
-
-
- size_t strerrorlen_s(errno_t errnum);
-
-
- size_t strnlen_s(const char *s, size_t maxsize);
-
- ISO C++
#include <string.h>
-
- const char *strchr(const char *s, int c);
-
-
- const char *strpbrk(const char *s1, const char *s2);
-
-
- const char *strrchr(const char *s, int c);
-
-
- const char *strstr(const char *s1, const char *s2);
-
-
- #include <cstring>
-
- char *std::strchr(char *s, int c);
-
-
- char *std::strpbrk(char *s1, const char *s2);
-
-
- char *std::strrchr(char *s, int c);
-
-
- char *std::strstr(char *s1, const char *s2);
+ #include <strings.h>
DESCRIPTION
- The arguments s, s1, and s2 point to strings (arrays of characters ter-
- minated by a null character). The strcat(), strncat(), strlcat(), str-
- cpy(), strncpy(), strlcpy(), strsep(), strtok(), and strtok_r() func-
- tions all alter their first argument. Additionally, the strcat() and
- strcpy() functions do not check for overflow of the array.
-
- strcasecmp(), strncasecmp()
- The strcasecmp() and strncasecmp() functions are case-insensitive ver-
- sions of strcmp() and strncmp() respectively, described below. They
- ignore differences in case when comparing lower and uppercase charac-
- ters, using the current locale of the process to determine the case of
- the characters.
+ These functions perform various operations on strings (arrays of char-
+ acters), which are given as arguments that point to strings. Depending
+ on the function, strings may be either terminated by a null character
+ or have a maximum length of n bytes. They are designed for use with
+ encodings representing each character as a single byte, and all charac-
+ ter counts are measured in individual bytes, even if a string with
+ multibyte characters is used. Except where noted in the individual
+ function descriptions, they do not check for null pointers, and pro-
+ grams may crash if passing null or otherwise invalid pointers to these
+ functions, or specifying sizes larger than the memory allocation in use
+ for the string. Use of adi(7) may help in detecting buffer overflows or
+ invalid pointer usage in code.
- strcasecmp_l(), strncasecmp_l()
- The strcasecmp_l() and strncasecmp_l() functions are versions of str-
- casecmp() and strncasecmp() respectively. They use locale represented
- by <locale>, instead of current locale of the process.
+ For details of the string functions, see the following man pages:
- The behavior is undefined if the <locale> argument is the special
- locale object LC_GLOBAL_LOCALE or is not a valid locale object handle.
+ strcat(3C) string copying and concatenation operations
- strcat(), strncat(), strlcat()
- The strcat() function appends a copy of string s2, including the termi-
- nating null character, to the end of string s1. The strncat() function
- appends at most n characters. Each returns a pointer to the null-termi-
- nated result. The initial character of s2 overrides the null character
- at the end of s1. If copying takes place between objects that overlap,
- the behavior of strcat(), strncat(), and strlcat() is undefined.
+ strchr(3C) string search operations
- The strlcat() function appends at most (dstsize-strlen(dst)-1) charac-
- ters of src to dst (dstsize being the size of the string buffer dst).
- If the string pointed to by dst contains a null-terminated string that
- fits into dstsize bytes when strlcat() is called, the string pointed to
- by dst will be a null-terminated string that fits in dstsize bytes
- (including the terminating null character) when it completes, and the
- initial character of src will override the null character at the end of
- dst. If the string pointed to by dst is longer than dstsize bytes when
- strlcat() is called, the string pointed to by dst will not be changed.
- The function returns min{dstsize,strlen(dst)}+ strlen(src). Buffer
- overflow can be checked as follows:
- if (strlcat(dst, src, dstsize) >= dstsize)
- return -1;
+ strcmp(3C) string comparison
- strchr(), strrchr(), strchrnul()
- The strchr() function returns a pointer to the first occurrence of c
- (converted to a char) in string s, or a null pointer if c does not
- occur in the string.
+ strcoll(3C) string collation
- The strrchr() function returns a pointer to the last occurrence of c.
- The null character terminating a string is considered to be part of the
- string.
+ strdup(3C) string duplication
- The strchrnul() function is similar to strchr() except that if c is not
- found in s, it returns a pointer to the null byte at the end of s,
- rather than NULL.
+ strerror(3C) get error message string
- strcmp(), strncmp()
- The strcmp() function compares two strings byte-by-byte, according to
- the ordering of your machine's character set. The function returns an
- integer greater than, equal to, or less than 0, if the string pointed
- to by s1 is greater than, equal to, or less than the string pointed to
- by s2 respectively. The sign of a non-zero return value is determined
- by the sign of the difference between the values of the first pair of
- bytes that differ in the strings being compared. The strncmp() function
- makes the same comparison but looks at a maximum of n bytes. Bytes fol-
- lowing a null byte are not compared.
- strcpy(), stpcpy(), strncpy(), stpncpy(), strlcpy()
- The strcpy() and stpcpy() functions copy string s2 to s1, including the
- terminating null character, stopping after the null character has been
- copied. The strcpy() function returns s1. The stpcpy() function returns
- a pointer to the terminating null character copied into the s1 array.
+ strerrordesc_np(3C) get error name and message strings
- The strncpy() and stpncpy() functions copy not more than n bytes (bytes
- that follow a null byte are not copied) from the array pointed to by s2
- to the array pointed to by s1. If the array pointed to by s2 is a
- string that is shorter than n bytes, null bytes are appended to the
- copy in the array pointed to by s1, until n bytes in all are written.
- The stpcpy() function returns s1. If s1 contains null bytes, stpncpy()
- returns a pointer to the first such null byte. Otherwise, it returns
- &s1[n].
+ strlen(3C) string length operations
- The strlcpy() function copies at most dstsize-1 characters (dstsize
- being the size of the string buffer dst) from src to dst, truncating
- src if necessary. The result is always null-terminated. The function
- returns strlen(src). Buffer overflow can be checked as follows:
+ strsignal(3C) get string describing signal
- if (strlcpy(dst, src, dstsize) >= dstsize)
- return -1;
+ strtok(3C) separate strings into tokens
- If copying takes place between objects that overlap, the behavior of
- these functions is undefined.
+ strxfrm(3C) string transformation
- strcspn(), strspn()
- The strcspn() function returns the length of the initial segment of
- string s1 that consists entirely of characters not from string s2. The
- strspn() function returns the length of the initial segment of string
- s1 that consists entirely of characters from string s2.
- strdup(), strndup(), strdupa(), strndupa()
- The strdup() function returns a pointer to a new string that is a
- duplicate of the string pointed to by s. The returned pointer can be
- passed to free(). The space for the new string is obtained using mal-
- loc(3C). If the new string cannot be created, a null pointer is
- returned and errno may be set to ENOMEM to indicate that the storage
- space available is insufficient.
+ For corresponding functions that operate on wide-character strings, see
+ wcstring(3C).
- The strndup() function is similar to strdup(), except that it copies at
- most size bytes. If the length of s is larger than size, only size
- bytes are copied and a terminating null byte is added. If size is
- larger than the length of s, all bytes in s are copied, including the
- terminating null character.
+ Multibyte strings may be handled by using mbstowcs(3C) or mbsrtowcs(3C)
+ to convert the string to a wide-character string first.
- The strdupa() and strndupa() functions are similar to strdup() and
- strndup(), respectively, but use alloca(3C) to allocate the buffer.
- strlen(), strnlen()
- The strlen() function returns the number of bytes in s, not including
- the terminating null character.
-
-
- The strnlen() function returns the smaller of n or the number of bytes
- in s, not including the terminating null character. The strnlen() func-
- tion never examines more than n bytes of the string pointed to by s.
-
- strpbrk()
- The strpbrk() function returns a pointer to the first occurrence in
- string s1 of any character from string s2, or a null pointer if no
- character from s2 exists in s1.
-
- strsep()
- The strsep() function locates, in the null-terminated string referenced
- by *stringp, the first occurrence of any character in the string delim
- (or the terminating '\0' character) and replaces it with a '\0'. The
- location of the next character after the delimiter character (or NULL,
- if the end of the string was reached) is stored in *stringp. The origi-
- nal value of *stringp is returned.
-
-
- An "empty" field (one caused by two adjacent delimiter characters) can
- be detected by comparing the location referenced by the pointer
- returned by strsep() to '\0'.
-
-
- If *stringp is initially NULL, strsep() returns NULL.
-
- strstr(), strnstr(), strcasestr()
- The strstr() function locates the first occurrence of the string s2
- (excluding the terminating null character) in string s1 and returns a
- pointer to the located string, or a null pointer if the string is not
- found. If s2 points to a string with zero length (that is, the string
- ""), the function returns s1.
-
-
- The strnstr() function locates the first occurrence of the null-termi-
- nated string s2 in the string s1, where not more than n characters are
- searched. Characters that appear after a '\0' character are not
- searched.
-
-
- The strcasestr() function is similar to strstr(), but ignores the case
- of both strings.
-
- strtok()
- A sequence of calls to strtok() breaks the string pointed to by s1 into
- a sequence of tokens, each of which is delimited by a byte from the
- string pointed to by s2. The first call in the sequence has s1 as its
- first argument, and is followed by calls with a null pointer as their
- first argument. The separator string pointed to by s2 can be different
- from call to call.
-
-
- The first call in the sequence searches the string pointed to by s1 for
- the first byte that is not contained in the current separator string
- pointed to by s2. If no such byte is found, then there are no tokens in
- the string pointed to by s1 and strtok() returns a null pointer. If
- such a byte is found, it is the start of the first token.
-
-
- The strtok() function then searches from there for a byte that is con-
- tained in the current separator string. If no such byte is found, the
- current token extends to the end of the string pointed to by s1, and
- subsequent searches for a token return a null pointer. If such a byte
- is found, it is overwritten by a null byte that terminates the current
- token. The strtok() function saves a pointer to the following byte in
- thread-specific data, from which the next search for a token starts.
-
-
- Each subsequent call, with a null pointer as the value of the first
- argument, starts searching from the saved pointer and behaves as
- described above.
-
-
- See Example 1, 2, and 3 in the EXAMPLES section for examples of str-
- tok() usage and the explanation in NOTES.
-
- strtok_r()
- The strtok_r() function considers the null-terminated string s1 as a
- sequence of zero or more text tokens separated by spans of one or more
- characters from the separator string s2. The argument lasts points to a
- user-provided pointer which points to stored information necessary for
- strtok_r() to continue scanning the same string.
-
-
- In the first call to strtok_r(), s1 points to a null-terminated string,
- s2 to a null-terminated string of separator characters, and the value
- pointed to by lasts is ignored. The strtok_r() function returns a
- pointer to the first character of the first token, writes a null char-
- acter into s1 immediately following the returned token, and updates the
- pointer to which lasts points.
-
-
- In subsequent calls, s1 is a null pointer and lasts is unchanged from
- the previous call so that subsequent calls move through the string s1,
- returning successive tokens until no tokens remain. The separator
- string s2 can be different from call to call. When no token remains in
- s1, a null pointer is returned.
-
-
- See Example 3 in the EXAMPLES section for an example of strtok_r()
- usage and the explanation in NOTES.
-
- C11 Bounds Checking Interfaces
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(),
- strlen_s(), strerror_s(), and strerrorlen_s() functions are part of the
- C11 bounds checking interfaces specified in the C11 standard, Annex K.
- With the exception of strerrorlen_s(), each provide similar functional-
- ity to their respective non-bounds checking functions, but with addi-
- tional safety checks in the form of explicit runtime constraints as
- defined in the C11 standard. See runtime_constraint_handler(3C) and
- INCITS/ISO/IEC 9899:2011.
-
-
- If no runtime constraint violation is detected, the strcpy_s(),
- strncpy_s(), strcat_s() and strncat_s() functions return zero, other-
- wise, they return a non-zero value.
-
-
- If a runtime constraint violation is detected, or there is no token,
- the strtok_s() function returns a null pointer, otherwise a pointer to
- the first character of the token is returned.
-
-
- If the length of the requested string is less than maxsize, and no run-
- time-constraint violation is detected, the strerror_s() function
- returns zero, otherwise, a non-zero value is returned.
-
-
- The strerrorlen_s() function returns the length (not including the null
- terminator) in the message string strerror_s() would return.
-
-
- The strnlen_s() function returns zero if s is a null pointer. Other-
- wise, the number of bytes preceding the terminating null character is
- returned. If there is no terminating null character in the first max-
- size characters pointed to by s, strnlen_s() returns maxsize.
-
-RETURN VALUES
- The functions will fail if:
-
-
- EINVAL Null pointer is passed or source and destination overlap
-
-
- ERANGE size argument is not valid value
-
-
- EOVERFLOW Destination array is too small
-
-
-
-EXAMPLES
- Example 1 Search for word separators
-
-
-
- The following example searches for tokens separated by space charac-
- ters.
-
-
- #include <string.h>
- ...
- char *token;
- char line[] = "LINE TO BE SEPARATED";
- char *search = " ";
-
- /* Token will point to "LINE". */
- token = strtok(line, search);
-
- /* Token will point to "TO". */
- token = strtok(NULL, search);
-
-
-
- Example 2 Break a Line.
-
-
-
- The following example uses strtok() to break a line into two character
- strings separated by any combination of SPACEs, TABs, or NEWLINEs.
-
-
- #include <string.h>
- ...
- struct element {
- char *key;
- char *data;
- };
- ...
- char line[LINE_MAX];
- char *key, *data;
- ...
- key = strtok(line, " \n");
- data = strtok(NULL, " \n");
-
-
-
- Example 3 Search for tokens
-
-
-
- The following example uses both strtok() and strtok_r() to search for
- tokens separated by one or more characters from the string pointed to
- by the second argument, "/".
-
-
- #define __EXTENSIONS__
- #include <stdio.h>
- #include <string.h>
-
- int main {
- char buf[8]="5/90/45";
- char buf1[14] = "//5//90//45//";
- char *token;
- char *lasts;
-
- printf("tokenizing \"%s\" with strtok:\n", buf);
- if ((token = strtok(buf, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok(NULL, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
-
- printf("\ntokenizing \"%s\" with strtok_r:\n", buf);
- if ((token = strtok_r(buf1, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok_r(NULL, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
- }
-
-
-
-
- When compiled and run, this example produces the following output:
-
-
- tokenizing "5/90/45" with strtok():
- token = "5"
- token = "90"
- token = "45"
-
- tokenizing "//5//90//45//" with strtok_r():
- token = "5"
- token = "90"
- token = "45"
-
-
-
-ATTRIBUTES
- See attributes(7) for descriptions of the following attributes:
-
-
- +-----------------------------+-----------------------------+
- | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
- +-----------------------------+-----------------------------+
- |Interface Stability |Committed |
- +-----------------------------+-----------------------------+
- |MT-Level |See below |
- +-----------------------------+-----------------------------+
- |Standard |See below |
- +-----------------------------+-----------------------------+
-
- MT-Level
- The strtok() and strdup() functions are MT-Safe.
-
-
- The string(), strcasecmp(), strncasecmp(), strcasecmp_l(), strn-
- casecmp_l(), strcat(), strncat(), strlcat(), strchr(), strrchr(),
- strchrnul(), strcmp(), strncmp(), strcpy(), strncpy(), strlcpy(),
- stpcpy(), stpncpy(), strcspn(), strspn(), strndup(), strdupa(),
- strndupa(), strlen(), strnlen(), strpbrk(), strsep(), strstr(), strn-
- str(), strcasestr(), strtok_r() functions are Async-Signal-Safe.
-
-
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(), str-
- error_s(), strerrorlen_s(), and strnlen_s() functions cannot be used
- safely in a multithreaded application due to the runtime constraint
- handler. For more information, see the runtime_constraint_handler(3C)
- man page.
-
- Standard
- For all except strlcat(), strlcpy(), and strsep(), see the standards(7)
- man page.
+ Functions specific to handling UTF-8 encoded multibyte strings are also
+ available. See the u8_strcmp(3C), u8_textprep_str(3C), and u8_vali-
+ date(3C) man pages for these functions.
SEE ALSO
- alloca(3C), malloc(3C), setlocale(3C), strxfrm(3C), attributes(7),
- standards(7), runtime_constraint_handler(3C)
-
-NOTES
- A single-threaded application can gain access to strtok_r() only by
- defining __EXTENSIONS__ or by defining _POSIX_C_SOURCE to a value
- greater than or equal to 199506L.
-
+ mbstowcs(3C), mbsrtowcs(3C), memory(3C), setlocale(3C), stpcpy(3C),
+ stpncpy(3C), strcasecmp(3C), strcasecmp_l(3C), strcasestr(3C), str-
+ cat(3C), strcat_s(3C), strchr(3C), strchrnul(3C), strcmp(3C), str-
+ coll(3C), strcoll_l(3C), strcpy(3C), strcpy_s(3C), strcspn(3C),
+ strdup(3C), strdupa(3C), strlcat(3C), strlcpy(3C), strlen(3C), strn-
+ casecmp(3C), strncasecmp_l(3C), strncat(3C), strncat_s(3C),
+ strncmp(3C), strncpy(3C), strncpy_s(3C), strndup(3C), strndupa(3C),
+ strnlen(3C), strnlen_s(3C), strnstr(3C), strpbrk(3C), strrchr(3C),
+ strsep(3C), strspn(3C), strstr(3C), strtok(3C), strtok_r(3C), str-
+ tok_s(3C), strxfrm(3C), strxfrm_l(3C), u8_strcmp(3C),
+ u8_textprep_str(3C), u8_validate(3C), wcstring(3C), strcadd(3GEN), str-
+ ccpy(3GEN), streadd(3GEN), strecpy(3GEN), strfind(3GEN), strrspn(3GEN),
+ strtrns(3GEN)
- All of these functions assume the default locale "C." For some locales,
- strxfrm(3C) should be applied to the strings before they are passed to
- the functions.
+ Appendix E, Security Considerations When Using C Functions, in Devel-
+ oper's Guide to Oracle Solaris 11.4 Security
- The strtok() function is safe to use in multithreaded applications
- because it saves its internal state in a thread-specific data area.
- However, its use is discouraged, even for single-threaded applications.
- The strtok_r() function should be used instead.
+ Handling Characters and Character Strings in Internationalizing and
+ Localizing Applications in Oracle Solaris
- Do not pass the address of a character string literal as the argument
- s1 to either strtok() or strtok_r(). Similarly, do not pass a pointer
- to the address of a character string literal as the argument stringp to
- strsep(). These functions can modify the storage pointed to by s1 in
- the case of strtok() and strtok_r() or *stringp in the case of
- strsep(). The C99 standard specifies that attempting to modify the
- storage occupied by a string literal results in undefined behavior.
- This allows compilers (including gcc, clang, and the Oracle Developer
- Studio compilers) to place string literals in read-only memory. Note
- that in Example 1 above, this problem is avoided because the variable
- line is declared as a writable array of type char that is initialized
- by a string literal rather than a pointer to char that points to a
- string literal.
+NOTES
+ All of these functions, except as noted in their individual man pages,
+ assume the default "C" locale. For some locales, strxfrm(3C) should be
+ applied to the strings before they are passed to the functions.
-Oracle Solaris 11.4 11 May 2021 string(3C)
+Oracle Solaris 11.4 28 Feb 2022 string(3C)
diff -NurbBw 11.4.42/man3c/strlen.3c 11.4.45/man3c/strlen.3c
--- 11.4.42/man3c/strlen.3c 2022-05-17 14:50:17.769483997 -0700
+++ 11.4.45/man3c/strlen.3c 2022-05-17 14:51:00.412427216 -0700
@@ -1,304 +1,33 @@
-Standard C Library Functions string(3C)
+Standard C Library Functions strlen(3C)
NAME
- string, strcasecmp, strncasecmp, strcasecmp_l, strncasecmp_l, strcat,
- strncat, strlcat, strchr, strrchr, strchrnul, strcmp, strncmp, strcpy,
- strncpy, strlcpy, stpcpy, stpncpy, strcspn, strspn, strdup, strndup,
- strdupa, strndupa, strlen, strnlen, strpbrk, strsep, strstr, strnstr,
- strcasestr, strtok, strtok_r - string operations
- strcpy_s, strncpy_s, strcat_s, strncat_s, strtok_s, strerror_s, str-
- errorlen_s, strnlen_s - string operations with additional safety checks
+ strlen, strnlen, strnlen_s - string length operations
SYNOPSIS
- #include <strings.h>
-
- int strcasecmp(const char *s1, const char *s2);
-
-
- int strncasecmp(const char *s1, const char *s2, size_t n);
-
-
- int strcasecmp_l(const char *s1, const char *s2, locale_t locale);
-
-
- int strncasecmp_l(const char *s1, const char *s2, size_t n, locale_t locale);
-
-
#include <string.h>
- char *strcat(char *restrict s1, const char *restrict s2);
-
-
- char *strncat(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcat(char *dst, const char *src, size_t dstsize);
-
-
- char *strchr(const char *s, int c);
-
-
- char *strrchr(const char *s, int c);
-
-
- char *strchrnul(const char *s, int c);
-
-
- int strcmp(const char *s1, const char *s2);
-
-
- int strncmp(const char *s1, const char *s2, size_t n);
-
-
- char *strcpy(char *restrict s1, const char *restrict s2);
-
-
- char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcpy(char *dst, const char *src, size_t dstsize);
-
-
- char *stpcpy(char *restrict s1, const char *restrict s2);
-
-
- char *stpncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strcspn(const char *s1, const char *s2);
-
-
- size_t strspn(const char *s1, const char *s2);
-
-
- char *strdup(const char *s);
-
-
- char *strndup(const char *s, size_t size);
-
-
- char *strdupa(const char *s);
-
-
- char *strndupa(const char *s, size_t size);
-
-
size_t strlen(const char *s);
size_t strnlen(const char *s, size_t n);
-
- char *strpbrk(const char *s1, const char *s2);
-
-
- char *strsep(char **stringp, const char *delim);
-
-
- char *strstr(const char *s1, const char *s2);
-
-
- char *strnstr(const char *s1, const char *s2, size_t n);
-
-
- char *strcasestr(const char *s1, const char *s2);
-
-
- char *strtok(char *restrict s1, const char *restrict s2);
-
-
- char *strtok_r(char *s1, const char *s2, char **lasts);
-
-
+ C11 Bounds Checking Interface
#define __STDC_WANT_LIB_EXT1__ 1
- #include <stdlib.h>
-
- errno_t strcpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- errno_t strcat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- char *strtok_s(char *restrict s1, rsize_t *restrict s1max,
- const char *restrict s2, char **restrict ptr);
-
-
- errno_t strerror_s(char *s, rsize_t maxsize, errno_t errnum);
-
-
- size_t strerrorlen_s(errno_t errnum);
-
-
- size_t strnlen_s(const char *s, size_t maxsize);
-
- ISO C++
#include <string.h>
- const char *strchr(const char *s, int c);
-
-
- const char *strpbrk(const char *s1, const char *s2);
-
-
- const char *strrchr(const char *s, int c);
-
-
- const char *strstr(const char *s1, const char *s2);
-
-
- #include <cstring>
-
- char *std::strchr(char *s, int c);
-
-
- char *std::strpbrk(char *s1, const char *s2);
-
-
- char *std::strrchr(char *s, int c);
-
-
- char *std::strstr(char *s1, const char *s2);
+ size_t strnlen_s(const char *s, size_t maxsize);
DESCRIPTION
- The arguments s, s1, and s2 point to strings (arrays of characters ter-
- minated by a null character). The strcat(), strncat(), strlcat(), str-
- cpy(), strncpy(), strlcpy(), strsep(), strtok(), and strtok_r() func-
- tions all alter their first argument. Additionally, the strcat() and
- strcpy() functions do not check for overflow of the array.
-
- strcasecmp(), strncasecmp()
- The strcasecmp() and strncasecmp() functions are case-insensitive ver-
- sions of strcmp() and strncmp() respectively, described below. They
- ignore differences in case when comparing lower and uppercase charac-
- ters, using the current locale of the process to determine the case of
- the characters.
-
- strcasecmp_l(), strncasecmp_l()
- The strcasecmp_l() and strncasecmp_l() functions are versions of str-
- casecmp() and strncasecmp() respectively. They use locale represented
- by <locale>, instead of current locale of the process.
-
-
- The behavior is undefined if the <locale> argument is the special
- locale object LC_GLOBAL_LOCALE or is not a valid locale object handle.
-
- strcat(), strncat(), strlcat()
- The strcat() function appends a copy of string s2, including the termi-
- nating null character, to the end of string s1. The strncat() function
- appends at most n characters. Each returns a pointer to the null-termi-
- nated result. The initial character of s2 overrides the null character
- at the end of s1. If copying takes place between objects that overlap,
- the behavior of strcat(), strncat(), and strlcat() is undefined.
-
-
- The strlcat() function appends at most (dstsize-strlen(dst)-1) charac-
- ters of src to dst (dstsize being the size of the string buffer dst).
- If the string pointed to by dst contains a null-terminated string that
- fits into dstsize bytes when strlcat() is called, the string pointed to
- by dst will be a null-terminated string that fits in dstsize bytes
- (including the terminating null character) when it completes, and the
- initial character of src will override the null character at the end of
- dst. If the string pointed to by dst is longer than dstsize bytes when
- strlcat() is called, the string pointed to by dst will not be changed.
- The function returns min{dstsize,strlen(dst)}+ strlen(src). Buffer
- overflow can be checked as follows:
-
- if (strlcat(dst, src, dstsize) >= dstsize)
- return -1;
-
-
- strchr(), strrchr(), strchrnul()
- The strchr() function returns a pointer to the first occurrence of c
- (converted to a char) in string s, or a null pointer if c does not
- occur in the string.
-
-
- The strrchr() function returns a pointer to the last occurrence of c.
- The null character terminating a string is considered to be part of the
- string.
-
-
- The strchrnul() function is similar to strchr() except that if c is not
- found in s, it returns a pointer to the null byte at the end of s,
- rather than NULL.
-
- strcmp(), strncmp()
- The strcmp() function compares two strings byte-by-byte, according to
- the ordering of your machine's character set. The function returns an
- integer greater than, equal to, or less than 0, if the string pointed
- to by s1 is greater than, equal to, or less than the string pointed to
- by s2 respectively. The sign of a non-zero return value is determined
- by the sign of the difference between the values of the first pair of
- bytes that differ in the strings being compared. The strncmp() function
- makes the same comparison but looks at a maximum of n bytes. Bytes fol-
- lowing a null byte are not compared.
-
- strcpy(), stpcpy(), strncpy(), stpncpy(), strlcpy()
- The strcpy() and stpcpy() functions copy string s2 to s1, including the
- terminating null character, stopping after the null character has been
- copied. The strcpy() function returns s1. The stpcpy() function returns
- a pointer to the terminating null character copied into the s1 array.
-
-
- The strncpy() and stpncpy() functions copy not more than n bytes (bytes
- that follow a null byte are not copied) from the array pointed to by s2
- to the array pointed to by s1. If the array pointed to by s2 is a
- string that is shorter than n bytes, null bytes are appended to the
- copy in the array pointed to by s1, until n bytes in all are written.
- The stpcpy() function returns s1. If s1 contains null bytes, stpncpy()
- returns a pointer to the first such null byte. Otherwise, it returns
- &s1[n].
-
-
- The strlcpy() function copies at most dstsize-1 characters (dstsize
- being the size of the string buffer dst) from src to dst, truncating
- src if necessary. The result is always null-terminated. The function
- returns strlen(src). Buffer overflow can be checked as follows:
-
- if (strlcpy(dst, src, dstsize) >= dstsize)
- return -1;
-
-
-
- If copying takes place between objects that overlap, the behavior of
- these functions is undefined.
-
- strcspn(), strspn()
- The strcspn() function returns the length of the initial segment of
- string s1 that consists entirely of characters not from string s2. The
- strspn() function returns the length of the initial segment of string
- s1 that consists entirely of characters from string s2.
-
- strdup(), strndup(), strdupa(), strndupa()
- The strdup() function returns a pointer to a new string that is a
- duplicate of the string pointed to by s. The returned pointer can be
- passed to free(). The space for the new string is obtained using mal-
- loc(3C). If the new string cannot be created, a null pointer is
- returned and errno may be set to ENOMEM to indicate that the storage
- space available is insufficient.
-
-
- The strndup() function is similar to strdup(), except that it copies at
- most size bytes. If the length of s is larger than size, only size
- bytes are copied and a terminating null byte is added. If size is
- larger than the length of s, all bytes in s are copied, including the
- terminating null character.
-
-
- The strdupa() and strndupa() functions are similar to strdup() and
- strndup(), respectively, but use alloca(3C) to allocate the buffer.
+ These functions calculate the length in bytes of strings (arrays of
+ characters). Depending on the function, strings may be either termi-
+ nated by a null character or bounded by a maximum length of n bytes.
+ They are designed for use with encodings representing each character as
+ a single byte, and all character counts are measured in individual
+ bytes, even if a string with multibyte characters is used. They do not
+ check for null pointers, and programs may crash if passing null or oth-
+ erwise invalid pointers to these functions.
strlen(), strnlen()
The strlen() function returns the number of bytes in s, not including
@@ -309,251 +38,21 @@
in s, not including the terminating null character. The strnlen() func-
tion never examines more than n bytes of the string pointed to by s.
- strpbrk()
- The strpbrk() function returns a pointer to the first occurrence in
- string s1 of any character from string s2, or a null pointer if no
- character from s2 exists in s1.
-
- strsep()
- The strsep() function locates, in the null-terminated string referenced
- by *stringp, the first occurrence of any character in the string delim
- (or the terminating '\0' character) and replaces it with a '\0'. The
- location of the next character after the delimiter character (or NULL,
- if the end of the string was reached) is stored in *stringp. The origi-
- nal value of *stringp is returned.
-
-
- An "empty" field (one caused by two adjacent delimiter characters) can
- be detected by comparing the location referenced by the pointer
- returned by strsep() to '\0'.
-
-
- If *stringp is initially NULL, strsep() returns NULL.
-
- strstr(), strnstr(), strcasestr()
- The strstr() function locates the first occurrence of the string s2
- (excluding the terminating null character) in string s1 and returns a
- pointer to the located string, or a null pointer if the string is not
- found. If s2 points to a string with zero length (that is, the string
- ""), the function returns s1.
-
-
- The strnstr() function locates the first occurrence of the null-termi-
- nated string s2 in the string s1, where not more than n characters are
- searched. Characters that appear after a '\0' character are not
- searched.
-
-
- The strcasestr() function is similar to strstr(), but ignores the case
- of both strings.
-
- strtok()
- A sequence of calls to strtok() breaks the string pointed to by s1 into
- a sequence of tokens, each of which is delimited by a byte from the
- string pointed to by s2. The first call in the sequence has s1 as its
- first argument, and is followed by calls with a null pointer as their
- first argument. The separator string pointed to by s2 can be different
- from call to call.
-
-
- The first call in the sequence searches the string pointed to by s1 for
- the first byte that is not contained in the current separator string
- pointed to by s2. If no such byte is found, then there are no tokens in
- the string pointed to by s1 and strtok() returns a null pointer. If
- such a byte is found, it is the start of the first token.
-
-
- The strtok() function then searches from there for a byte that is con-
- tained in the current separator string. If no such byte is found, the
- current token extends to the end of the string pointed to by s1, and
- subsequent searches for a token return a null pointer. If such a byte
- is found, it is overwritten by a null byte that terminates the current
- token. The strtok() function saves a pointer to the following byte in
- thread-specific data, from which the next search for a token starts.
-
-
- Each subsequent call, with a null pointer as the value of the first
- argument, starts searching from the saved pointer and behaves as
- described above.
-
-
- See Example 1, 2, and 3 in the EXAMPLES section for examples of str-
- tok() usage and the explanation in NOTES.
-
- strtok_r()
- The strtok_r() function considers the null-terminated string s1 as a
- sequence of zero or more text tokens separated by spans of one or more
- characters from the separator string s2. The argument lasts points to a
- user-provided pointer which points to stored information necessary for
- strtok_r() to continue scanning the same string.
-
-
- In the first call to strtok_r(), s1 points to a null-terminated string,
- s2 to a null-terminated string of separator characters, and the value
- pointed to by lasts is ignored. The strtok_r() function returns a
- pointer to the first character of the first token, writes a null char-
- acter into s1 immediately following the returned token, and updates the
- pointer to which lasts points.
-
-
- In subsequent calls, s1 is a null pointer and lasts is unchanged from
- the previous call so that subsequent calls move through the string s1,
- returning successive tokens until no tokens remain. The separator
- string s2 can be different from call to call. When no token remains in
- s1, a null pointer is returned.
-
-
- See Example 3 in the EXAMPLES section for an example of strtok_r()
- usage and the explanation in NOTES.
-
- C11 Bounds Checking Interfaces
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(),
- strlen_s(), strerror_s(), and strerrorlen_s() functions are part of the
- C11 bounds checking interfaces specified in the C11 standard, Annex K.
- With the exception of strerrorlen_s(), each provide similar functional-
- ity to their respective non-bounds checking functions, but with addi-
- tional safety checks in the form of explicit runtime constraints as
- defined in the C11 standard. See runtime_constraint_handler(3C) and
- INCITS/ISO/IEC 9899:2011.
-
-
- If no runtime constraint violation is detected, the strcpy_s(),
- strncpy_s(), strcat_s() and strncat_s() functions return zero, other-
- wise, they return a non-zero value.
-
-
- If a runtime constraint violation is detected, or there is no token,
- the strtok_s() function returns a null pointer, otherwise a pointer to
- the first character of the token is returned.
-
-
- If the length of the requested string is less than maxsize, and no run-
- time-constraint violation is detected, the strerror_s() function
- returns zero, otherwise, a non-zero value is returned.
-
-
- The strerrorlen_s() function returns the length (not including the null
- terminator) in the message string strerror_s() would return.
+ C11 Bounds Checking Interface
+ The strnlen_s() function is part of the C11 bounds checking interfaces
+ specified in the C11 standard, Annex K. Each of these functions pro-
+ vides similar functionality to their respective non-bounds checking
+ counterpart functions, but with additional safety checks in the form of
+ explicit runtime constraints as defined in the C11 standard. See run-
+ time_constraint_handler(3C) and INCITS/ISO/IEC 9899:2011.
The strnlen_s() function returns zero if s is a null pointer. Other-
wise, the number of bytes preceding the terminating null character is
returned. If there is no terminating null character in the first max-
- size characters pointed to by s, strnlen_s() returns maxsize.
-
-RETURN VALUES
- The functions will fail if:
-
-
- EINVAL Null pointer is passed or source and destination overlap
-
-
- ERANGE size argument is not valid value
-
-
- EOVERFLOW Destination array is too small
-
-
-
-EXAMPLES
- Example 1 Search for word separators
-
-
-
- The following example searches for tokens separated by space charac-
- ters.
-
-
- #include <string.h>
- ...
- char *token;
- char line[] = "LINE TO BE SEPARATED";
- char *search = " ";
-
- /* Token will point to "LINE". */
- token = strtok(line, search);
-
- /* Token will point to "TO". */
- token = strtok(NULL, search);
-
-
-
- Example 2 Break a Line.
-
-
-
- The following example uses strtok() to break a line into two character
- strings separated by any combination of SPACEs, TABs, or NEWLINEs.
-
-
- #include <string.h>
- ...
- struct element {
- char *key;
- char *data;
- };
- ...
- char line[LINE_MAX];
- char *key, *data;
- ...
- key = strtok(line, " \n");
- data = strtok(NULL, " \n");
-
-
-
- Example 3 Search for tokens
-
-
-
- The following example uses both strtok() and strtok_r() to search for
- tokens separated by one or more characters from the string pointed to
- by the second argument, "/".
-
-
- #define __EXTENSIONS__
- #include <stdio.h>
- #include <string.h>
-
- int main {
- char buf[8]="5/90/45";
- char buf1[14] = "//5//90//45//";
- char *token;
- char *lasts;
-
- printf("tokenizing \"%s\" with strtok:\n", buf);
- if ((token = strtok(buf, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok(NULL, "/")) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
-
- printf("\ntokenizing \"%s\" with strtok_r:\n", buf);
- if ((token = strtok_r(buf1, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- while ((token = strtok_r(NULL, "/", &lasts)) != NULL) {
- printf("token = \"%s\"\n", token);
- }
- }
- }
-
-
-
-
- When compiled and run, this example produces the following output:
-
-
- tokenizing "5/90/45" with strtok():
- token = "5"
- token = "90"
- token = "45"
-
- tokenizing "//5//90//45//" with strtok_r():
- token = "5"
- token = "90"
- token = "45"
-
-
+ size characters pointed to by s, strnlen_s() returns maxsize. There are
+ no defined error conditions in which strnlen_s() will invoke the run-
+ time constraint handler.
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -564,68 +63,47 @@
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
- |MT-Level |See below |
+ |MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
|Standard |See below |
+-----------------------------+-----------------------------+
- MT-Level
- The strtok() and strdup() functions are MT-Safe.
-
-
- The string(), strcasecmp(), strncasecmp(), strcasecmp_l(), strn-
- casecmp_l(), strcat(), strncat(), strlcat(), strchr(), strrchr(),
- strchrnul(), strcmp(), strncmp(), strcpy(), strncpy(), strlcpy(),
- stpcpy(), stpncpy(), strcspn(), strspn(), strndup(), strdupa(),
- strndupa(), strlen(), strnlen(), strpbrk(), strsep(), strstr(), strn-
- str(), strcasestr(), strtok_r() functions are Async-Signal-Safe.
-
-
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(), str-
- error_s(), strerrorlen_s(), and strnlen_s() functions cannot be used
- safely in a multithreaded application due to the runtime constraint
- handler. For more information, see the runtime_constraint_handler(3C)
- man page.
-
Standard
- For all except strlcat(), strlcpy(), and strsep(), see the standards(7)
- man page.
+ See standards(7) for descriptions of the following standards:
-SEE ALSO
- alloca(3C), malloc(3C), setlocale(3C), strxfrm(3C), attributes(7),
- standards(7), runtime_constraint_handler(3C)
-NOTES
- A single-threaded application can gain access to strtok_r() only by
- defining __EXTENSIONS__ or by defining _POSIX_C_SOURCE to a value
- greater than or equal to 199506L.
+ +--------------------------+--------------------------------+
+ | INTERFACES | APPLICABLE STANDARDS |
+ +--------------------------+--------------------------------+
+ |strlen() | C89 through C11, |
+ | | POSIX.1-1990 through 2008, |
+ | | SUS through SUSv4, |
+ | | XPG1 through XPG7 |
+ | | |
+ +--------------------------+--------------------------------+
+ |strnlen() | POSIX.1-2008, |
+ | | SUSv4, |
+ | | XPG7 |
+ | | |
+ +--------------------------+--------------------------------+
+ |strlen_s() |C11 Annex K |
+ +--------------------------+--------------------------------+
+SEE ALSO
+ string(3C), wcslen(3C), attributes(7), standards(7)
- All of these functions assume the default locale "C." For some locales,
- strxfrm(3C) should be applied to the strings before they are passed to
- the functions.
+HISTORY
+ The strlen_s() function was added to Oracle Solaris in the Solaris
+ 11.4.0 release.
- The strtok() function is safe to use in multithreaded applications
- because it saves its internal state in a thread-specific data area.
- However, its use is discouraged, even for single-threaded applications.
- The strtok_r() function should be used instead.
+ The strnlen() function was added to Oracle Solaris in the Solaris
+ 11.0.0 release.
- Do not pass the address of a character string literal as the argument
- s1 to either strtok() or strtok_r(). Similarly, do not pass a pointer
- to the address of a character string literal as the argument stringp to
- strsep(). These functions can modify the storage pointed to by s1 in
- the case of strtok() and strtok_r() or *stringp in the case of
- strsep(). The C99 standard specifies that attempting to modify the
- storage occupied by a string literal results in undefined behavior.
- This allows compilers (including gcc, clang, and the Oracle Developer
- Studio compilers) to place string literals in read-only memory. Note
- that in Example 1 above, this problem is avoided because the variable
- line is declared as a writable array of type char that is initialized
- by a string literal rather than a pointer to char that points to a
- string literal.
+ The strlen() function has been included in all Sun and Oracle releases
+ of Solaris.
-Oracle Solaris 11.4 11 May 2021 string(3C)
+Oracle Solaris 11.4 28 Feb 2022 strlen(3C)
diff -NurbBw 11.4.42/man3c/strsignal.3c 11.4.45/man3c/strsignal.3c
--- 11.4.42/man3c/strsignal.3c 2022-05-17 14:50:18.703108513 -0700
+++ 11.4.45/man3c/strsignal.3c 2022-05-17 14:51:01.173610258 -0700
@@ -3,7 +3,7 @@
NAME
- strsignal - get name of signal
+ strsignal - get string describing signal
SYNOPSIS
#include <string.h>
@@ -13,8 +13,14 @@
DESCRIPTION
The strsignal() function maps the signal number in sig to a string
describing the signal and returns a pointer to that string. It uses the
- same set of the messages as psignal(3C). The returned string should not
- be overwritten.
+ same set of the messages as psignal(3C).
+
+
+ The returned string should not be overwritten or freed by the caller.
+ The returned pointer might be invalidated or the string content might
+ be overwritten by a subsequent call to either strsignal() or setlo-
+ cale(). The returned pointer might also be invalidated if the calling
+ thread is terminated.
RETURN VALUES
The strsignal() function returns NULL if sig is not a valid signal num-
@@ -24,6 +30,12 @@
Messages returned from this function are in the native language speci-
fied by the LC_MESSAGES locale category. See setlocale(3C).
+
+ The strsignal() function returns a description of the signal, while the
+ sig2str(3C) function returns the signal name (without the "SIG" pre-
+ fix). For instance, strsignal(SIGHUP) in the "C" locale returns the
+ string "Hangup", while sig2str(SIGHUP, buf) returns the string "HUP".
+
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -31,12 +43,20 @@
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
+ |Interface Stability |Committed |
+ +-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
+ |Standard |POSIX.1-2008, SUSv4, XPG7 |
+ +-----------------------------+-----------------------------+
SEE ALSO
- gettext(3C), psignal(3C), setlocale(3C), str2sig(3C), attributes(7)
+ gettext(3C), psignal(3C), setlocale(3C), sig2str(3C), attributes(7)
+
+HISTORY
+ The strsignal() function has been included in Solaris since the Solaris
+ 2.0 release.
-Oracle Solaris 11.4 31 Mar 2005 strsignal(3C)
+Oracle Solaris 11.4 28 Feb 2022 strsignal(3C)
diff -NurbBw 11.4.42/man3c/strtok.3c 11.4.45/man3c/strtok.3c
--- 11.4.42/man3c/strtok.3c 2022-05-17 14:50:18.996735563 -0700
+++ 11.4.45/man3c/strtok.3c 2022-05-17 14:51:01.441128087 -0700
@@ -1,351 +1,42 @@
-Standard C Library Functions string(3C)
+Standard C Library Functions strtok(3C)
NAME
- string, strcasecmp, strncasecmp, strcasecmp_l, strncasecmp_l, strcat,
- strncat, strlcat, strchr, strrchr, strchrnul, strcmp, strncmp, strcpy,
- strncpy, strlcpy, stpcpy, stpncpy, strcspn, strspn, strdup, strndup,
- strdupa, strndupa, strlen, strnlen, strpbrk, strsep, strstr, strnstr,
- strcasestr, strtok, strtok_r - string operations
- strcpy_s, strncpy_s, strcat_s, strncat_s, strtok_s, strerror_s, str-
- errorlen_s, strnlen_s - string operations with additional safety checks
+ strtok, strtok_r, strtok_s, strsep - separate strings into tokens
SYNOPSIS
- #include <strings.h>
-
- int strcasecmp(const char *s1, const char *s2);
-
-
- int strncasecmp(const char *s1, const char *s2, size_t n);
-
-
- int strcasecmp_l(const char *s1, const char *s2, locale_t locale);
-
-
- int strncasecmp_l(const char *s1, const char *s2, size_t n, locale_t locale);
-
-
#include <string.h>
- char *strcat(char *restrict s1, const char *restrict s2);
-
-
- char *strncat(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcat(char *dst, const char *src, size_t dstsize);
-
-
- char *strchr(const char *s, int c);
-
-
- char *strrchr(const char *s, int c);
-
-
- char *strchrnul(const char *s, int c);
-
-
- int strcmp(const char *s1, const char *s2);
-
-
- int strncmp(const char *s1, const char *s2, size_t n);
-
-
- char *strcpy(char *restrict s1, const char *restrict s2);
-
-
- char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strlcpy(char *dst, const char *src, size_t dstsize);
-
-
- char *stpcpy(char *restrict s1, const char *restrict s2);
-
-
- char *stpncpy(char *restrict s1, const char *restrict s2, size_t n);
-
-
- size_t strcspn(const char *s1, const char *s2);
-
-
- size_t strspn(const char *s1, const char *s2);
-
-
- char *strdup(const char *s);
-
-
- char *strndup(const char *s, size_t size);
-
-
- char *strdupa(const char *s);
-
-
- char *strndupa(const char *s, size_t size);
-
-
- size_t strlen(const char *s);
-
-
- size_t strnlen(const char *s, size_t n);
+ char *strtok(char *restrict s1, const char *restrict s2);
- char *strpbrk(const char *s1, const char *s2);
+ char *strtok_r(char *restrict s1, const char *restrict s2,
+ char **restrict lasts);
char *strsep(char **stringp, const char *delim);
-
- char *strstr(const char *s1, const char *s2);
-
-
- char *strnstr(const char *s1, const char *s2, size_t n);
-
-
- char *strcasestr(const char *s1, const char *s2);
-
-
- char *strtok(char *restrict s1, const char *restrict s2);
-
-
- char *strtok_r(char *s1, const char *s2, char **lasts);
-
-
+ C11 Bounds Checking Interface
#define __STDC_WANT_LIB_EXT1__ 1
- #include <stdlib.h>
-
- errno_t strcpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncpy_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
-
- errno_t strcat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2);
-
-
- errno_t strncat_s(char *restrict s1, rsize_t s1max,
- const char *restrict s2, rsize_t n);
-
+ #include <string.h>
char *strtok_s(char *restrict s1, rsize_t *restrict s1max,
const char *restrict s2, char **restrict ptr);
-
- errno_t strerror_s(char *s, rsize_t maxsize, errno_t errnum);
-
-
- size_t strerrorlen_s(errno_t errnum);
-
-
- size_t strnlen_s(const char *s, size_t maxsize);
-
- ISO C++
- #include <string.h>
-
- const char *strchr(const char *s, int c);
-
-
- const char *strpbrk(const char *s1, const char *s2);
-
-
- const char *strrchr(const char *s, int c);
-
-
- const char *strstr(const char *s1, const char *s2);
-
-
- #include <cstring>
-
- char *std::strchr(char *s, int c);
-
-
- char *std::strpbrk(char *s1, const char *s2);
-
-
- char *std::strrchr(char *s, int c);
-
-
- char *std::strstr(char *s1, const char *s2);
-
DESCRIPTION
- The arguments s, s1, and s2 point to strings (arrays of characters ter-
- minated by a null character). The strcat(), strncat(), strlcat(), str-
- cpy(), strncpy(), strlcpy(), strsep(), strtok(), and strtok_r() func-
- tions all alter their first argument. Additionally, the strcat() and
- strcpy() functions do not check for overflow of the array.
-
- strcasecmp(), strncasecmp()
- The strcasecmp() and strncasecmp() functions are case-insensitive ver-
- sions of strcmp() and strncmp() respectively, described below. They
- ignore differences in case when comparing lower and uppercase charac-
- ters, using the current locale of the process to determine the case of
- the characters.
-
- strcasecmp_l(), strncasecmp_l()
- The strcasecmp_l() and strncasecmp_l() functions are versions of str-
- casecmp() and strncasecmp() respectively. They use locale represented
- by <locale>, instead of current locale of the process.
-
-
- The behavior is undefined if the <locale> argument is the special
- locale object LC_GLOBAL_LOCALE or is not a valid locale object handle.
-
- strcat(), strncat(), strlcat()
- The strcat() function appends a copy of string s2, including the termi-
- nating null character, to the end of string s1. The strncat() function
- appends at most n characters. Each returns a pointer to the null-termi-
- nated result. The initial character of s2 overrides the null character
- at the end of s1. If copying takes place between objects that overlap,
- the behavior of strcat(), strncat(), and strlcat() is undefined.
-
-
- The strlcat() function appends at most (dstsize-strlen(dst)-1) charac-
- ters of src to dst (dstsize being the size of the string buffer dst).
- If the string pointed to by dst contains a null-terminated string that
- fits into dstsize bytes when strlcat() is called, the string pointed to
- by dst will be a null-terminated string that fits in dstsize bytes
- (including the terminating null character) when it completes, and the
- initial character of src will override the null character at the end of
- dst. If the string pointed to by dst is longer than dstsize bytes when
- strlcat() is called, the string pointed to by dst will not be changed.
- The function returns min{dstsize,strlen(dst)}+ strlen(src). Buffer
- overflow can be checked as follows:
-
- if (strlcat(dst, src, dstsize) >= dstsize)
- return -1;
-
-
- strchr(), strrchr(), strchrnul()
- The strchr() function returns a pointer to the first occurrence of c
- (converted to a char) in string s, or a null pointer if c does not
- occur in the string.
-
-
- The strrchr() function returns a pointer to the last occurrence of c.
- The null character terminating a string is considered to be part of the
- string.
-
-
- The strchrnul() function is similar to strchr() except that if c is not
- found in s, it returns a pointer to the null byte at the end of s,
- rather than NULL.
-
- strcmp(), strncmp()
- The strcmp() function compares two strings byte-by-byte, according to
- the ordering of your machine's character set. The function returns an
- integer greater than, equal to, or less than 0, if the string pointed
- to by s1 is greater than, equal to, or less than the string pointed to
- by s2 respectively. The sign of a non-zero return value is determined
- by the sign of the difference between the values of the first pair of
- bytes that differ in the strings being compared. The strncmp() function
- makes the same comparison but looks at a maximum of n bytes. Bytes fol-
- lowing a null byte are not compared.
-
- strcpy(), stpcpy(), strncpy(), stpncpy(), strlcpy()
- The strcpy() and stpcpy() functions copy string s2 to s1, including the
- terminating null character, stopping after the null character has been
- copied. The strcpy() function returns s1. The stpcpy() function returns
- a pointer to the terminating null character copied into the s1 array.
-
-
- The strncpy() and stpncpy() functions copy not more than n bytes (bytes
- that follow a null byte are not copied) from the array pointed to by s2
- to the array pointed to by s1. If the array pointed to by s2 is a
- string that is shorter than n bytes, null bytes are appended to the
- copy in the array pointed to by s1, until n bytes in all are written.
- The stpcpy() function returns s1. If s1 contains null bytes, stpncpy()
- returns a pointer to the first such null byte. Otherwise, it returns
- &s1[n].
-
-
- The strlcpy() function copies at most dstsize-1 characters (dstsize
- being the size of the string buffer dst) from src to dst, truncating
- src if necessary. The result is always null-terminated. The function
- returns strlen(src). Buffer overflow can be checked as follows:
-
- if (strlcpy(dst, src, dstsize) >= dstsize)
- return -1;
-
-
-
- If copying takes place between objects that overlap, the behavior of
- these functions is undefined.
-
- strcspn(), strspn()
- The strcspn() function returns the length of the initial segment of
- string s1 that consists entirely of characters not from string s2. The
- strspn() function returns the length of the initial segment of string
- s1 that consists entirely of characters from string s2.
-
- strdup(), strndup(), strdupa(), strndupa()
- The strdup() function returns a pointer to a new string that is a
- duplicate of the string pointed to by s. The returned pointer can be
- passed to free(). The space for the new string is obtained using mal-
- loc(3C). If the new string cannot be created, a null pointer is
- returned and errno may be set to ENOMEM to indicate that the storage
- space available is insufficient.
-
-
- The strndup() function is similar to strdup(), except that it copies at
- most size bytes. If the length of s is larger than size, only size
- bytes are copied and a terminating null byte is added. If size is
- larger than the length of s, all bytes in s are copied, including the
- terminating null character.
-
-
- The strdupa() and strndupa() functions are similar to strdup() and
- strndup(), respectively, but use alloca(3C) to allocate the buffer.
-
- strlen(), strnlen()
- The strlen() function returns the number of bytes in s, not including
- the terminating null character.
-
-
- The strnlen() function returns the smaller of n or the number of bytes
- in s, not including the terminating null character. The strnlen() func-
- tion never examines more than n bytes of the string pointed to by s.
-
- strpbrk()
- The strpbrk() function returns a pointer to the first occurrence in
- string s1 of any character from string s2, or a null pointer if no
- character from s2 exists in s1.
-
- strsep()
- The strsep() function locates, in the null-terminated string referenced
- by *stringp, the first occurrence of any character in the string delim
- (or the terminating '\0' character) and replaces it with a '\0'. The
- location of the next character after the delimiter character (or NULL,
- if the end of the string was reached) is stored in *stringp. The origi-
- nal value of *stringp is returned.
-
-
- An "empty" field (one caused by two adjacent delimiter characters) can
- be detected by comparing the location referenced by the pointer
- returned by strsep() to '\0'.
-
-
- If *stringp is initially NULL, strsep() returns NULL.
-
- strstr(), strnstr(), strcasestr()
- The strstr() function locates the first occurrence of the string s2
- (excluding the terminating null character) in string s1 and returns a
- pointer to the located string, or a null pointer if the string is not
- found. If s2 points to a string with zero length (that is, the string
- ""), the function returns s1.
+ These functions split a null-terminated string into a sequence of
+ tokens delimited by single byte separator characters. The strtok() fam-
+ ily of functions treats a sequence of one or more delimiter characters
+ as a single break between tokens, while strsep() treats each as a sepa-
+ rate delimiter and returns zero-length tokens between them.
- The strnstr() function locates the first occurrence of the null-termi-
- nated string s2 in the string s1, where not more than n characters are
- searched. Characters that appear after a '\0' character are not
- searched.
-
-
- The strcasestr() function is similar to strstr(), but ignores the case
- of both strings.
+ They are designed for use with encodings representing each character as
+ a single byte, and all character counts are measured in individual
+ bytes, even if a string with multibyte characters is used. They do not
+ check for null pointers, and programs may crash if passing null or oth-
+ erwise invalid pointers to these functions.
strtok()
A sequence of calls to strtok() breaks the string pointed to by s1 into
@@ -376,10 +67,6 @@
argument, starts searching from the saved pointer and behaves as
described above.
-
- See Example 1, 2, and 3 in the EXAMPLES section for examples of str-
- tok() usage and the explanation in NOTES.
-
strtok_r()
The strtok_r() function considers the null-terminated string s1 as a
sequence of zero or more text tokens separated by spans of one or more
@@ -402,53 +89,41 @@
string s2 can be different from call to call. When no token remains in
s1, a null pointer is returned.
-
- See Example 3 in the EXAMPLES section for an example of strtok_r()
- usage and the explanation in NOTES.
-
- C11 Bounds Checking Interfaces
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(),
- strlen_s(), strerror_s(), and strerrorlen_s() functions are part of the
- C11 bounds checking interfaces specified in the C11 standard, Annex K.
- With the exception of strerrorlen_s(), each provide similar functional-
- ity to their respective non-bounds checking functions, but with addi-
- tional safety checks in the form of explicit runtime constraints as
- defined in the C11 standard. See runtime_constraint_handler(3C) and
- INCITS/ISO/IEC 9899:2011.
-
-
- If no runtime constraint violation is detected, the strcpy_s(),
- strncpy_s(), strcat_s() and strncat_s() functions return zero, other-
- wise, they return a non-zero value.
-
-
- If a runtime constraint violation is detected, or there is no token,
- the strtok_s() function returns a null pointer, otherwise a pointer to
- the first character of the token is returned.
-
-
- If the length of the requested string is less than maxsize, and no run-
- time-constraint violation is detected, the strerror_s() function
- returns zero, otherwise, a non-zero value is returned.
+ strsep()
+ The strsep() function locates, in the null-terminated string referenced
+ by stringp, the first occurrence of any character in the string delim
+ (or the terminating '\0' character) and replaces it with a '\0'. The
+ location of the next character after the delimiter character (or NULL,
+ if the end of the string was reached) is stored in stringp. The origi-
+ nal value of stringp is returned.
- The strerrorlen_s() function returns the length (not including the null
- terminator) in the message string strerror_s() would return.
+ An "empty" field (one caused by two adjacent delimiter characters) can
+ be detected by comparing the location referenced by the pointer
+ returned by strsep() to '\0'.
- The strnlen_s() function returns zero if s is a null pointer. Other-
- wise, the number of bytes preceding the terminating null character is
- returned. If there is no terminating null character in the first max-
- size characters pointed to by s, strnlen_s() returns maxsize.
+ If stringp is initially NULL, strsep() returns NULL.
-RETURN VALUES
- The functions will fail if:
+ C11 Bounds Checking Interface
+ The strtok_s() function is part of the C11 bounds checking interfaces
+ specified in the C11 standard, Annex K. It provides similar functional-
+ ity to the strtok_r() function, but with additional safety checks in
+ the form of explicit runtime constraints as defined in the C11 stan-
+ dard. See runtime_constraint_handler(3C) and INCITS/ISO/IEC 9899:2011.
+
+
+ If a runtime constraint violation is detected and the handler returns,
+ or there is no token, the strtok_s() function returns a null pointer,
+ otherwise a pointer to the first character of the token is returned.
+ERRORS
+ strtok_s() will fail if:
EINVAL Null pointer is passed or source and destination overlap
- ERANGE size argument is not valid value
+ ERANGE s1max argument is not valid value
EOVERFLOW Destination array is too small
@@ -496,27 +169,27 @@
char line[LINE_MAX];
char *key, *data;
...
- key = strtok(line, " \n");
- data = strtok(NULL, " \n");
-
+ key = strtok(line, " \t\n");
+ data = strtok(NULL, " \t\n");
Example 3 Search for tokens
- The following example uses both strtok() and strtok_r() to search for
- tokens separated by one or more characters from the string pointed to
- by the second argument, "/".
+ The following example uses strtok(), strtok_r(), and strsep() to search
+ for tokens separated by characters from the string pointed to by the
+ second argument, "/".
#define __EXTENSIONS__
#include <stdio.h>
#include <string.h>
- int main {
- char buf[8]="5/90/45";
- char buf1[14] = "//5//90//45//";
+ int main(void) {
+ char buf[] = "5/90/45";
+ char buf1[] = "//5//90//45//";
+ char buf2[] = "//5//90//45//";
char *token;
char *lasts;
@@ -528,13 +201,23 @@
}
}
- printf("\ntokenizing \"%s\" with strtok_r:\n", buf);
+ printf("\ntokenizing \"%s\" with strtok_r:\n", buf1);
if ((token = strtok_r(buf1, "/", &lasts)) != NULL) {
printf("token = \"%s\"\n", token);
while ((token = strtok_r(NULL, "/", &lasts)) != NULL) {
printf("token = \"%s\"\n", token);
}
}
+
+ printf("\ntokenizing \"%s\" with strsep:\n", buf2);
+ nexts = buf2;
+ if ((token = strsep(&nexts, "/")) != NULL) {
+ printf("token = \"%s\"\n", token);
+ while (nexts != NULL) {
+ token = strsep(&nexts, "/");
+ printf("token = \"%s\"\n", token);
+ }
+ }
}
@@ -543,16 +226,26 @@
When compiled and run, this example produces the following output:
- tokenizing "5/90/45" with strtok():
+ tokenizing "5/90/45" with strtok:
token = "5"
token = "90"
token = "45"
- tokenizing "//5//90//45//" with strtok_r():
+ tokenizing "//5//90//45//" with strtok_r:
token = "5"
token = "90"
token = "45"
+ tokenizing "//5//90//45//" with strsep:
+ token = ""
+ token = ""
+ token = "5"
+ token = ""
+ token = "90"
+ token = ""
+ token = "45"
+ token = ""
+ token = ""
ATTRIBUTES
@@ -570,62 +263,87 @@
+-----------------------------+-----------------------------+
MT-Level
- The strtok() and strdup() functions are MT-Safe.
+ The strtok() function is MT-Safe.
+
+
+ The strsep() and strtok_r() functions are Async-Signal-Safe.
- The string(), strcasecmp(), strncasecmp(), strcasecmp_l(), strn-
- casecmp_l(), strcat(), strncat(), strlcat(), strchr(), strrchr(),
- strchrnul(), strcmp(), strncmp(), strcpy(), strncpy(), strlcpy(),
- stpcpy(), stpncpy(), strcspn(), strspn(), strndup(), strdupa(),
- strndupa(), strlen(), strnlen(), strpbrk(), strsep(), strstr(), strn-
- str(), strcasestr(), strtok_r() functions are Async-Signal-Safe.
-
-
- The strcpy_s(), strncpy_s(), strcat_s(), strncat_s(), strtok_s(), str-
- error_s(), strerrorlen_s(), and strnlen_s() functions cannot be used
- safely in a multithreaded application due to the runtime constraint
- handler. For more information, see the runtime_constraint_handler(3C)
- man page.
+ The strtok_s() function cannot be used safely in a multithreaded appli-
+ cation due to the runtime constraint handler. For more information, see
+ the runtime_constraint_handler(3C) man page.
Standard
- For all except strlcat(), strlcpy(), and strsep(), see the standards(7)
- man page.
+ See standards(7) for descriptions of the following standards:
+
+
+ +--------------------------+--------------------------------+
+ | INTERFACES | APPLICABLE STANDARDS |
+ +--------------------------+--------------------------------+
+ |strtok() | C89 through C11, |
+ | | POSIX.1-1990 through 2008, |
+ | | SUS through SUSv4, |
+ | | XPG1 through XPG7 |
+ | | |
+ +--------------------------+--------------------------------+
+ |strtok_r() | POSIX.1-2001 through 2008, |
+ | | SUSv2 through SUSv4, |
+ | | XPG5 through XPG7 |
+ | | |
+ +--------------------------+--------------------------------+
+ |strtok_s() |C11 Annex K |
+ +--------------------------+--------------------------------+
+ |strsep() |None |
+ +--------------------------+--------------------------------+
SEE ALSO
- alloca(3C), malloc(3C), setlocale(3C), strxfrm(3C), attributes(7),
- standards(7), runtime_constraint_handler(3C)
+ runtime_constraint_handler(3C), strpbrk(3C), strspn(3C), wcstok(3C),
+ attributes(7), standards(7)
NOTES
- A single-threaded application can gain access to strtok_r() only by
+ A standard conforming application can gain access to strtok_r() only by
defining __EXTENSIONS__ or by defining _POSIX_C_SOURCE to a value
greater than or equal to 199506L.
- All of these functions assume the default locale "C." For some locales,
- strxfrm(3C) should be applied to the strings before they are passed to
- the functions.
-
-
- The strtok() function is safe to use in multithreaded applications
- because it saves its internal state in a thread-specific data area.
- However, its use is discouraged, even for single-threaded applications.
- The strtok_r() function should be used instead.
+ The strtok() function is safe to use in multithreaded applications on
+ Oracle Solaris because it saves its internal state in a thread-specific
+ data area. (This is not true on some other platforms though, so should
+ not be relied upon in portable software.) However, its use is discour-
+ aged, even for single-threaded applications. The strtok_r() function
+ should be used instead.
Do not pass the address of a character string literal as the argument
- s1 to either strtok() or strtok_r(). Similarly, do not pass a pointer
- to the address of a character string literal as the argument stringp to
- strsep(). These functions can modify the storage pointed to by s1 in
- the case of strtok() and strtok_r() or *stringp in the case of
- strsep(). The C99 standard specifies that attempting to modify the
- storage occupied by a string literal results in undefined behavior.
- This allows compilers (including gcc, clang, and the Oracle Developer
- Studio compilers) to place string literals in read-only memory. Note
- that in Example 1 above, this problem is avoided because the variable
- line is declared as a writable array of type char that is initialized
- by a string literal rather than a pointer to char that points to a
- string literal.
+ s1 to strtok(), strtok_r(), or strtok_s(). Similarly, do not pass a
+ pointer to the address of a character string literal as the argument
+ stringp to strsep(). These functions can modify the storage pointed to
+ by these parameters. The C99 standard specifies that attempting to mod-
+ ify the storage occupied by a string literal results in undefined
+ behavior. This allows compilers (including gcc, clang, and the Oracle
+ Developer Studio compilers) to place string literals in read-only mem-
+ ory. Note that in Example 1 above, this problem is avoided because the
+ variable line is declared as a writable array of type char that is ini-
+ tialized by a string literal rather than a pointer to char that points
+ to a string literal.
+
+HISTORY
+ Support for the following functions is available in Oracle Solaris
+ starting with the listed release:
+
+
+ +-------------------------------------------------+---------+
+ | FUNCTION |RELEASE |
+ +-------------------------------------------------+---------+
+ |strtok_s() |11.4.0 |
+ +-------------------------------------------------+---------+
+ |strsep() |11.0.0 |
+ +-------------------------------------------------+---------+
+ |strtok_r() |2.2 |
+ +-------------------------------------------------+---------+
+ |strtok() |1.0 |
+ +-------------------------------------------------+---------+
-Oracle Solaris 11.4 11 May 2021 string(3C)
+Oracle Solaris 11.4 28 Feb 2022 strtok(3C)
diff -NurbBw 11.4.42/man3c/strxfrm.3c 11.4.45/man3c/strxfrm.3c
--- 11.4.42/man3c/strxfrm.3c 2022-05-17 14:50:19.099252838 -0700
+++ 11.4.45/man3c/strxfrm.3c 2022-05-17 14:51:01.558092975 -0700
@@ -11,13 +11,20 @@
size_t strxfrm(char *restrict s1, const char *restrict s2, size_t n);
- size_t strxfrm_l(char *restrict s1, const char *restrict s2, size_t n, locale_t locale);
+ size_t strxfrm_l(char *restrict s1, const char *restrict s2, size_t n,
+ locale_t locale);
DESCRIPTION
The strxfrm() and strxfrm_l() functions transform the string pointed to
- by s2 and places the resulting string into the array pointed to by s1.
+ by s2 and place the resulting string into the array pointed to by s1.
+ For strxfrm(), the string is interpreted as appropriate to the LC_COL-
+ LATE category of the current locale. For strxfrm_l(), the string is
+ interpreted as appropriate to the LC_COLLATE category of the locale
+ represented by locale.
+
+
The transformation is such that if strcmp(3C) is applied to two trans-
- formed strings, it returns a value greater than, equal to or less than
+ formed strings, it returns a value greater than, equal to, or less than
0, corresponding to the result of strcoll(3C) or strcoll_l(3C), respec-
tively, applied to the same two original strings with the same locale.
No more than n bytes are placed into the resulting array pointed to by
@@ -48,18 +55,13 @@
The transformation function is such that two transformed strings can be
ordered by strcmp(3C) as appropriate to collating sequence information
in category LC_COLLATE of current locale for strxfrm() or of locale
- represented by locale for strxfrm_l() respectively.
+ represented by the locale for strxfrm_l() respectively.
The fact that when n is 0, s1 is permitted to be a null pointer, is
useful to determine the size of the s1 array prior to making the trans-
formation.
-EXAMPLES
- Example 1 A sample of using the strxfm() function.
-
-
-
The value of the following expression is the size of the array needed
to hold the transformation of the string pointed to by s.
@@ -91,10 +92,22 @@
+-----------------------------+-----------------------------+
SEE ALSO
- wscoll(3C), localedef(1), duplocale(3C), freelocale(3C), newlocale(3C),
- setlocale(3C), strcmp(3C), strcoll(3C), uselocale(3C), attributes(7),
- environ(7), standards(7)
+ localedef(1), duplocale(3C), freelocale(3C), newlocale(3C), setlo-
+ cale(3C), strcmp(3C), strcoll(3C), uselocale(3C), wcscoll(3C),
+ wcsxfrm(3C), attributes(7), environ(7), standards(7)
+
+
+ Handling Characters and Character Strings in Internationalizing and
+ Localizing Applications in Oracle Solaris
+
+HISTORY
+ The strxfrm_l() function was added to Oracle Solaris in the Solaris
+ 11.4.0 release.
+
+
+ The strxfrm() function has been included in Solaris since the Solaris
+ 2.0 release.
-Oracle Solaris 11.4 9 Oct 2014 strxfrm(3C)
+Oracle Solaris 11.4 28 Feb 2022 strxfrm(3C)
diff -NurbBw 11.4.42/man3c/timingsafe_memcmp.3c 11.4.45/man3c/timingsafe_memcmp.3c
--- 11.4.42/man3c/timingsafe_memcmp.3c 2022-05-17 14:50:19.174067847 -0700
+++ 11.4.45/man3c/timingsafe_memcmp.3c 2022-05-17 14:51:01.634454606 -0700
@@ -1,37 +1,36 @@
-Standard C Library Functions timingsafe_bcmp(3C)
+Standard C Library Functions timingsafe_memcmp(3C)
NAME
- timingsafe_bcmp, timingsafe_memcmp - timing safe memory operations
+ timingsafe_memcmp, timingsafe_bcmp - timing safe memory operations
SYNOPSIS
#include <string.h>
- int timingsafe_bcmp(const void *s1, const void *s2, size_t n);
int timingsafe_memcmp(const void *s1, const void *s2, size_t n);
+ int timingsafe_bcmp(const void *s1, const void *s2, size_t n);
DESCRIPTION
- The timingsafe_bcmp() and timingsafe_memcmp() functions operate on mem-
- ory areas that are arrays of bytes bounded by a count, and not termi-
- nated by a null character. These functions have an execution time that
- are not affected by the memory contents of their arguments. They are
- designed to be used in timing sensitive use cases, for example, cryp-
- tography.
+ The timingsafe_memcmp() and timingsafe_bcmp() functions operate on mem-
+ ory areas that are arrays of bytes bounded by a count. The execution
+ times of these functions are not affected by the memory contents of
+ their arguments. They are designed to be used in timing sensitive use
+ cases, for example, cryptography.
+
+
+ The timingsafe_memcmp() function compares its arguments looking at the
+ first n bytes where each is interpreted as an unsigned character. It
+ returns an integer less than, equal to, or greater than 0, correspond-
+ ing to whether s1 is lexicographically less than, equal to, or greater
+ than s2 when taken to be unsigned characters. The timingsafe_memcmp()
+ function always returns 0 when n is 0.
The timingsafe_bcmp() function compares the first n bytes of its argu-
ments, returning 0 if they are identical and 1 otherwise. The tim-
ingsafe_bcmp() function always returns 0 when n is 0.
-
- The timingsafe_memcmp() function compares its arguments looking at the
- first n bytes where each is interpreted as an unsigned character. It
- returns an integer less than, equal to, or greater than 0, similarly as
- s1 is lexicographically less than, equal to, or greater than s2 when
- taken to be unsigned characters. The timingsafe_memcmp() function
- always returns 0 when n is 0.
-
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -43,14 +42,16 @@
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
+ |Standard |None |
+ +-----------------------------+-----------------------------+
SEE ALSO
- attributes(7)
+ bcmp(3C), memcmp(3C), attributes(7)
HISTORY
- The timingsafe_bcmp() and timingsafe_memcmp() functions were added to
- Oracle Solaris in the 11.4 release.
+ The timingsafe_memcmp() and timingsafe_bcmp() functions were added to
+ Oracle Solaris in the 11.4.0 release.
-Oracle Solaris 11.4 9 Jul 2018 timingsafe_bcmp(3C)
+Oracle Solaris 11.4 28 Feb 2022 timingsafe_memcmp(3C)
diff -NurbBw 11.4.42/man3c/truncate.3c 11.4.45/man3c/truncate.3c
--- 11.4.42/man3c/truncate.3c 2022-05-17 14:50:19.211399698 -0700
+++ 11.4.45/man3c/truncate.3c 2022-05-17 14:51:01.672617537 -0700
@@ -90,6 +90,10 @@
to a file system.
+ EPERM The file has one or more of the appendonly, read-
+ only, immutable, or rtime system attributes set.
+
+
EROFS The named file resides on a read-only file system.
@@ -194,8 +198,9 @@
+-----------------------------+-----------------------------+
SEE ALSO
- chmod(2), fcntl(2), open(2), attributes(7), lf64(7), standards(7)
+ chmod(2), fcntl(2), open(2), attributes(7), lf64(7), standards(7),
+ sysattr(7)
-Oracle Solaris 11.4 16 Aug 2017 truncate(3C)
+Oracle Solaris 11.4 21 Mar 2022 truncate(3C)
diff -NurbBw 11.4.42/man3commputil/sdp_parse.3commputil 11.4.45/man3commputil/sdp_parse.3commputil
--- 11.4.42/man3commputil/sdp_parse.3commputil 2022-05-17 14:50:19.253512708 -0700
+++ 11.4.45/man3commputil/sdp_parse.3commputil 2022-05-17 14:51:01.711573666 -0700
@@ -273,8 +273,8 @@
o=jdoe 23423423 234234234 IN IP4 192.168.1.1\r\n
s=SDP seminar\r\n
i=A seminar on the session description protocol\r\n
- e=test@host.com
- c=IN IP4 156.78.90.1\r\n
+ e=test@example.com
+ c=IN IP4 198.51.100.1\r\n
t=2873397496 2873404696\r\n
@@ -299,14 +299,14 @@
s_info = "A seminar on the session description protocol"
s_uri = (nil)
s_email {
- value = "test@host.com"
+ value = "test@example.com"
next = (nil)
}
s_phone = (nil)
s_conn {
c_nettype = "IN"
c_addrtype = "IP4"
- c_address = "156.78.90.1"
+ c_address = "198.51.100.1"
c_addrcount = 0
c_ttl = 0
c_next = (nil)
@@ -342,4 +342,4 @@
-Oracle Solaris 11.4 27 Nov 2017 sdp_parse(3COMMPUTIL)
+Oracle Solaris 11.4 9 Mar 2022 sdp_parse(3COMMPUTIL)
diff -NurbBw 11.4.42/man3head/string.h.3head 11.4.45/man3head/string.h.3head
--- 11.4.42/man3head/string.h.3head 2022-05-17 14:50:19.329685103 -0700
+++ 11.4.45/man3head/string.h.3head 2022-05-17 14:51:01.775298940 -0700
@@ -20,6 +20,25 @@
locale_t as described in <locale.h>
+
+ The <string.h> header also provides function prototypes for functions
+ as listed in the following man pages:
+ b64_encode(3C)
+ ffs(3C)
+ memory(3C)
+ strcat(3C)
+ strchr(3C)
+ strcmp(3C)
+ strcoll(3C)
+ strdup(3C)
+ strerror(3C)
+ strerrordesc_np(3C)
+ strlen(3C)
+ strsignal(3C)
+ strtok(3C)
+ strxfrm(3C)
+ timingsafe_bcmp(3C)
+
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -29,13 +48,25 @@
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
- |Standard |See standards(7). |
+ |Standard | C89 through C11, |
+ | | POSIX.1-1990 through |
+ | | 2008, |
+ | | SUS through SUSv4, |
+ | | XPG1 through XPG7 |
+ | | |
+-----------------------------+-----------------------------+
SEE ALSO
- memory(3C), strcoll(3C), string(3C), strxfrm(3C), locale.h(3HEAD), std-
- def.h(3HEAD), types.h(3HEAD), attributes(7), standards(7)
+ b64_encode(3C), ffs(3C), memory(3C), strcat(3C), strchr(3C), str-
+ cmp(3C), strcoll(3C), strdup(3C), strerror(3C), strerrordesc_np(3C),
+ string(3C), strlen(3C), strsignal(3C), strtok(3C), strxfrm(3C), tim-
+ ingsafe_bcmp(3C), locale.h(3HEAD), stddef.h(3HEAD), strings.h(3HEAD),
+ types.h(3HEAD), attributes(7), standards(7)
+
+HISTORY
+ The <string.h> header has been included in all Sun and Oracle releases
+ of Solaris.
-Oracle Solaris 11.4 30 Sep 2014 string.h(3HEAD)
+Oracle Solaris 11.4 28 Feb 2022 string.h(3HEAD)
diff -NurbBw 11.4.42/man3head/strings.h.3head 11.4.45/man3head/strings.h.3head
--- 11.4.42/man3head/strings.h.3head 2022-05-17 14:50:19.400622879 -0700
+++ 11.4.45/man3head/strings.h.3head 2022-05-17 14:51:01.862130790 -0700
@@ -19,6 +18,13 @@
+ The <strings.h> header also provides function prototypes for functions
+ as listed in the following man pages:
+ bstring(3C)
+ ffs(3C)
+ index(3C)
+ strcmp(3C)
+
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -28,13 +34,22 @@
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
- |Standard |See standards(7). |
+ |Standard | POSIX.1-2001 through |
+ | | 2008, |
+ | | SUS through SUSv4, |
+ | | XPG4v2 through XPG7 |
+ | | |
+-----------------------------+-----------------------------+
SEE ALSO
- ffs(3C), string(3C), locale.h(3HEAD), stddef.h(3HEAD), attributes(7),
- standards(7)
+ bstring(3C), ffs(3C), index(3C), strcmp(3C), locale.h(3HEAD), std-
+ def.h(3HEAD), string.h(3HEAD), attributes(7), standards(7)
+
+HISTORY
+ The <strings.h> header has been included in Solaris since the Solaris
+ 2.5 release. It had previously been included in SunOS and Solaris 1.x
+ releases, but was not included in Solaris 2.0 through 2.4.
-Oracle Solaris 11.4 29 Sep 2014 strings.h(3HEAD)
+Oracle Solaris 11.4 28 Feb 2022 strings.h(3HEAD)
diff -NurbBw 11.4.42/man3lib/libc.3lib 11.4.45/man3lib/libc.3lib
--- 11.4.42/man3lib/libc.3lib 2022-05-17 14:50:19.534928396 -0700
+++ 11.4.45/man3lib/libc.3lib 2022-05-17 14:51:01.991900642 -0700
@@ -579,6 +579,7 @@
mq_send mq_setattr
mq_timedreceive mq_timedsend
mq_unlink mrand48
+ mremap
msgctl msgget
msgids msgrcv
msgsnap msgsnd
@@ -590,8 +591,8 @@
mutex_consistent mutex_destroy
mutex_init mutex_lock
mutex_trylock mutex_unlock
- nanosleep nc_perror
+ nanosleep nc_perror
nc_sperror netdir_free
netdir_getbyaddr netdir_getbyname
netdir_options netdir_perror
@@ -656,8 +657,8 @@
priv_intersect priv_inverse
priv_isemptyset priv_isequalset
priv_isfullset priv_ismember
- priv_issubset priv_set
+ priv_issubset priv_set
priv_set_to_str priv_str_to_set
priv_union proc_thr_kill
proc_thr_sigqueue proc_thr_sigqueue_wait
@@ -722,8 +723,8 @@
pthread_setcanceltype pthread_setconcurrency
pthread_setname_np
pthread_setschedparam pthread_setschedprio
- pthread_setspecific pthread_sigmask
+ pthread_setspecific pthread_sigmask
pthread_sigqueue pthread_sigqueue_wait
pthread_spin_destroy pthread_spin_init
pthread_spin_lock pthread_spin_trylock
@@ -788,8 +789,8 @@
rpcb_getaddr rpcb_getmaps
rpcb_gettime rpcb_rmtcall
rpcb_set rpcb_unset
- rresvport rresvport_af
+ rresvport rresvport_af
ruserok rw_rdlock
rw_read_held rw_tryrdlock
rw_trywrlock rw_unlock
@@ -854,8 +855,8 @@
shmadv shmat
shmctl shmdt
shmget shmget_osm
- shmids
+ shmids
shutdown sig2str
sigaction sigaddset
sigaltstack sigdelset
@@ -920,8 +921,8 @@
svc_fdset svc_freeargs
svc_get_local_cred svc_getargs
svc_getreq svc_getreq_common
- svc_getreq_poll svc_getreqset
+ svc_getreq_poll svc_getreqset
svc_getrpccaller svc_max_pollfd
svc_pollfd svc_raw_create
svc_reg svc_register
@@ -986,8 +987,8 @@
timer_gettime timer_settime
times timespec_get
timespecadd timespecclear
- timespeccompare timespecfix
+ timespeccompare timespecfix
timespecisset timespecsub
timezone timingsafe_bcmp
timingsafe_memcmp tmpfile
@@ -1052,8 +1053,8 @@
wcpcpy wcpncpy
wcrtomb wcscasecmp
wcscasecmp_l wcscat
- wcschr wcscmp
+ wcschr wcscmp
wcscoll_l wcscoll
wcscpy wcscspn
wcsdup wcsftime
@@ -1118,8 +1119,8 @@
xdr_uint8_t xdr_union
xdr_vector xdr_void
xdr_wrapstring xdrmem_create
- xdrrec_create xdrrec_endofrecord
+ xdrrec_create xdrrec_endofrecord
xdrrec_eof xdrrec_readbytes
xdrrec_skiprecord xdrstdio_create
xprt_register xprt_unregister
@@ -1184,8 +1185,8 @@
_Q_cmpe _Q_div
_Q_dtoq _Q_feq
_Q_fge _Q_fgt
- _Q_fle _Q_flt
+ _Q_fle _Q_flt
_Q_fne _Q_itoq
_Q_lltoq _Q_mul
_Q_neg _Q_qtod
@@ -1250,8 +1251,8 @@
asctime_s bsearch_s
ctime_s fopen_s
- fprintf_s freopen_s
+ fprintf_s freopen_s
fscanf_s fwprintf_s
fwscanf_s getenv_s
gets_s gmtime_s
diff -NurbBw 11.4.42/man3sip/sip_enable_trans_logging.3sip 11.4.45/man3sip/sip_enable_trans_logging.3sip
--- 11.4.42/man3sip/sip_enable_trans_logging.3sip 2022-05-17 14:50:19.665395009 -0700
+++ 11.4.45/man3sip/sip_enable_trans_logging.3sip 2022-05-17 14:51:02.110375216 -0700
@@ -88,28 +88,28 @@
Tue Nov 27 15:53:34 2007| Message - 1
INVITE sip:user@example.com SIP/2.0
- From: "Me" < sip:me@mydomain.com > ; TAG=tag-from-01
- To: "You" < sip:you@yourdomain.com >
- Contact: < sip:myhome.host.com >
+ From: "Me" < sip:me@mydomain.example > ; TAG=tag-from-01
+ To: "You" < sip:you@yourdomain.example >
+ Contact: < sip:myhome.host.example >
MAX-FORWARDS: 70
Call-ID: 1261K6A6492KF33549XM
CSeq: 111 INVITE
CONTENT-TYPE: application/sdp
Via: SIP/2.0/UDP 192.0.0.1 : 5060 ;branch=z9hG4bK-via-EVERYTHINGIDO-05
- Record-Route: <sip:server1.com;lr>
- Record-Route: <sip:server2.com;lr>
+ Record-Route: <sip:server1.example;lr>
+ Record-Route: <sip:server2.example;lr>
CONTENT-LENGTH : 0
Tue Nov 27 15:53:34 2007| Message - 2
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.0.0.1 : 5060 ;branch=z9hG4bK-via-EVERYTHINGIDO-05
- From: "Me" < sip:me@mydomain.com > ; TAG=tag-from-01
- To: "You" < sip:you@yourdomain.com >;tag=1
+ From: "Me" < sip:me@mydomain.example > ; TAG=tag-from-01
+ To: "You" < sip:you@yourdomain.example >;tag=1
Call-ID: 1261K6A6492KF33549XM
CSeq: 111 INVITE
- Contact: <sip:whitestar2-0.East.Sun.COM:5060;transport=UDP>
- Record-Route: <sip:server1.com;lr>
- Record-Route: <sip:server2.com;lr>
+ Contact: <sip:whitestar2-0.East.Example.COM:5060;transport=UDP>
+ Record-Route: <sip:server1.example;lr>
+ Record-Route: <sip:server2.example;lr>
Content-Length: 0
-----------------------------
@@ -147,5 +147,5 @@
-Oracle Solaris 11.4 27 Nov 2017
+Oracle Solaris 11.4 9 Mar 2022
sip_enable_trans_logging(3SIP)
diff -NurbBw 11.4.42/man3sip/sip_get_contact_display_name.3sip 11.4.45/man3sip/sip_get_contact_display_name.3sip
--- 11.4.42/man3sip/sip_get_contact_display_name.3sip 2022-05-17 14:50:20.277033721 -0700
+++ 11.4.45/man3sip/sip_get_contact_display_name.3sip 2022-05-17 14:51:02.688407504 -0700
@@ -375,7 +375,7 @@
For example, given the following request line in a SIP message sip_msg
that is input to sip_get_request_uri_str():
- FROM : <Alice sip:alice@atlanta.com>;tag=1928301774
+ FROM : <Alice sip:alice@example.com>;tag=1928301774
@@ -435,8 +435,8 @@
and sip_get_via_sent_transport() functions will return the sent-by
host, port (if present), protocol version, protocol name and transport
information from the provided VIA header value. Example, if the VIA
- value is given by SIP/2.0/UDP bobspc.biloxi.com:5060, then the sent-by
- host is "bobspc.biloxi.com", protocol name is "SIP", protocol version
+ value is given by SIP/2.0/UDP bobspc.example.com:5060, then the sent-by
+ host is "bobspc.example.com", protocol name is "SIP", protocol version
is "2.0", port is 5060 and transport is UDP.
@@ -756,5 +756,5 @@
-Oracle Solaris 11.4 11 May 2021
+Oracle Solaris 11.4 9 Mar 2022
sip_get_contact_display_name(3SIP)
diff -NurbBw 11.4.42/man3sip/sip_get_request_method.3sip 11.4.45/man3sip/sip_get_request_method.3sip
--- 11.4.42/man3sip/sip_get_request_method.3sip 2022-05-17 14:50:22.425127001 -0700
+++ 11.4.45/man3sip/sip_get_request_method.3sip 2022-05-17 14:51:04.509615519 -0700
@@ -45,7 +45,7 @@
For example, given the following request line in a SIP message sip_msg
that is input to sip_get_request_uri_str():
- FROM : <Alice sip:alice@atlanta.com>;tag=1928301774
+ FROM : <Alice sip:alice@example.com>;tag=1928301774
@@ -133,5 +133,5 @@
-Oracle Solaris 11.4 27 Nov 2017
+Oracle Solaris 11.4 9 Mar 2022
sip_get_request_method(3SIP)
diff -NurbBw 11.4.42/man3sip/sip_get_request_uri_str.3sip 11.4.45/man3sip/sip_get_request_uri_str.3sip
--- 11.4.42/man3sip/sip_get_request_uri_str.3sip 2022-05-17 14:50:22.451199232 -0700
+++ 11.4.45/man3sip/sip_get_request_uri_str.3sip 2022-05-17 14:51:04.537785500 -0700
@@ -31,13 +31,13 @@
For example, given the following request line in a SIP message input to
sip_get_request_uri_str():
- INVITE sip:marconi@radio.org SIP/2.0
+ INVITE sip:marconi@example.org SIP/2.0
the return is a pointer to sip_str_t with the sip_str_ptr member point-
- ing to "s" of sip:marconi@radio.org and sip_str_len being set to 21,
- the length of sip:marconi@radio.org.
+ ing to "s" of sip:marconi@example.org and sip_str_len being set to 23,
+ the length of sip:marconi@example.org.
The sip_get_request_uri_str() function returns the URI string from the
@@ -81,5 +81,5 @@
-Oracle Solaris 11.4 25 Jan 2007
+Oracle Solaris 11.4 9 Mar 2022
sip_get_request_uri_str(3SIP)
diff -NurbBw 11.4.42/man3sip/sip_is_sip_uri.3sip 11.4.45/man3sip/sip_is_sip_uri.3sip
--- 11.4.42/man3sip/sip_is_sip_uri.3sip 2022-05-17 14:50:24.304276113 -0700
+++ 11.4.45/man3sip/sip_is_sip_uri.3sip 2022-05-17 14:51:06.549989338 -0700
@@ -88,13 +88,13 @@
For example, given the following request line in a SIP message input to
sip_get_request_uri_str():
- INVITE sip:marconi@radio.org SIP/2.0
+ INVITE sip:marconi@example.org SIP/2.0
the return is a pointer to sip_str_t with the sip_str_ptr member point-
- ing to "s" of sip:marconi@radio.org and sip_str_len being set to 21,
- the length of sip:marconi@radio.org.
+ ing to "s" of sip:marconi@example.org and sip_str_len being set to 23,
+ the length of sip:marconi@example.org.
The sip_is_sip_uri() function takes a parsed URI sip_uri and returns
@@ -224,4 +224,4 @@
-Oracle Solaris 11.4 10 Feb 2007 sip_is_sip_uri(3SIP)
+Oracle Solaris 11.4 9 Mar 2022 sip_is_sip_uri(3SIP)
diff -NurbBw 11.4.42/man3sip/sip_parse_uri.3sip 11.4.45/man3sip/sip_parse_uri.3sip
--- 11.4.42/man3sip/sip_parse_uri.3sip 2022-05-17 14:50:24.389732456 -0700
+++ 11.4.45/man3sip/sip_parse_uri.3sip 2022-05-17 14:51:06.624183632 -0700
@@ -33,13 +33,13 @@
For example, given the following request line in a SIP message input to
sip_get_request_uri_str():
- INVITE sip:marconi@radio.org SIP/2.0
+ INVITE sip:marconi@example.org SIP/2.0
the return is a pointer to sip_str_t with the sip_str_ptr member point-
- ing to "s" of sip:marconi@radio.org and sip_str_len being set to 21,
- the length of sip:marconi@radio.org.
+ ing to "s" of sip:marconi@example.org and sip_str_len being set to 23,
+ the length of sip:marconi@example.org.
The sip_parse_uri() function takes a URI string in the form sip_str_t
@@ -95,4 +95,4 @@
-Oracle Solaris 11.4 25 Jan 2007 sip_parse_uri(3SIP)
+Oracle Solaris 11.4 9 Mar 2022 sip_parse_uri(3SIP)
diff -NurbBw 11.4.42/man4fs/zfs.4fs 11.4.45/man4fs/zfs.4fs
--- 11.4.42/man4fs/zfs.4fs 2022-05-17 14:50:24.480733101 -0700
+++ 11.4.45/man4fs/zfs.4fs 2022-05-17 14:51:06.716107500 -0700
@@ -71,7 +69,7 @@
For more information about managing ZFS file systems, see the Managing
- ZFS File Systems in Oracle Solaris 11.4.
+ ZFS File Systems in Oracle Solaris 11.4 book.
ATTRIBUTES
See attributes(7) for a description of the following attributes:
@@ -84,7 +82,7 @@
+-----------------------------+-----------------------------+
SEE ALSO
- du(1), attributes(7), df(8), zfs(8), zpool(8)
+ du(1), attributes(7), fsattr(7), sysattr(7), df(8), zfs(8), zpool(8)
Managing ZFS File Systems in Oracle Solaris 11.4
@@ -116,4 +114,4 @@
-Oracle Solaris 11.4 16 Dec 2015 zfs(4FS)
+Oracle Solaris 11.4 21 Mar 2022 zfs(4FS)
diff -NurbBw 11.4.42/man5/bootparams.5 11.4.45/man5/bootparams.5
--- 11.4.42/man5/bootparams.5 2022-05-17 14:50:24.506524786 -0700
+++ 11.4.45/man5/bootparams.5 2022-05-17 14:51:06.762938774 -0700
@@ -71,7 +71,7 @@
keyword. Unlike the forms shown above, this syntax does not use a
colon. For example:
- client1 domain=bldg1.workco.com
+ client1 domain=bldg1.example.com
@@ -82,7 +82,7 @@
split the following entry between the end of the path (root) and the
keyword domain:
- client1 root=server1:/export/client1/root domain=bldg1.workco.com
+ client1 root=server1:/export/client1/root domain=bldg1.example.com
@@ -132,7 +132,7 @@
client1 root=server1:/export/client1/root rootopts=:vers=2 \
- domain=bldg1.workco.com
+ domain=bldg1.example.com
client2 root=server2:/export/client2/root ns=:nis
client3 root=server2:/export/client3/root ns=watson:
client4 root=server2:/export/client4/root \
@@ -153,4 +153,4 @@
-Oracle Solaris 11.4 11 May 2021 bootparams(5)
+Oracle Solaris 11.4 9 Mar 2022 bootparams(5)
diff -NurbBw 11.4.42/man5/NISLDAPmapping.5 11.4.45/man5/NISLDAPmapping.5
--- 11.4.42/man5/NISLDAPmapping.5 2022-05-17 14:50:24.549728242 -0700
+++ 11.4.45/man5/NISLDAPmapping.5 2022-05-17 14:51:06.814549924 -0700
@@ -66,10 +66,10 @@
Attributes generally apply to one more NIS maps. Map names can be spec-
ified either on their own, that is in passwd.byname, in which case they
apply to all domains, or for individual NIS domains, for example, in
- passwd.byname,example.sun.uk. Where a map is mentioned in more than one
- attribute, both versions are applied. If any parts of the attributes
- are in conflict, the domain specific version takes precedence over the
- non-domain specific version.
+ passwd.byname,site.example.com. Where a map is mentioned in more than
+ one attribute, both versions are applied. If any parts of the
+ attributes are in conflict, the domain specific version takes prece-
+ dence over the non-domain specific version.
Each domain specific attributes must appear in NISLDAPmapping before
@@ -104,7 +104,7 @@
The following is an example of the nisLDAPdomainContext attribute:
- domain.one : dc=site, dc=company, dc=com
+ domain.one : dc=site, dc=example, dc=com
The mapping file should define the context for each domain before
any other attribute makes use of the NISDomainName specified for
@@ -1032,4 +1016,4 @@
-Oracle Solaris 11.4 19 Apr 2019 NISLDAPmapping(5)
+Oracle Solaris 11.4 9 Mar 2022 NISLDAPmapping(5)
diff -NurbBw 11.4.42/man5/nscd.conf.5 11.4.45/man5/nscd.conf.5
--- 11.4.42/man5/nscd.conf.5 2022-05-17 14:50:24.588590184 -0700
+++ 11.4.45/man5/nscd.conf.5 2022-05-17 14:51:06.884081572 -0700
@@ -86,7 +86,7 @@
global_check_smf_state_interval value
Interval between checking the status of dependent SMF services such
- as ldap(7), nis(7) and mdns(8). The default value is 120 seconds.
+ as ldap(7), nis(7) and mdnsd(8). The default value is 120 seconds.
debug_level value
@@ -241,7 +241,7 @@
hosts(5), netmasks(5), networks(5), nsswitch.conf(5), passwd(5),
prof_attr(5), project(5), protocols(5), rpc(5), services(5),
user_attr(5), attributes(7), ldap(7), nis(7), ldap_cachemgr(8),
- mdns(8), nscd(8), svccfg(8)
+ mdnsd(8), nscd(8), svccfg(8)
HISTORY
The Solaris 2.5 OS introduced the /etc/nscd.conf file as the nscd
diff -NurbBw 11.4.42/man5/timezone.5 11.4.45/man5/timezone.5
--- 11.4.42/man5/timezone.5 2022-05-17 14:50:24.630883395 -0700
+++ 11.4.45/man5/timezone.5 2022-05-17 14:51:06.922897283 -0700
@@ -41,7 +41,7 @@
Here is a typical line from the /etc/timezone file:
- US/Eastern East.Sun.COM #Sun East Coast
+ US/Eastern East.Example.COM # US East Coast
@@ -56,4 +56,4 @@
-Oracle Solaris 11.4 11 May 2021 timezone(5)
+Oracle Solaris 11.4 9 Mar 2022 timezone(5)
diff -NurbBw 11.4.42/man7/fsattr.7 11.4.45/man7/fsattr.7
--- 11.4.42/man7/fsattr.7 2022-05-17 14:50:24.689714721 -0700
+++ 11.4.45/man7/fsattr.7 2022-05-17 14:51:06.996164164 -0700
@@ -66,8 +66,16 @@
The entire available name space has been allocated to "general use" to
bring the implementation in line with the NFSv4 draft standard [NFSv4].
That standard defines "named attributes" (equivalent to Solaris
- Extended Attributes) with no naming restrictions. All Sun applications
- making use of opaque extended attributes will use the prefix "SUNW".
+ Extended Attributes) with no naming restrictions. All Solaris applica-
+ tions making use of opaque extended attributes will use the prefix
+ "SUNW".
+
+
+ Oracle Solaris uses the extended attribute files named SUNWattr_ro and
+ SUNWattr_rw to store system attributes, described in the sysattr(7)
+ manual page. These are treated as special cases by many of the utili-
+ ties listed below and not included when operating on general extended
+ attributes.
Shell-level API
The command interface for extended attributes is the set of applica-
@@ -78,7 +86,7 @@
attributes can be manipulated as regular files.
- The -@ option enable utilities to manipulate extended attributes. As a
+ The -@ option enables utilities to manipulate extended attributes. As a
rule, this option enables the utility to enter into attribute space
when the utility is performing a recursive traversal of file system
space. This is a fully recursive concept. If the underlying file system
@@ -86,6 +94,11 @@
opens these spaces to the file tree-walking algorithms.
+ Many of these commands treat system attributes as a separate case from
+ general extended attributes, and require the -/ option to operate on
+ system attributes.
+
+
The following utilities accommodate extended attributes (see the indi-
vidual manual pages for details):
@@ -125,7 +138,7 @@
attribute-aware environment.
- fsdb This fsdb utility is able to find the inode for the "hidden"
+ fsdb The fsdb utility is able to find the inode for the "hidden"
extended attribute directory.
@@ -224,17 +237,17 @@
chdir() or fchdir() is currently required. See chdir(2).
Open a file relative to a file descriptor
- int openat (int fd, const char *path, int oflag [, mode_t mode])
+ int openat(int fd, const char *path, int oflag [, mode_t mode]);
The openat(2) function behaves exactly as open(2) except when given a
relative path. Where open() resolves a relative path from the current
working directory, openat() resolves the path based on the vnode indi-
- cated by the supplied file descriptor. When oflag is O_XATTR, openat()
- interprets the path argument as an extended attribute reference. The
- following code fragment uses openat() to examine the attributes of some
- already opened file:
+ cated by the supplied file descriptor. When oflag includes O_XATTR,
+ openat() interprets the path argument as an extended attribute refer-
+ ence. The following code fragment uses openat() to examine the
+ attributes of some already opened file:
dfd = openat(fd, ".", O_RDONLY|O_XATTR);
(void)getdents(dfd, buf, nbytes);
@@ -249,7 +262,7 @@
rent working directory.
Unlink a file relative to a directory file descriptor
- int unlinkat (int dirfd, const char *pathflag, int flagflag)
+ int unlinkat(int dirfd, const char *path, int flag);
@@ -265,7 +278,7 @@
semantics of this function are equivalent to rmdir(2).
Rename a file relative to directories
- int renameat (int fromfd, const char *old, int tofd, const char *new)
+ int renameat(int fromfd, const char *old, int tofd, const char *new);
@@ -295,7 +308,7 @@
directory that is not an extended attribute directory.
Obtain information about a file
- int fstatat (int fd, const char *path, struct stat* buf, int flag)
+ int fstatat(int fd, const char *path, struct stat *buf, int flag);
@@ -309,11 +322,11 @@
valid directory, the function returns ENOTDIR. If AT_SYMLINK_NOFOLLOW
is set in the flag argument, the function will not automatically tra-
verse a symbolic link at the position of the path. If _AT_TRIGGER is
- set in the flag argument and the vnode is a trigger mount point, the
- mount is performed and the function returns the attributes of the root
- of the mounted filesystem. The fstatat() function is a multipurpose
- function that can be used in place of stat(), lstat(), or fstat(). See
- stat(2)
+ set in the flag argument and the vnode is an autofs trigger mount
+ point, the mount is performed and the function returns the attributes
+ of the root of the mounted filesystem. The fstatat() function is a mul-
+ tipurpose function that can be used in place of stat(), lstat(), or
+ fstat(). See stat(2).
The function call stat(path, buf) is identical to fstatat(AT_FDCWD,
@@ -321,15 +334,15 @@
The function call lstat(path, buf) is identical to fstatat(AT_FDCWD,
- path, buf, AT_SYMLINK_NOFOLLOW)
+ path, buf, AT_SYMLINK_NOFOLLOW).
The function call fstat(fildes, buf) is identical to fstatat(fildes,
NULL, buf, 0).
Set owner and group ID
- int fchownat (int fd, const char *path, uid_t owner, gid_t group, \
- int flag)
+ int fchownat(int fd, const char *path, uid_t owner, gid_t group,
+ int flag);
@@ -355,8 +368,8 @@
nat(AT_FDCWD, path, owner, group, AT_SYMLINK_NOFOLLOW).
Set file access and modification times
- int utimensat (int fd, const char *path, const struct timespec \
- times[2], int flag)
+ int utimensat(int fd, const char *path,
+ const struct timespec times[2], int flag);
@@ -395,7 +408,7 @@
and the behavior is identical to a call to access(2).
New pathconf() functionality
- long int pathconf(const char *path, int name)
+ long int pathconf(const char *path, int name);
@@ -404,11 +417,13 @@
allows an application to determine if attribute support is currently
enabled for the file in question. The XATTR_EXISTS variable allows an
application to determine whether there are any extended attributes
- associated with the supplied path.
+ associated with the supplied path. The XATTR_EXISTS check will return 0
+ if the only extended attributes associated with the supplied path are
+ system attributes.
Open/Create an attribute file
- int attropen (const char *path, const char *attrpath, int oflag \
- [, mode_t mode])
+ int attropen(const char *path, const char *attrpath, int oflag
+ [, mode_t mode]);
@@ -433,7 +448,7 @@
below) on the returned file descriptor.
Convert an open file descriptor for a directory into a directory descriptor
- DIR * fdopendir (const int fd)
+ DIR * fdopendir(const int fd);
@@ -676,8 +691,12 @@
SEE ALSO
cp(1), cpio(1), du(1), find(1), ls(1), mv(1), pax(1), runat(1), tar(1),
access(2), chown(2), link(2), open(2), pathconf(2), rename(2), stat(2),
- unlink(2), utimensat(2), attropen(3C), standards(7), fsck(8)
+ unlink(2), utimensat(2), attropen(3C), standards(7), sysattr(7),
+ fsck(8)
+
+HISTORY
+ Extended attributes were added to Solaris in the Solaris 9 release.
-Oracle Solaris 11.4 24 May 2010 fsattr(7)
+Oracle Solaris 11.4 21 Mar 2022 fsattr(7)
diff -NurbBw 11.4.42/man7/pam_krb5_migrate.7 11.4.45/man7/pam_krb5_migrate.7
--- 11.4.42/man7/pam_krb5_migrate.7 2022-05-17 14:50:24.718191705 -0700
+++ 11.4.45/man7/pam_krb5_migrate.7 2022-05-17 14:51:07.032679789 -0700
@@ -146,16 +146,16 @@
host client service principal:
- host/*@ACME.COM U root
- host/*@ACME.COM ui *
+ host/*@EXAMPLE.COM U root
+ host/*@EXAMPLE.COM ui *
The preceding entries permit the pam_krb5_migrate add privilege to the
- host client service principal of any machine in the ACME.COM KerberosV5
- realm, but denies the add privilege to all host service principals for
- addition of the root user account.
+ host client service principal of any machine in the EXAMPLE.COM Ker-
+ berosV5 realm, but denies the add privilege to all host service princi-
+ pals for addition of the root user account.
Example 3 Sample PAM entries for the Master KDC
@@ -199,4 +199,4 @@
-Oracle Solaris 11.4 11 May 2021 pam_krb5_migrate(7)
+Oracle Solaris 11.4 9 Mar 2022 pam_krb5_migrate(7)
diff -NurbBw 11.4.42/man7/privileges.7 11.4.45/man7/privileges.7
--- 11.4.42/man7/privileges.7 2022-05-17 14:50:24.758660462 -0700
+++ 11.4.45/man7/privileges.7 2022-05-17 14:51:07.074878780 -0700
@@ -706,12 +706,18 @@
- Of the privileges listed above, the privileges PRIV_FILE_LINK_ANY,
- PRIV_FILE_READ, PRIV_FILE_WRITE, PRIV_PROC_INFO, PRIV_PROC_SESSION,
- PRIV_NET_ACCESS, PRIV_PROC_FORK, and PRIV_PROC_EXEC are considered
- "basic" privileges. These are privileges that used to be always avail-
- able to unprivileged processes. By default, processes still have the
- basic privileges.
+ Of the privileges listed above, the privileges PRIV_DAX_ACCESS,
+ PRIV_FILE_LINK_ANY, PRIV_FILE_READ, PRIV_FILE_WRITE, PRIV_NET_ACCESS,
+ PRIV_PROC_EXEC, PRIV_PROC_FORK, PRIV_PROC_INFO, PRIV_PROC_SELF,
+ PRIV_PROC_SESSION, and PRIV_SYS_IB_INFO are considered "basic" privi-
+ leges. These are privileges that used to be always available to unpriv-
+ ileged processes. By default, processes still have the basic privi-
+ leges.
+
+
+ The set of basic privileges has changed over time as new privileges
+ have been defined. The current set of basic privileges used on a system
+ is listed by running the command ppriv -l basic.
The privileges PRIV_PROC_SETID, PRIV_PROC_AUDIT, and PRIV_SYS_RESOURCE
@@ -1144,4 +1150,4 @@
-Oracle Solaris 11.4 21 Jun 2021 privileges(7)
+Oracle Solaris 11.4 10 Mar 2022 privileges(7)
diff -NurbBw 11.4.42/man7/solaris-kz.7 11.4.45/man7/solaris-kz.7
--- 11.4.42/man7/solaris-kz.7 2022-05-17 14:50:24.814294006 -0700
+++ 11.4.45/man7/solaris-kz.7 2022-05-17 14:51:07.126592516 -0700
@@ -12,17 +12,17 @@
that used by the global zone.
Installation and Update
- A solaris-kz installation is independent of that of the global zone; it
- is not a pkg linked image and can be modified regardless of the global
- zone content. A solaris-kz zone can be installed in the same manner as
- other brands directly from the global zone, or via a boot media as
- described below.
+ A solaris-kz installation is independent of the global zone; it is not
+ a pkg linked image and can be modified regardless of the global zone
+ content. A solaris-kz zone can be installed in the same manner as other
+ brands directly from the global zone, or via a boot media as described
+ below.
- When specifying a manifest for installation, the manifest used should
- be the one suitable for a global zone installation. As kernel zones
- always install into a known location for the root pool, an installation
- target disk should not be specified.
+ When specifying a manifest for installation, the manifest should be
+ suitable for a global zone installation. As kernel zones always install
+ into a known location for the root pool, an installation target disk
+ should not be specified.
If an AI manifest is used to install a different version of Solaris
@@ -39,14 +39,15 @@
more information, see the beadm(8) man page.
Process Management and Visibility
- As, unlike other brands, a solaris-kz zone runs a separate kernel, some
- differences are apparent when examining the zone from the global zone.
+ Unlike other brands, a solaris-kz zone runs a separate kernel in its
+ own address space and differences are apparent when examining the zone
+ from the global zone.
- Processes that are running in a solaris-kz zone are not directly acces-
- sible by the global zone. For example, to see the list of processes in
- a kernel zone named kz-zone, rather than using the ps command with -z
- kz-zone options, you need to use the following command:
+ As an example, processes running in a solaris-kz zone are not directly
+ accessible by the global zone. To see the list of processes in a kernel
+ zone named kz-zone, rather than using the ps command with the -z kz-
+ zone option, you need to use the following command:
# zlogin kz-zone ps -e
@@ -56,9 +57,9 @@
The global zone and each kernel zone manage their own process ID space.
Thus, the process 1234 may exist in the global zone and one or more
- kernel zones. Those are unique processes. If the global zone adminis-
- trator wish to kill process 1234 in kz-zone, it should be done with the
- following command or an equivalent:
+ kernel zones and are unique processes. If the global zone administrator
+ wishes to kill process 1234 in kz-zone, it must be done with the fol-
+ lowing command or an equivalent:
# zlogin kz-zone kill 1234
@@ -104,23 +105,23 @@
Stolen time as reported by the mpstat(8), iostat(8), vmstat(8) and
other utilities directly reflects the time when the kernel zone could
- not run as the host might be using CPU resources for other purposes.
+ not run due to the host using CPU resources for other purposes.
Storage Access
A solaris-kz brand zone must reside on one or more devices. A default
zfs(8) volume will be created in the global zone's root zpool if the
configuration is not customized prior to installation. The device onto
- which the zone is installed is specified with device resources that
- have the bootpri property set to any positive integer value. If a
+ which the zone is installed is specified with device resources which
+ have the bootpri property set to a non-negative integer value. If a
device will not be used as a boot device, it must not have the bootpri
property set. To unset bootpri, use clear bootpri while in the device
resource scope. If multiple bootable devices are present during instal-
lation, the devices will be used for a mirrored root ZFS pool in the
- zone. The bootpri property specifies a relative order with respect to
- other bootpri entries. The default boot order is determined by sorting
- the entries first by bootpri where smaller entries are ordered before
- larger entries, then by id if multiple devices have the same bootpri.
- For example:
+ zone. The bootpri property specifies a relative boot order with respect
+ to other bootpri entries. The default boot order is determined by sort-
+ ing the entries first by bootpri where lower entries are ordered before
+ larger entries, then by id if multiple devices have the same bootpri
+ value. For example:
# zonecfg -z vzl-129 info device
@@ -140,15 +141,16 @@
- In the above example, the boot order is: C, A, B.
+ In the above example, the boot order is: id=2, id=0, id=1.
- The zonepath cannot be set for a kernel zone. As an implementation
- detail, it is set to a fixed location using tmpfs(4FS). It contains no
- persistent or otherwise user-serviceable data. As the zone root is con-
- tained with the root ZFS volume, it is not mounted in the global zone
- under the zone path, unlike traditional zones. Access to the zone root
- can only be done through the zone itself, for example zlogin.
+ The zonepath property cannot be set for a kernel zone. As an implemen-
+ tation detail, it is set to a fixed location using tmpfs(4FS) and con-
+ tains no persistent or otherwise user-serviceable data. As the zone
+ root is contained within the root ZFS volume, it is not mounted in the
+ global zone under the zone path, unlike traditional zones. Access to
+ the zone root can only be done through the zone itself, for example
+ logging into the zone via zlogin.
A solaris-kz zone cannot directly take advantage of shared-kernel fea-
@@ -157,16 +159,16 @@
volumes, and lofi devices.
- A solaris-kz zone's root is always accessible. Storage can be added by
- using add device in zonecfg. Only storage property can be set. The
- match property is not supported. Storage URI is used to configure disk
- device. For more information, see the suri(7) man page.
+ Storage can be added by using add device in zonecfg(8) to specify a
+ storage URI via the storage property; the match property is not sup-
+ ported for kernel zones. For more information, see the suri(7) man
+ page.
- A local device path storage URI can be set to storage property. It can
- be either a ZFS volume, a raw disk, or a lofi device. The specified
- device must be a whole disk or LUN. You can use the device path without
- any partition/slice suffix, for example:
+ Local devices can be specified in the storage property using a dev URI
+ which maps to a ZFS volume or a raw disk device, or a file URI. If a
+ raw disk is specified it must be a whole disk or LUN. You can use the
+ device path without any partition/slice suffix, for example:
# zonecfg -z myzone
@@ -178,15 +180,16 @@
- The id can be specified to fix the disk address inside the zone. If not
- given, it is automatically allocated.
+ The id can be specified to fix the disk address inside the zone. If id
+ is not specified, the system will automatically allocate and assign a
+ value.
- A portable storage URI can also be configured in storage property to
- make the zone's configuration portable to other host systems.
-
-
- For example:
+ Shared storage URIs are required to enable kernel zones to be migrat-
+ able to other host systems; this applies to both the root pool
+ device(s) and any other storage devices configured as device or suspend
+ resources for the zone. See the suri(7) man page for more information
+ on shared storage URIs. For example:
# zonecfg -z myzone
@@ -197,8 +200,8 @@
- To see information about the current configuration for device
- resources, use the info subcommand. For example:
+ To see the configuration of a kernel zones device resources, use the
+ zonecfg(8) info subcommand.
# zonecfg -z myzone info device
@@ -228,9 +231,9 @@
- To install a zone to a non-default location, to an iSCSI logical unit,
- for example, the device resource for the root disk must be modified.
- For example:
+ To install a zone to a non-default location such as an iSCSI logical
+ unit, the device resource for the root disk must be modified from the
+ system specified default. For example:
# zonecfg -z myzone
@@ -240,15 +243,12 @@
- At least one device must have bootpri set to a positive integer to
+ At least one device must have bootpri set to a non-negative integer to
indicate that it is bootable. Within a kernel zone, all devices that
act as mirrors or spares for the root ZFS pool must be bootable. If the
- URI of a device cannot be mapped during boot time, for example, device
- is missing or iSCSI storage goes offline, booting such zone will fail.
-
-
- Only storage devices are supported by add device for the solaris-kz
- brand.
+ storage URI cannot be mapped at boot time, such as when the device the
+ URI is mapped to is missing or the iSCSI LUN goes offline, the zone
+ will fail to boot.
SCSI Reservations
Setting the allow-mhd property to "true" allows applications to use the
@@ -291,14 +288,12 @@
1. If anet is configured with allowed-mac-address as any.
-
2. If anet is configured with allowed-mac-address as 2:8:20,
where 2:8:20 is the default OUI for VNICs.
-
- Attempting to boot a zone with mac-address settings of specific MAC
+ Attempting to boot a zone with mac-address settings of a specific MAC
address is permitted if the user specified mac address matches any of
the allowed-mac-address list. For more information about the allowed-
mac-address anet property, see the zonecfg(8) man page.
@@ -316,62 +311,97 @@
auto. For details of these settings, see the zonecfg(8) man page.
Memory Configuration
- A fixed amount of host RAM must be allocated to a kernel zone. This is
- configured by the physical property of the capped-memory resource in
- zonecfg(8). The given value may be rounded up to a supported platform
- value. The allocated memory is locked, and hence not pageable to a swap
- device.
+ Host memory is allocated to a kernel zone when the zone is booted. The
+ size of the allocation is configured by setting the physical property
+ of the capped-memory resource in zonecfg(8). The value of the physical
+ property is a number with an optional scale suffix (K, M, G, T). If a
+ real number with a fractional part is specified, it is internally con-
+ verted to an integer value. Because this conversion can introduce an
+ unexpected rounding or representation error it is recommended to use an
+ integer number with an appropriate scale suffix.
+
+ The minimal size of the physical memory for a kernel zone is 2GB and is
+ allocated using a single page size. The allocated memory is locked and
+ as such is not pageable to a swap device.
- When specifying physical property you also need to specify the page-
- size-policy property of capped-memory resource in zonecfg(8). The page-
- size-policy property is used to specify a policy for solaris-kz brand
- to use large page(s) for its physical memory. The pagesize-policy prop-
- erty can only be used in conjunction with physical property. Following
- are the acceptable keywords for pagesize-policy property:
- largest-only Only the largest possible page size for the kernel
- zone's physical memory is allocated. If you fail
- to assign all the pages, then you fail to boot the
- zone.
+ You can set the pagesize-policy property of the capped-memory resource
+ in the zones configuration to specify a policy for selecting the page
+ size used to allocate the kernel zones memory. The policy can be set to
+ one of:
+ largest-only Use the largest page size provided by the system
+ for the kernel zones memory allocation. The zone
+ will fail to boot if the system is unable to allo-
+ cate the required number of pages to satisfy the
+ memory allocation or the allocation size is not
+ aligned with the size of largest page provided by
+ the host.
- largest-available You can attempt to provide the largest possible
- page size, scaling down the page size if one can-
- not allocate all physical memory with a particular
- page size. The priority is to boot the zone.
+ largest-available The system attempts to use the largest possible
+ page size, scaling down the page size until the
+ allocation can be satisfied. The priority is to
+ boot the zone.
- smallest-only Lowest allowable page size required to boot the
- kernel zone for the particular platform is chosen.
+ smallest-only Use the smallest page size provided by the host
+ for the memory allocation.
- Clearing the pagesize-policy property, or not present, is necessary for
- supporting older suspend image format. It allows live migration and
- resume of KZ from new systems to older systems. Lowest allowable page
- size required to boot the kernel zone for the particular platform is
- chosen.
+ fixed The kernel zones memory is allocated using only
+ pages of the size specified by the pagesize prop-
+ erty. The physical memory size of the kernel zone
+ must be aligned with the pagesize. The zone will
+ fail to boot if there are insufficient pages of
+ the specified size available or the pagesize is
+ not supported by the host.
+
+
+
+ Clearing the pagesize-policy property may be necessary to support
+ resuming an older suspend image format or to permit live or warm migra-
+ tion between systems. If not specified, the smallest supported page
+ size provided by the host platform will be used to make the allocation.
+
+
+ If the pagesize-policy property is set to fixed, the pagesize property
+ must be set to a page size supported by the host. The size is specified
+ as an integer value with an optional scale suffix (K, M, G). See page-
+ size(1) on how to determine supported page sizes for a given kernel
+ zone host. The smallest allowed page size is 256MB.
Memory Reservation Pools
Guaranteeing memory allocation for booting and rebooting kernel zones
- may be difficult on systems with memory contention. To mitigate the
- issue, memory reservation pool (MRP) for kernel zones is a way to
- reserve memory ahead of time early during boot. It is managed by the
- svc:/system/memory-reserve:zones service and is disabled by default.
+ may be difficult on systems experiencing memory contention. To mitigate
+ this situation, memory reservation pools (MRP) provide a mechanism to
+ reserve memory during system boot for later use by kernel zones. It is
+ managed by the svc:/system/memory-reserve:zones service and is disabled
+ by default.
- To configure the MRP, modify the following properties of svc:/sys-
- tem/memory-reserve:zones service instance:
+ To configure the kernel zone MRP, modify the following properties of
+ svc:/system/memory-reserve:zones service instance:
config/size The size of the memory reservation. A scale
(K, M, G, T) can be applied to the value.
- Mimics physical under capped-memory.
+
+
+ config/pagesize The page size to use for the memory reserva-
+ tion if the config/pagesize-policy is set to
+ fixed. Must be an integer with an optional
+ scale suffix (K, M, G). If the specified page
+ size is not supported on the host, the ser-
+ vice transitions into the maintenance state
+ and any kernel zones using the service will
+ fail to boot. Use pagesize(1) to determine
+ the page sizes supported by the host system.
config/pagesize-policy Mimics pagesize-policy under capped-memory.
- Acceptable values are smallest-only, largest-
- available, and largest-only.
+ Acceptable values are fixed, smallest-only,
+ largest-available, and largest-only.
config/type Must be set to solaris-kz.
@@ -382,8 +412,9 @@
- For example, here is how to configure and enable the default MRP ser-
- vice to set aside 80G of largest-available memory:
+ Here is an example on how to configure and enable the kernel zone MRP
+ service to reserve 80G of memory using the pagesize-policy set to
+ largest-available.
# svccfg -s svc:/system/memory-reserve:zones
@@ -398,18 +429,14 @@
- To configure a kernel zone to allocate its memory from an MRP, the mem-
- ory-reserve property under capped-memory must be set to the MRP manage-
- ment service instance name (eg 'zones'). This property cannot be recon-
- figured live and is mutually exclusive with the pagesize-policy. That
- is, if an MRP service instance is used, the kernel zone will use the
- pagesize of the MRP that was selected by configured MRP service page-
- size-policy. If the memory-reserve property is cleared (the default),
- then the kernel zone will allocate from general system memory.
-
-
- For example, here is how to configure the zone kz-zone to use the above
- default mrp:
+ To configure a kernel zone to have its memory allocated from a MRP, the
+ memory-reserve property under the capped-memory resource must be set to
+ the MRP service instance name (e.g. 'zones'). This property cannot be
+ reconfigured live and is mutually exclusive with the pagesize-policy
+ property of the capped-memory resource. That is, if a MRP is used, the
+ kernel zone uses the pagesize-policy of the MRP service. The following
+ is an example on how to configure the zone kz-zone to use the above MRP
+ service instance for its memory allocation:
# zonecfg -z kz-zone
@@ -422,11 +449,35 @@
+ Memory Live Zone Reconfiguration
+ Memory Live Zone Reconfiguration (Memory LZR) is currently supported
+ only on the SPARC platform.
+
+
+ If enabled, Memory LZR allows the system administrator to change the
+ amount of RAM allocated to a kernel zone without requiring the kernel
+ zone to be rebooted. Memory LZR is enabled for a kernel zone if both of
+ the following requirements are met:
+
+ 1. The host compatibility level set by host-compatible property
+ must be either native or level2 or the memlzr modifier must
+ be used.
+
+ 2. Either pagesize-policy or memory-reserve property of the
+ capped-memory resource must be set.
+
+
+
+ The amount of RAM must be a multiple of the page size used by the ker-
+ nel zone. You can find out the page size for a running kernel zone
+ using the kstat2 command:
+
+
+ # kstat2 kstat:/zones/mykz/memory/usage:pagesize
+ kstat:/zones/mykz/memory/usage
+ pagesize 2147483648 bytes
+
- Using this MRP service and its corresponding zonecfg property is the
- recommended way to ensure kernel zones are able to allocate the memory
- they need to boot. MRP configured on target hosts can also be used to
- guarantee successful live migration.
CPU Configuration
As described in zonecfg(8), virtual CPU and dedicated CPU resources,
@@ -472,7 +523,7 @@
non-default pset, the kernel zone sets a number of virtual CPU
threads to the number of CPUs in the pset. The virtual CPU threads
will use CPUs of the pset but these CPUs can be shared with other
- threads bound to the same pset running on the same physical host.
+ threads bound to the same pset running on the physical host.
However, if the pool is associated with the default pset, it is
equivalent to not setting the pool property at all.
@@ -485,40 +536,40 @@
dedicated-cpu resource.
However, such configurations usually lead to sub-optimal system
- performance and in general should be avoided. That is because CPUs
- reserved by the dedicated-cpu resource are either not fully uti-
- lized because of a smaller number of virtual CPU threads, or the
- system suffers from overhead caused by mapping the greater number
- of virtual CPU threads to a smaller set of CPUs reserved via the
- dedicated-cpu resource.
+ performance and in general should be avoided as CPUs reserved by
+ the dedicated-cpu resource are either not fully utilized because of
+ a smaller number of virtual CPU threads, or the system suffers from
+ overcommit caused by mapping a greater number of virtual CPU
+ threads to a smaller set of CPUs reserved via the dedicated-cpu
+ resource.
- Using a range for dedicated-cpu resource is not recommended. The number
- of virtual CPUs created for a kernel zone is fixed at the time the ker-
- nel zone is booted. For a dedicated-cpu zone with an ncpu range, the
- number of CPUs can be anywhere in the range. If or when more CPUs are
- automatically added to the zone's pset, the kernel zone will be unable
- to use the CPUs causing them to sit idle. When CPUs are automatically
- removed from the zone's pset, the guest can become severely overcommit-
- ted, that is, more virtual CPUs than CPUs, resulting in poor perfor-
- mance.
+ Using a range for the dedicated-cpu resource is not recommended. The
+ number of virtual CPUs created for a kernel zone is fixed at the time
+ the kernel zone is booted. For a zone with the dedicated-cpu ncpus
+ property set to a range, the number of CPUs lie anywhere in the range.
+ If more CPUs are automatically added to the zones pset, the kernel zone
+ will be unable to use the CPUs causing them to sit idle. If CPUs are
+ automatically removed from the zones pset, the guest can become severe-
+ ly overcommitted, that is, with more virtual CPUs than physical CPUs,
+ resulting in poor performance.
Suspend, Resume, and Warm Migration
- Kernel zones may be suspended to disk by the zoneadm suspend command.
- The running state of the zone is written to the disk. As this includes
- the entire RAM used by the zone, this can take a significant amount of
- time and space.
+ Kernel zones may be suspended by executing the zoneadm suspend command.
+ The running state of the zone is written to the device or file speci-
+ fied in the suspend resource. As this includes the entire RAM used by
+ the zone, this can take a significant amount of time and space.
Suspend and resume are supported for a kernel zone only if it has a
- suspend resource in its configuration. Within a suspend resource, the
- path or storage (but not both) must be specified. The path property
- specifies the name of a file that will contain the suspend image. The
- directory containing the file must exist and be writable by the root
- user. Any file system that is mounted prior to the start of svc:/sys-
- tem/zones:default may be used. The storage property specifies the stor-
- age URI (see suri(7)) of a disk device that will contain the suspend
+ suspend resource in its configuration. Within a suspend resource,
+ either the path or storage properties must be specified. The path prop-
+ erty specifies the name of a file that will contain the suspend image.
+ The directory containing the file must exist and be writable by the
+ root user. Any file system that is mounted prior to the start of
+ svc:/system/zones:default may be used. The storage property specifies
+ the storage URI (see suri(7)) of a device that will contain the suspend
image. The whole device will be used. This device may not be shared
with anything else.
@@ -539,12 +590,12 @@
boot -R option can be used to boot afresh if a resume is not desired.
- If the suspend image and the rest of the zone's storage is accessible
- by multiple hosts (typically by using suspend:storage and device:stor-
- age properties), the suspend image can be used to support warm migra-
- tion via the zoneadm migrate command in zoneadm(8) by using zoneadm
- suspend before the migration. This will avoid any zone startup cost on
- the destination host, excluding the time spent to resume.
+ If the suspend image and the zone's storage is accessible by multiple
+ hosts (by using suspend:storage and device:storage properties), the
+ suspend image can be used to support warm migration via the
+ zoneadm migrate command in zoneadm(8) by using zoneadm suspend before
+ the migration. This will avoid any zone startup cost on the destination
+ host, excluding the time spent to resume.
Warm migration does not check for compatibility between the source and
@@ -555,37 +606,48 @@
ported for live and cold migration.
+ Note: on x86 platforms, live reconfiguration of the virtual-cpu
+ resource is disabled after the kernel zone has been resumed or has been
+ warm or live migrated. To re-enable live reconfiguration of the vir-
+ tual-cpu resource, the kernel zone must be rebooted.
+
+
The source and the destination host must be the same platform. On x86,
the vendor (AMD/Intel) as well as the CPU model name must match. On
SPARC, the hardware platform must be the same. For example, you cannot
warm migrate from a T4 host to a T5 host. If you want to migrate
- between different hardware platforms, you need to specify migration
- class in cpu-arch property appropriately.
+ between different hardware platforms, you must specify the appropriate
+ migration class in the cpu-arch property.
+
+
+ The migration classes for SPARC platforms are:
+ generic kernel zones can be migrated between SPARC plat-
+ forms T4 and newer.
- The possible migration classes on SPARC platforms are:
- generic kernel zone can perform a CPU-type independent
- migration, but not to a system older than T4.
+ migration-class1 kernel zones can be migrated between SPARC T4,
+ SPARC T5, SPARC M5, SPARC M6, SPARC M7, SPARC T7,
+ SPARC S7, SPARC T8, and SPARC M8 series platforms.
- migration-class1 kernel zone can perform cross-CPU type migration
- between SPARC T4, SPARC T5, SPARC M5, SPARC M6,
- SPARC M7, SPARC T7, and SPARC S7.
+ migration-class2 kernel zones can be migrated between SPARC T7,
+ SPARC M7, SPARC S7, SPARC T8, and SPARC M8 series
+ platforms.
- sparc64-class1 kernel zone can perform cross-CPU type migration
- between Fujitsu M10 and Fujitsu SPARC M12.
+ sparc64-class1 kernel zones can be migrated between Fujitsu M10
+ and Fujitsu SPARC M12 platforms.
If no value is set, the kernel zone's CPU migration class is the same
- as the host. It can migrate between CPU types that is compatible of
- host CPU class.
+ as the host and can migrate between platforms compatible with the hosts
+ CPU class.
Note that the kernel zone's CPU migration class cannot exceed the limit
- of host's CPU class.
+ of the hosts CPU class.
Also note that performance counters are not available when cpu-arch is
@@ -594,7 +656,7 @@
The possible migration classes on Intel platforms are:
- migration-class1 kernel zone can perform cross-CPU type migration
+ migration-class1 A kernel zone can perform cross-CPU type migration
between CPUs of Nehalem or later micro architec-
tures. Features supported by this class are: sse,
sse2, sse3, sse4.1, sse4.2, ssse, cx8, cx16, pdcm,
@@ -603,42 +665,42 @@
sysc, nx-bit, long-mode.
- migration-class2 kernel zone can perform cross-CPU type migration
+ migration-class2 A kernel zone can perform cross-CPU type migration
between CPUs of Westmere or later micro architec-
tures. Features supported by this class are: all
features supported by migration-class1 and
pclmulqdq, aes, 1g-page.
- migration-class3 kernel zone can perform cross-CPU type migration
+ migration-class3 A kernel zone can perform cross-CPU type migration
between CPUs of Sandy Bridge or later micro archi-
tectures. Features supported by this class are: all
features supported by migration-class2 and xsave,
avx.
- migration-class4 kernel zone can perform cross-CPU type migration
+ migration-class4 A kernel zone can perform cross-CPU type migration
between CPUs of Ivy Bridge or later micro architec-
tures. Features supported by this class are: all
features supported by migration-class3 and f16c,
rdrand, efs.
- migration-class5 kernel zone can perform cross-CPU type migration
+ migration-class5 A kernel zone can perform cross-CPU type migration
between CPUs of Haswell or later micro architec-
tures. Features supported by this class are: all
features supported by migration-class4 and fma,
movbe, bmi1, bmi2, avx2, lzcnt.
- migration-class6 kernel zone can perform cross-CPU type migration
+ migration-class6 A kernel zone can perform cross-CPU type migration
between CPUs of Broadwell or later micro architec-
tures. Features supported by this class are: all
features supported by migration-class5 and rdseed,
adx, prfchw.
- migration-class7 kernel zone can perform cross-CPU type migration
+ migration-class7 A kernel zone can perform cross-CPU type migration
between CPUs of Sky Lake or later micro architec-
tures. Features supported by this class are: all
features supported by migration-class6 along with
@@ -646,7 +708,7 @@
clwb.
- migration-class8 kernel zone can perform cross-CPU type migration
+ migration-class8 A kernel zone can perform cross-CPU type migration
between CPUs of Ice Lake or later micro architec-
tures. Features supported by this class are: all
features supported by migration-class7 and includes
@@ -666,38 +728,39 @@
If no value is set, the kernel zone can migrate between CPUs of the
- same micro architecture or exact same type, if micro architecture can-
- not be recognized.
+ same micro architecture or exact same type if the micro architecture
+ cannot be determined.
- Also, besides migration class you may need to specify host compatibil-
- ity level in host-compatible property to make sure the hardware fea-
- tures supported by the version of Oracle Solaris running on source and
- target host match.
+ Also, besides migration class you may need to specify the host compati-
+ bility level in the host-compatible property to make sure the hardware
+ features supported by the version of Oracle Solaris running on source
+ and target host systems match.
On resume, the current configuration of the zone is used to boot and to
allow specifying a new configuration. However, there are restrictions,
as the resuming zone is expecting a particular setup. Any incompatibil-
- ities will cause boot to fail. For example, the boot process might fail
- if:
+ ities may cause the kernel zone to fail to resume or boot, such as:
o The CPU supports different features (for example, see
- cpuid(4D))
+ cpuid(4D)).
- o The configuration has a different capped-memory value
+ o The configuration has incompatible capped-memory or page-
+ size-policy values.
- o The configuration defines different number of virtual CPUs
+ o The configuration defines a different number of virtual
+ CPUs.
- o A disk is missing (no device resource with a suitable id
- property)
+ o A storage device is missing (no device resource with a suit-
+ able id property).
o A virtual NIC is missing (no net or anet resource with a
- suitable id property)
+ suitable id property).
@@ -754,7 +817,7 @@
panicked The zone is in running state, but the zone has pan-
- icked and the host is not affected.
+ icked.
migrating-out The zone is fully running, but is being live migrated
@@ -767,11 +830,12 @@
no-config The zone is known to the system, but its configuration
- is missing. State of the zone is always incomplete.
+ is missing and the state of the zone is marked incom-
+ plete.
Host Data
- Each of a kernel zone's bootable devices contains state information
+ Each of a kernel zones bootable devices contains state information
known as host data. This data keeps track of where a zone is in use, if
it is suspended, and other state information. Host data is encrypted
and authenticated with AES-128-CCM, using the same encryption key used
@@ -867,6 +931,7 @@
anet (with exceptions stated below)
+ capped-memory:physical
device
ib-vhca
ib-vhca:port
@@ -885,7 +950,7 @@
anet:evs
anet:vport
capped-cpu (zone.cpu-cap)
- capped-memory
+ capped-memory (with an exception stated above)
cpu-shares (zone.cpu-shares)
dedicated-cpu
hostid
@@ -911,19 +976,19 @@
in the live configuration will be refused.
- Live reconfiguration of the virtual-cpu resource is enabled for a ker-
- nel zone with virtual NUMA topology only until the zone is first sus-
- pended. After resuming the zone, the virtual-cpu live reconfiguration
- is disabled for the zone until it reboots. Kernel zones without the
- virtual NUMA topology are not affected by this limitation.
-
-
Changes made to anet and net properties supported for solaris-kz brand
should be for the same media type.
- There are specific defaults for properties supported for solaris-kz
- brand as listed below:
+ On x86 hosts live reconfiguration of the virtual-cpu resource is
+ enabled for a kernel zone until the zone is suspended or migrated (warm
+ or live). After migration or resumption, live reconfiguration of the
+ virtual-cpu resource is disabled until the kernel zone has been
+ rebooted.
+
+
+ There are defaults for specific properties for solaris-kz brand zones
+ which are defined in the SYSsolaris-kz template.
Resource Property Default Value
@@ -931,6 +996,9 @@
autoboot false
ip-type exclusive
auto-shutdown shutdown
+ capped-memory physical 4G
+ pagesize-policy largest-available
+ virtual-cpu ncpus 4
net configure-allowed-address true
anet mac-address auto
lower-link auto
@@ -992,4 +1060,4 @@
-Oracle Solaris 11.4 01 Aug 2021 solaris-kz(7)
+Oracle Solaris 11.4 5 Mar 2022 solaris-kz(7)
diff -NurbBw 11.4.42/man7/solaris.7 11.4.45/man7/solaris.7
--- 11.4.42/man7/solaris.7 2022-05-17 14:50:24.856719589 -0700
+++ 11.4.45/man7/solaris.7 2022-05-17 14:51:07.217145189 -0700
@@ -34,6 +34,7 @@
anet:mac
ib-vhca
ib-vhca:port
+ capped-memory:pagesize
capped-memory:pagesize-policy
diff -NurbBw 11.4.42/man7/solaris10.7 11.4.45/man7/solaris10.7
--- 11.4.42/man7/solaris10.7 2022-05-17 14:50:24.899201170 -0700
+++ 11.4.45/man7/solaris10.7 2022-05-17 14:51:07.263574932 -0700
@@ -65,6 +65,7 @@
anet:mac
ib-vhca
ib-vhca:port
+ capped-memory:pagesize
capped-memory:pagesize-policy
@@ -161,6 +162,50 @@
attached with zoneadm attach. For more information, see examples 4 and
5.
+ Network Firewall
+ Oracle Solaris 11.4 introduces the PF firewall, to replace the IPFilter
+ network firewall (legacy firewall). See the firewall(7) man page.
+
+
+ If your solaris10 branded zone uses the legacy firewall, the legacy
+ configuration data remains intact in the /etc/ipf directory.
+
+
+ The first time you boot a solaris10 branded zone on Oracle Solaris
+ 11.4, the zone boot process creates pf.conf configuration file in the
+ /etc/firewall directory. The transition process does not attempt to
+ convert the legacy firewall configuration to use the PF firewall rules.
+ The initial pf.conf configuration file is made syntactically invalid to
+ force the firewall service into the maintenance state. After you add
+ the rules that you want to the pf.conf file, remove the delete-me line.
+ For information about using the pf.conf file to configure the PF fire-
+ wall, see the pf.conf(7) man page.
+
+
+ The first boot of a solaris10 zone also updates the legacy svc:/net-
+ work/ipfilter service to use the PF firewall. From within the zone, the
+ svc:/network/ipfilter SMF service manages the PF firewall.
+
+
+ The PF firewall uses "capture links" to log packets on behalf of log
+ action in firewall rule. See the dladm(8) man page. When booted, a
+ solaris10 branded zone creates a default pflog0 capture link for packet
+ logging. Each time you halt or shut down the zone, the pflog0 link is
+ destroyed. Note that you can access the capture link only from within a
+ global zone and not from within the solaris10 branded zone itself.
+
+
+ To save packets that are logged by a solaris10 branded zone, you must
+ configure and enable the pflogd service instance in the global zone.
+ The following example shows how to configure and enable the pflogd ser-
+ vice for the zone1 solaris10 branded zone:
+
+
+ global$ pflogd -C zone1 -i zone1/pflog0 -f /var/log/firewall/zone1.pkt
+ global$ svcadm enable svc:/network/firewall/pflog:s10
+
+
+
Cold Migration
solaris10 branded zones can be cold migrated to compatible hosts by
using the zoneadm migrate command, as described in the zoneadm(8) man
@@ -361,12 +406,13 @@
+-----------------------------+-----------------------------------+
SEE ALSO
- archiveadm(8), attributes(7), brands(7), zfs(8), zlogin(1), zoneadm(8),
- zonecfg(8), zonename(1), zones(7)
+ zlogin(1), zonename(1), attributes(7), brands(7), firewall(7),
+ pf.conf(7), solaris-kz(7), zones(7), archiveadm(8), dladm(8), zfs(8),
+ zoneadm(8), zonecfg(8)
NOTES
This feature might be removed in a future release of Oracle Solaris.
-Oracle Solaris 11.4 6 Mar 2020 solaris10(7)
+Oracle Solaris 11.4 10 Jan 2022 solaris10(7)
diff -NurbBw 11.4.42/man7/sysattr.7 11.4.45/man7/sysattr.7
--- 11.4.42/man7/sysattr.7 1969-12-31 16:00:00.000000000 -0800
+++ 11.4.45/man7/sysattr.7 2022-05-17 14:51:07.296040530 -0700
@@ -0,0 +1,411 @@
+Standards, Environments, Macros, Character Sets, and miscellany
+ sysattr(7)
+
+
+
+NAME
+ sysattr - extended system attributes
+
+DESCRIPTION
+ The extended file attributes described in fsattr(7) provide a way to
+ store additional information about objects in the file system. System
+ attributes are a subset of extended file attributes defined by the
+ operating system, and which may have semantics provided or enforced by
+ the operating system or file system. System attributes are stored in
+ extended attribute files named SUNWattr_ro and SUNWattr_rw.
+
+ Attributes
+ The following system attributes are currently defined. All of them are
+ supported on ZFS filesystems. A subset are supported on tmpfs filesys-
+ tems.
+
+
+ Each system attribute defines a data type for its value and only values
+ of that type are valid for it. See the fgetattr(3C) manual page for
+ detailed data type information for each attribute.
+
+ appendonly
+
+ Boolean that if set allows a file to be modified only at offset
+ EOF. Attempts to modify a file at a location other than EOF fail
+ with EPERM.
+
+ The {PRIV_FILE_FLAG_SET} privilege is required to set this
+ attribute and all privileges are required to clear it.
+
+ This attribute is supported on both ZFS and tmpfs filesystems.
+
+
+ archive
+
+ Boolean that if set indicates a file has been modified since it was
+ last backed up. Whenever the modification time (mtime) of a file is
+ changed the archive attribute is set.
+
+ The owner of the file or any user with "write_attributes" permis-
+ sion or the {PRIV_FILE_OWNER} privilege has the ability to modify
+ this value.
+
+
+ av_modified
+
+ Boolean that ZFS sets whenever a file's content or size changes or
+ when the file is renamed to let anti-virus software know the file
+ needs to be rescanned. When a file is successfully scanned and
+ found to be clean, vscand(8) will reset the file's modified
+ attribute.
+
+ The {PRIV_FILE_FLAG_SET} privilege is required to set this
+ attribute and all privileges are required to clear it.
+
+
+ av_quarantined
+
+ Boolean that anti-virus software sets to mark a file as quaran-
+ tined. Attempts to read(2) or rename(2) an infected file will fail
+ with EACCES being returned as the errno.
+
+ The {PRIV_FILE_FLAG_SET} privilege is required to set this
+ attribute and all privileges are required to clear it. It may only
+ be set on regular files.
+
+
+ av_scanstamp
+
+ An opaque attribute composed of up to 32 bytes of data, which is
+ set after a file has been scanned by vscand(8). ZFS has no seman-
+ tics associated with the attribute, it just saves it for the vscan
+ service.
+
+ The {PRIV_FILE_FLAG_SET} privilege is required to set this
+ attribute and all privileges are required to clear it. It may only
+ be set on regular files.
+
+
+ crtime
+
+ Timestamp when a file is created. The owner of the file or any user
+ with "write_attributes" permission or the {PRIV_FILE_OWNER} privi-
+ lege has the ability to modify this value.
+
+
+ fsid
+
+ Read-only integer file system id. The value is determined at mount
+ time and cannot be set by an application.
+
+
+ gen
+
+ Read-only integer generation id. The value is determined by ZFS and
+ cannot be set by an application.
+
+
+ groupsid
+
+ SMB group id, used by the SMB server.
+
+
+ hidden
+
+ Boolean that if set marks a file as hidden. Oracle Solaris allows
+ the attribute to be set but it only has meaning in the context of a
+ SMB server.
+
+ The owner of the file or any user with "write_attributes" permis-
+ sion or the {PRIV_FILE_OWNER} privilege has the ability to modify
+ this value.
+
+ This attribute is supported on both ZFS and tmpfs filesystems.
+
+
+ immutable
+
+ Boolean that if set prevents the content of a file from being modi-
+ fied. Also prevents all metadata changes, except for access time
+ updates. When placed on a directory, prevents the deletion and cre-
+ ation of files in the directory. Attempts to modify the content of
+ a file or directory marked as immutable fail with EPERM. Attempts
+ to modify any attributes (with the exception of access time and,
+ with the proper privileges, the immutable attribute) of a file
+ marked as immutable fails with EPERM.
+
+ The {PRIV_FILE_FLAG_SET} privilege is required to set this
+ attribute and all privileges are required to clear it.
+
+ This attribute is supported on both ZFS and tmpfs filesystems.
+
+
+ nodump
+
+ Boolean that may be used by backup software to determine if a file
+ should be skipped when making backups.
+
+ The {PRIV_FILE_FLAG_SET} privilege is required to set this
+ attribute and all privileges are required to clear it.
+
+ This attribute is supported on both ZFS and tmpfs filesystems.
+
+
+ noretain
+
+ Boolean that if set prevents a file from being retained. It is
+ automatically set by the SMB and NFS servers for special files that
+ are not user-managed and it may not be set by applications.
+
+
+ nounlink
+
+ Boolean that if set prevents a file from being deleted. On a direc-
+ tory, the attribute also prevents any changes to the contents of
+ the directory. That is, no files within the directory can be
+ removed or renamed. The errno EPERM is returned when attempting to
+ unlink or rename files and directories that are marked as nounlink.
+
+ The {PRIV_FILE_FLAG_SET} privilege is required to set this
+ attribute and all privileges are required to clear it.
+
+ This attribute is supported on both ZFS and tmpfs filesystems.
+
+
+ offline
+
+ Boolean that may be set to indicate that the contents of the file
+ may not be immediately available.
+
+ The owner of the file or any user with "write_attributes" permis-
+ sion or the {PRIV_FILE_OWNER} privilege has the ability to modify
+ this value.
+
+
+ opaque
+
+ Read-only boolean value. Oracle Solaris has no special semantics
+ for this attribute. Attempts to set this will fail with EPERM.
+
+
+ ownersid
+
+ SMB owner id, used by the SMB server.
+
+
+ readonly
+
+ Boolean that if set marks a file as read-only. Once a file is
+ marked as readonly the content of the file cannot be modified.
+ Other metadata for the file can still be modified. This attribute
+ can be set on directories but it has no semantic meaning. All
+ attempts to modify the content of the file will fail with EPERM.
+
+ The owner of the file or any user with "write_attributes" permis-
+ sion or the {PRIV_FILE_OWNER} privilege has the ability to modify
+ this value. It may only be set on regular files.
+
+ This attribute is supported on both ZFS and tmpfs filesystems.
+
+
+ reparse_point
+
+ Boolean that if set marks a symbolic link as containing a namespace
+ redirection, such as an NFS referral, instead of a normal filesys-
+ tem path. This attribute is automatically set when creating a link
+ with the appropriate syntax. The nfsref(8) command should be used
+ to operate on reparse points used as NFS referrals.
+
+ The {PRIV_FILE_FLAG_SET} privilege is required to set this
+ attribute and all privileges are required to clear it.
+
+
+ rtime
+
+ Timestamp for the end of a file's retention period, if the File
+ Retention feature of ZFS is in use. See the File Retention and
+ retention.policy sections in the zfs(8) manual page.
+
+ The owner of the file or any user with "write_attributes" permis-
+ sion or the {PRIV_FILE_OWNER} privilege has the ability to set this
+ value. It may only be set on regular files. It cannot be set on
+ files that already have the noretain attribute set.
+
+
+ sensitive
+
+ Boolean that if set marks a file as containing "sensitive" content.
+ Some utilities may take different actions if this is set. For exam-
+ ple, pfedit(1) does not record the contents or content changes of
+ files with this attribute set.
+
+ The {PRIV_FILE_FLAG_SET} privilege is required to set this
+ attribute and all privileges are required to clear it.
+
+ This attribute is supported on both ZFS and tmpfs filesystems.
+
+
+ sparse
+
+ Boolean that if set indicates that a file can be interpreted as
+ sparse. It does not indicate whether or not the file is actually
+ sparse and it has no special semantics on the Oracle Solaris oper-
+ ating system. The sparse attribute will be cleared if the file is
+ truncated to zero length.
+
+ The owner of the file or any user with "write_attributes" permis-
+ sion or the {PRIV_FILE_OWNER} privilege has the ability to modify
+ this value.
+
+
+ system
+
+ Oracle Solaris systems have no special semantics for this boolean
+ attribute. It is provided for use by SMB clients.
+
+ The owner of the file or any user with "write_attributes" permis-
+ sion or the {PRIV_FILE_OWNER} privilege has the ability to modify
+ this value.
+
+ This attribute is supported on both ZFS and tmpfs filesystems.
+
+
+ Shell-level API
+ The following utilities handle extended system attributes specifically,
+ in addition to support they may have for generic extended attributes
+ listed on the fsattr(7) manual page. Many of these commands treat sys-
+ tem attributes as a separate case from general extended attributes, and
+ require the -/ option to operate on system attributes. See the individ-
+ ual manual pages for details.
+
+ chmod(1)
+
+ The S system attribute specifier allows setting and clearing bool-
+ ean system attributes on the target file.
+
+
+ compress(1)
+
+ The -/ option causes compress and uncompress to copy system
+ attributes from the source file to the target file.
+
+
+ cp(1)
+
+ By default, cp ignores attributes and copies only file data. This
+ is intended to maintain the semantics implied by cp currently,
+ where attributes (such as owner and mode) are not copied unless the
+ -p option is specified. With the -/ (or -p) option, cp attempts to
+ copy system attributes along with the file data.
+
+
+ cpio(1)
+
+ The -/ option causes cpio to archive or extract system attributes.
+
+
+ ls(1)
+
+ The ls -/ option displays boolean system attribute information for
+ each file.
+
+ The ls -% option displays timestamp system attribute information
+ for each file.
+
+
+ pax(1)
+
+ The -/ option causes pax to archive or extract system attributes.
+
+
+ pkg(1)
+
+ The sysattr attribute in a pkg(7) manifest causes system attributes
+ to be set on files delivered by IPS packages.
+
+
+ tar(1)
+
+ The -/ option causes tar to archive or extract system attributes.
+
+
+ touch(1)
+
+ The -R option causes touch to set the rtime system attribute.
+
+
+ Application-level API
+ The following interfaces are available. For full details on each, see
+ the respective manual page. Applications that wish to retrieve or mod-
+ ify system attributes should include the header file <attr.h> which
+ defines the interfaces below.
+
+
+ The getattrat(3C) function obtains system attribute information about a
+ specified file path.
+
+
+ The fgetattr(3C) function obtains system attribute information about an
+ open file object.
+
+
+ The setattrat(3C) function updates the attributes for a specified file
+ path.
+
+
+ The fsetattr(3C) function updates the attributes for an open file
+ object.
+
+ pathconf() functionality
+ Two variables have been added to pathconf(2) to provide enhanced sup-
+ port for extended attribute manipulation.
+
+
+ The SATTR_ENABLED variable allows an application to determine if system
+ attribute support is currently enabled for the file in question.
+ Filesystems may choose not to support system attributes for certain
+ object types (e.g. .zfs).
+
+
+ The SATTR_EXISTS variable allows an application to determine whether
+ there are any system attributes associated with the supplied path.
+
+
+ The XATTR_EXISTS check has been modified to return 0 if the only
+ extended attributes associated with the supplied path are system
+ attributes.
+
+SEE ALSO
+ chmod(1), compress(1), cp(1), cpio(1), ls(1), pax(1), pfedit(1),
+ pkg(1), tar(1), touch(1), acl(2), chmod(2), chown(2), fcntl(2), futi-
+ mens(2), mmap(2), open(2), pathconf(2), read(2), rename(2), rmdir(2),
+ unlink(2), utime(2), utimensat(2), utimes(2), write(2), fgetattr(3C),
+ fsetattr(3C), getattrat(3C), setattrat(3C), tmpfs(4FS), zfs(4FS),
+ fsattr(7), pkg(7), nfsref(8), vscand(8), zfs(8)
+
+HISTORY
+ System attributes were added in the Oracle Solaris 11.0.0 release,
+ along with support for them on ZFS filesystems.
+
+
+ Support for system attributes on tmpfs filesystems was added in the
+ Oracle Solaris 11.4.0 release.
+
+
+ Support for specific attributes was first added in the listed Oracle
+ Solaris release:
+
+
+ +-------------------------------------------------+---------+
+ | NAME |RELEASE |
+ +-------------------------------------------------+---------+
+ |noretain, rtime |11.4.45 |
+ +-------------------------------------------------+---------+
+ |sensitive |11.2.0 |
+ +-------------------------------------------------+---------+
+ |appendonly, archive, av_modified, av_scanstamp, |11.0.0 |
+ |av_quarantined, crtime, fsid, gen, groupsid, | |
+ |hidden, immutable, nodump, nounlink, offline, | |
+ |opaque, ownersid, readonly, reparse_point, | |
+ |sparse, system | |
+ +-------------------------------------------------+---------+
+
+
+
+Oracle Solaris 11.4 21 Mar 2022 sysattr(7)
diff -NurbBw 11.4.42/man8/format.8 11.4.45/man8/format.8
--- 11.4.42/man8/format.8 2022-05-17 14:50:24.930330519 -0700
+++ 11.4.45/man8/format.8 2022-05-17 14:51:07.346506828 -0700
@@ -84,7 +84,8 @@
mode, format does not initially expect the input of a disk selec-
tion number. The user must specify the current working disk with
the -d disk-name option when format is invoked, or specify disk
- and the disk selection number in the command-file.
+ and the disk selection number in the command-file. The last command
+ in the command-file should be quit or q.
-l log-file
@@ -247,6 +248,19 @@
Label the disk with a new eight character volume name.
+EXIT STATUS
+ The following exit values are returned:
+
+ 0 Successful completion.
+
+
+ >0 An error occurred. A non-zero exit status is also returned in
+ case format encounters EOF while reading input, e.g., if it is
+ terminated with ^D instead of quit or q in interactive mode or,
+ in the case of non-interactive mode (option -f), if the command
+ file does not end with a quit or q command.
+
+
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
diff -NurbBw 11.4.42/man8/ldapclient.8 11.4.45/man8/ldapclient.8
--- 11.4.42/man8/ldapclient.8 2022-05-17 14:50:24.985319494 -0700
+++ 11.4.45/man8/ldapclient.8 2022-05-17 14:51:07.391654842 -0700
@@ -535,10 +535,10 @@
attribute. In the example,
- serviceSearchDescriptor=passwd:ou=people,dc=a1,dc=acme,dc=com?one
+ serviceSearchDescriptor=passwd:ou=people,dc=a1,dc=example,dc=com?one
the LDAP client would do a one level search in ou=peo-
- ple,dc=a1,dc=acme,dc=com rather than ou=people,defaultSearchBase
+ ple,dc=a1,dc=example,dc=com rather than ou=people,defaultSearchBase
for the passwd service.
@@ -696,7 +696,7 @@
example# ldapclient genprofile -a profileName=myprofile \
- -a defaultSearchBase=dc=eng,dc=sun,dc=com \
+ -a defaultSearchBase=dc=eng,dc=example,dc=com \
-a "defaultServerList=172.16.100.1 172.16.234.15:386" \
> myprofile.ldif
@@ -711,8 +711,8 @@
example# ldapclient genprofile -a profileName=eng \
-a credentialLevel=proxy \
-a authenticationMethod=sasl/DIGEST-MD5 \
- -a defaultSearchBase=dc=eng,dc=acme,dc=com \
- -a "serviceSearchDescriptor=passwd:ou=people,dc=a1,dc=acme,dc=com?one"\
+ -a defaultSearchBase=dc=eng,dc=example,dc=com \
+ -a "serviceSearchDescriptor=passwd:ou=people,dc=a1,dc=example,dc=com?one"\
-a preferredServerList= '['fe80::a00:20ff:fea3:388']' \
-a "defaultServerList='['fec0::111:a00:20ff:fea3:edcf']' \
'['fec0::111:a00:20ff:feb5:e41']'" > eng.ldif
@@ -730,8 +730,8 @@
example# ldapclient genprofile -a profileName=eng \
-a credentialLevel=proxy -a authenticationMethod=sasl/DIGEST-MD5 \
-a bindTimeLimit=20 \
- -a defaultSearchBase=dc=eng,dc=acme,dc=com \
- -a "serviceSearchDescriptor=passwd:ou=people,dc=a1,dc=acme,dc=com?one"\
+ -a defaultSearchBase=dc=eng,dc=example,dc=com \
+ -a "serviceSearchDescriptor=passwd:ou=people,dc=a1,dc=example,dc=com?one"\
-a serviceAuthenticationMethod=pam_ldap:tls:simple \
-a defaultSearchScope=sub \
-a attributeMap=passwd:uid=employeeNumber \
@@ -907,4 +907,4 @@
-Oracle Solaris 11.4 5 Nov 2021 ldapclient(8)
+Oracle Solaris 11.4 9 Mar 2022 ldapclient(8)
diff -NurbBw 11.4.42/man8/mount_nfs.8 11.4.45/man8/mount_nfs.8
--- 11.4.42/man8/mount_nfs.8 2022-05-17 14:50:25.068721153 -0700
+++ 11.4.45/man8/mount_nfs.8 2022-05-17 14:51:07.427692010 -0700
@@ -303,9 +303,9 @@
quota | noquota
Enable or prevent quota(8) to check whether the user is over
- quota on this file system; if the file system has quotas
- enabled on the server, quotas are still checked for operations
- on this file system.
+ quota on this file system; if the file system has quota enabled
+ on the server, quota(8) checks a file system only if the quota
+ mount option is also set on the NFS client.
remount
@@ -743,4 +743,4 @@
-Oracle Solaris 11.4 26 Jul 2021 mount_nfs(8)
+Oracle Solaris 11.4 1 Feb 2022 mount_nfs(8)
diff -NurbBw 11.4.42/man8/nscd.8 11.4.45/man8/nscd.8
--- 11.4.42/man8/nscd.8 2022-05-17 14:50:25.152712146 -0700
+++ 11.4.45/man8/nscd.8 2022-05-17 14:51:07.461206710 -0700
@@ -66,7 +66,7 @@
o svc:/network/ldap/client:default, see ldapclient(8)
- o svc:/network/dns/multicast:default, see mdns(8)
+ o svc:/network/dns/multicast:default, see mdnsd(8)
@@ -299,7 +299,7 @@
hosts(5), netmasks(5), networks(5), nscd.conf(5), nsswitch.conf(5),
passwd(5), prof_attr(5), project(5), protocols(5), resolv.conf(5),
rpc(5), services(5), user_attr(5), ypfiles(5), attributes(7), ldap(7),
- getent(8), ldapclient(8), mdns(8), svcadm(8), svccfg(8), ypbind(8)
+ getent(8), ldapclient(8), mdnsd(8), svcadm(8), svccfg(8), ypbind(8)
NOTES
You can use the svcadm command to perform administrative actions on
diff -NurbBw 11.4.42/man8/quota.8 11.4.45/man8/quota.8
--- 11.4.42/man8/quota.8 2022-05-17 14:50:25.194705961 -0700
+++ 11.4.45/man8/quota.8 2022-05-17 14:51:07.488859417 -0700
@@ -15,15 +15,20 @@
quota without options only display warnings about mounted file systems
- where usage is over quota. Remotely mounted file systems which do not
- have quotas turned on are ignored.
+ where usage is over quota. Remotely mounted file systems which are not
+ mounted with the quota option or do not have quotas turned on are
+ ignored. See mount_nfs(8).
username can be the numeric UID of a user.
+
+ quota only checks NFS filesystems which are explicitly mounted with the
+ quota mount option.
+
OPTIONS
- -v Display user's quota on all mounted file systems where quotas
- exist.
+ -v Display user's quota on all mounted file systems not mounted with
+ noquota where quotas exist.
FILES
@@ -42,7 +47,7 @@
SEE ALSO
attributes(7), privileges(7), zones(7), edquota(8), quotacheck(8), quo-
- taon(8), repquota(8), rquotad(8)
+ taon(8), repquota(8), rquotad(8), mount_nfs(8)
NOTES
quota displays quotas for NFS mounted UFS- or ZFS-based file systems if
@@ -63,4 +68,4 @@
-Oracle Solaris 11.4 3 Nov 2021 quota(8)
+Oracle Solaris 11.4 1 Feb 2022 quota(8)
diff -NurbBw 11.4.42/man8/share_smb.8 11.4.45/man8/share_smb.8
--- 11.4.42/man8/share_smb.8 2022-05-17 14:50:25.251398684 -0700
+++ 11.4.45/man8/share_smb.8 2022-05-17 14:51:07.521381523 -0700
@@ -458,7 +458,7 @@
SEE ALSO
getnetbyname(3C), netgroup(5), attributes(7), idmap(8), share(8),
- zfs(8), zfs(8)
+ zfs(8), zfs_share(8)
diff -NurbBw 11.4.42/man8/sxadm.8 11.4.45/man8/sxadm.8
--- 11.4.42/man8/sxadm.8 2022-05-17 14:50:25.331778783 -0700
+++ 11.4.45/man8/sxadm.8 2022-05-17 14:51:07.560972879 -0700
@@ -62,18 +62,25 @@
process level extensions. See EXECUTABLE TAGGED EXTENSIONS.
- Security extensions restrict an application, providing defenses that
- constrain borderline behavior. As a consequence, some existing applica-
- tions may fail, or experience a performance degradation, when security
- extensions are applied. Generally, newer defenses are more likely to
- cause application failure. Over time, as a class of protection becomes
- more mainstream, programming practices are influenced, and failures due
- to applying security extensions diminish.
+ Some security extensions restrict an application, providing defenses
+ that constrain borderline behavior. As a consequence, some existing
+ applications may fail, or experience a performance degradation, when
+ security extensions are applied. Generally, newer defenses are more
+ likely to cause application failure. Over time, as a class of protec-
+ tion becomes more mainstream, programming practices are influenced, and
+ failures due to applying security extensions diminish.
+
+
+ Some security extensions may affect performance, by enabling additional
+ checks or reducing the usage of certain caches and buffers. System
+ administrators may need to choose between performance and security
+ depending on the requirements of their environment.
SECURITY EXTENSIONS
- The following security extensions are available. These extensions
- reduce the chances of attackers finding known entry points, or planting
- exploitation code in locations that can later be executed.
+ The following security extensions are available. These extensions may
+ reduce the chances of attackers finding known entry points, planting
+ exploitation code in locations that can later be executed, or taking
+ advantage of CPU implementations.
ADIHEAP - ADI based protections for heap allocators
@@ -198,9 +205,9 @@
vulnerabilities.
KPTI is always enabled and can not be disabled on SPARC systems.
- KPTI is enabled by default on Intel systems. A reboot is required
- on Intel systems after enabling or disabling KPTI for the changes
- to take effect.
+ KPTI is enabled by default on x86 systems. A reboot is required on
+ x86 systems after enabling or disabling KPTI for the changes to
+ take effect.
L1DF - Level 1 Data Cache Flush
@@ -765,7 +772,7 @@
+-----------------------------+-----------------------------+
SEE ALSO
- ld(1), exec(2), sx_enabled(3c), adi(7), attributes(7)
+ ld(1), exec(2), sx_enabled(3C), adi(7), attributes(7)
Oracle ILOM Administrator's Guide for Configuration and Maintenance
@@ -816,4 +823,4 @@
-Oracle Solaris 11.4 21 Jun 2021 sxadm(8)
+Oracle Solaris 11.4 9 Mar 2022 sxadm(8)
diff -NurbBw 11.4.42/man8/vmstat.8 11.4.45/man8/vmstat.8
--- 11.4.42/man8/vmstat.8 2022-05-17 14:50:25.377606915 -0700
+++ 11.4.45/man8/vmstat.8 2022-05-17 14:51:07.592151196 -0700
@@ -6,7 +6,7 @@
vmstat - report virtual memory statistics
SYNOPSIS
- vmstat [-ipqQsSw] [-T u | d] [disks] [interval [count]]
+ vmstat [-ikpqQsSw] [-T u | d] [disks] [interval [count] [start_time]]
DESCRIPTION
vmstat reports virtual memory statistics regarding kernel thread, vir-
@@ -108,22 +108,43 @@
Refer the examples section for sample outputs
+ -k Fall back to use the kstat(8) interfaces as the source of
+ data. By default, the source of data is sstored(8)
+
+
OPERANDS
The following operands are supported:
- count Specifies the number of times that the statistics are
- repeated. count does not apply to the -i and -s options.
+ count Displays count operand reports only. Note that the count
+ operand does not apply to the -i and -s options.
+
+
+ disks Specifies which disks are to be given priority in the
+ output (only four disks fit on a line). Common disk names
+ are id, sd, xd, or xy, followed by a number (for example,
+ sd2, xd0, and so forth).
+
+
+ interval Reports each interval seconds. Note that interval operand
+ does not apply to the -i and -s options.
+
+
+ start_time Specifies the time at which to start querying the statis-
+ tics. If available, sstore(1) queries historical statis-
+ tics. The time operand accepts ISO8601 extended
+ (%Y-%m-%dT%H:%M:%S) formatted times, specifically the UTC
+ or local time forms. For example:
+
- disks Specifies which disks are to be given priority in the out-
- put (only four disks fit on a line). Common disk names are
- id, sd, xd, or xy, followed by a number (for example, sd2,
- xd0, and so forth).
+ 2021-07-14T17:06:09Z (UTC time)
+ 2015-07-14T16:06:09 (assumed to be local time)
+ When you specify the start_time operand, you must also
+ specify the interval and count operands.
- interval Specifies the last number of seconds over which vmstat sum-
- marizes activity. This number of seconds repeats forever.
- interval does not apply to the -i and -s options.
+ Note that the start_time does not apply to the -i, -s,
+ and -k options.
EXAMPLES
@@ -301,6 +322,31 @@
+ Example 5 vmstat viewing historical data
+
+
+
+ The following example shows how to create a report that contains his-
+ torical statistics since 2021-September-27 06:11:04+05:30. The statis-
+ tics are output every second for ten times.
+
+
+ example% vmstat 1 10 2021-09-27T6:11:04+5:30
+ kthr memory page disk faults cpu
+ r b w swap free re mf pi po fr de sr vc -- -- -- in sy cs us sy id
+ 0 0 0 3226613 1208475 1 1 0 0 0 0 0 0 0 0 0 464 87 382 0 0 100
+ 0 0 0 3602720 1587608 0 0 0 0 0 0 0 0 0 0 0 518 304 464 0 0 100
+ 2 0 0 3602720 1587608 0 0 0 0 0 0 0 0 0 0 0 485 305 400 0 0 100
+ 0 0 0 3602720 1587608 0 0 0 0 0 0 0 0 0 0 0 510 307 384 0 0 100
+ 0 0 0 3602720 1587608 0 0 0 0 0 0 0 0 0 0 0 501 306 420 0 0 100
+ 1 0 0 3602720 1587608 0 0 0 0 0 0 0 0 0 0 0 522 317 433 0 0 99
+ 1 0 0 3602720 1587608 0 0 0 0 0 0 0 0 0 0 0 511 311 412 0 0 100
+ 0 0 0 3602720 1587608 0 0 0 0 0 0 0 0 0 0 0 471 303 382 0 0 100
+ 1 0 0 3602720 1587608 0 0 0 0 0 0 0 0 0 0 0 502 308 413 0 0 100
+ 0 0 0 3602720 1587608 0 0 0 0 0 0 0 0 0 0 0 470 302 396 0 0 100
+
+
+
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
@@ -331,4 +377,4 @@
-Oracle Solaris 11.4 04 Jan 2021 vmstat(8)
+Oracle Solaris 11.4 14 Jul 2021 vmstat(8)
diff -NurbBw 11.4.42/man8/zfs.8 11.4.45/man8/zfs.8
--- 11.4.42/man8/zfs.8 2022-05-17 14:50:25.545178528 -0700
+++ 11.4.45/man8/zfs.8 2022-05-17 14:51:07.665397719 -0700
@@ -129,6 +129,9 @@
zfs rename share share
+ zfs retained [-PMeuanr] [-A | -f | [-p] -o field[,...]] filesystem
+
+
zfs rollback [-rRf] snapshot
@@ -153,39 +156,39 @@
filesystem@snapname|volume@snapname
- zfs unmount [-f] -a | filesystem|mountpoint
+ zfs unallow [-rldug] everyone|user|group[,...] [perm|@setname[,... ]]
+ filesystem|volume
- zfs unshare filesystem|mountpoint|filesystem%share
+ zfs unallow [-rld] -e [perm|@setname[,... ]] filesystem|volume
- zfs unshare -a| -r filesystem|
+ zfs unallow [-r] -c [perm|@setname[ ... ]] filesystem|volume
- zfs upgrade
+ zfs unallow [-r] -s @setname [perm|@setname[,... ]] filesystem|volume
- zfs upgrade [-v]
+ zfs unmount [-f] -a | filesystem|mountpoint
- zfs upgrade [-r] [-V version] -a | filesystem
+ zfs unshare filesystem|mountpoint|filesystem%share
- zfs userspace [-hniHp] [-o field[,...]] [-sS field] ...
- [-t type [,...]] filesystem|snapshot
+ zfs unshare -a | -r filesystem
- zfs unallow [-rldug] everyone|user|group[,...] [perm|@setname[,... ]]
- filesystem|volume
+ zfs upgrade
- zfs unallow [-rld] -e [perm|@setname[,... ]] filesystem|volume
+ zfs upgrade [-v]
- zfs unallow [-r] -c [perm|@setname[ ... ]] filesystem|volume
+ zfs upgrade [-r] [-V version] -a | filesystem
- zfs unallow [-r] -s @setname [perm|@setname[,... ]] filesystem|volume
+ zfs userspace [-hniHp] [-o field[,...]] [-sS field] ...
+ [-t type [,...]] filesystem|snapshot
DESCRIPTION
The zfs command configures ZFS datasets within a ZFS storage pool, as
@@ -356,6 +359,26 @@
For a full description of ZFS encryption and the ZFS encryption syntax,
see zfs_encrypt(8).
+ File Retention
+ File retention protects a file from being altered or deleted for a
+ specified period of time. After that time has passed, the file may only
+ be deleted. File retention is only available for regular files.
+
+
+ A filesystem may have retention enabled by setting the retention.policy
+ property. This can only be enabled during filesystem creation.
+
+
+ The period for which a file is retained may be specified in touch -R or
+ using touch -a to set the atime into the future prior to making the
+ file read-only. If neither of these is used, the file is retained for
+ the retention.period.default.
+
+
+ Files on a filesystem with retention enabled are retained by setting
+ the retention time via touch -R, by removing all write permissions, or
+ by setting the readonly file attribute.
+
Native Properties
Properties are divided into two types, native properties and user-
defined (or user) properties. Native properties either provide internal
@@ -1304,6 +1327,102 @@
For more information, see zfs_encrypt(8).
+ retention.policy=off | privileged | mandatory
+
+ This controls whether file retention is enabled for the given
+ filesystem. It may only be set during filesystem create and is
+ read-only thereafter.
+
+ off
+
+ File retention is disabled.
+
+
+ privileged
+
+ File retention is enabled. A process with the FILE_RETEN-
+ TION_OVERRIDE privilege can delete a retained file or change
+ its retention time backwards, but cannot modify the file's con-
+ tents. The filesystem and its containing pool are not protected
+ from destruction.
+
+
+ mandatory
+
+ File retention is enabled. No privilege, including those held
+ by root, can allow for a retained file to be deleted until the
+ retention has expired. A retained file's contents cannot be
+ changed. Its retention timestamp may be changed forward, but
+ cannot be changed backwards. The filesystem and its containing
+ pool are protected from destruction until the last retention
+ timestamp has expired.
+
+
+
+ retention.period.min=timeinterval
+ retention.period.max=timeinterval
+
+ These values constrain the range of time for which a file may be
+ retained. The retention.period.default may not be less than reten-
+ tion.period.min or greater than retention.period.max. A retention
+ time specified with touch -a or touch -R that is less than reten-
+ tion.period.min will be increased to retention.period.min and one
+ that is greater than retention.period.max will be decreased to
+ retention.period.max.
+
+ Retention period values must be less than 100 years.
+
+
+
+ retention.period.default=timeinterval
+
+ This value is used as the retention period for a file when no time
+ was specified using touch prior to retention.
+
+ Retention period values must be less than 100 years.
+
+
+ retention.period.grace=timeinterval
+
+ The retention grace period controls automatic file retention. If it
+ is set to zero seconds, automatic retention is disabled. If it is
+ set to a period greater than zero seconds, automatic retention is
+ enabled. Once a file has remained unmodified for that non-zero
+ grace period it is automatically retained for the period specified
+ by retention.period.default.
+
+ On mandatory retention filesystems, once automatic retention is
+ enabled, it cannot be turned off. That is, the grace period value,
+ once changed from zero to a positive integer, cannot be set back to
+ zero. Further, on mandatory retention filesystems, the grace period
+ value may never be increased, but may be reduced with a minimum of
+ 1 second.
+
+ On privileged retention filesystems, the grace period value may be
+ adjusted as desired.
+
+ Retention period values must be less than 100 years.
+
+
+ retention.status.expiry
+
+ The latest-expiring retention timestamp of a file is shown by this
+ read-only filesystem property. If that time has passed, the prop-
+ erty will also display (expired) indicating that all file reten-
+ tions have expired.
+
+
+ retention.status.files
+
+ A count of retained files is shown by this read-only filesystem
+ property. This count increases when a file is retained. It does not
+ change when a file's retention expires; it is only reduced when a
+ retained file is deleted. This count does not reflect files which
+ auto-retention hasn't yet retained yet, but those will be included
+ on their next access.
+
+
+
Temporary Mount Point Properties
When a file system is mounted, either through the legacy mount(8) com-
mand or the zfs mount command, its mount options are set according to
@@ -1324,7 +1443,7 @@
In addition, these options can be set on a per-mount basis using the -o
option, without affecting the property that is stored on disk. The val-
ues specified on the command line override the values stored in the
- dataset. The -nosuid option is an alias for nodevices,nosetuid. These
+ dataset. The nosuid option is an alias for nodevices,nosetuid. These
properties are reported as temporary by the zfs get command. If the
properties are changed while the dataset is mounted, the new setting
overrides any temporary settings. If the property being modified is the
@@ -2176,6 +2295,8 @@
zfs send -R -[iI]), destroy snapshots and file systems that do
not exist on the sending side.
+ This is not allowed on mandatory retention filesystems.
+
-n
@@ -2285,9 +2406,9 @@
Renaming root dataset is not allowed. The root dataset can only be
renamed by renaming the pool, which will rename the root dataset to
- the new pool name. Use zpool export <pool> command and then zpool
- import <pool> <newpoolname> command to rename the root dataset to
- the new pool name.
+ the new pool name. Use zpool export pool command and then zpool
+ import pool newpoolname command to rename the root dataset to the
+ new pool name.
-p
@@ -2310,6 +2431,69 @@
Renames the specified share to a new share name.
+ zfs retained [-PMeuanr] [-A | -f | [-p] -o field[,...]] filesystem
+
+ Lists the files retained in the specified filesystem.
+
+ -P/-M
+
+ The -P and -M options select whether privileged (-P) or manda-
+ tory (-M) retention datasets are shown. If neither option is
+ included, all are shown.
+
+
+ -e/-u
+
+ These options select whether expired (-e) or unexpired (-u)
+ retention files are shown. If neither option is included, all
+ are shown.
+
+
+ -a/-n
+
+ These options select whether automatic (-a) or non-automatic
+ (-n) retention datasets are included. If neither option is
+ included, all are shown.
+
+
+ -r
+
+ If the -r option is included, all descendent datasets with
+ retained files are also displayed.
+
+
+ -A
+
+ If the -A option is included, retained files are listed includ-
+ ing file information - mode, system attributes, crtime, mtime,
+ ctime, rtime, uid, gid, then filename. Output fields are space-
+ delimited with any spaces or backslashes preceded by a back-
+ slash (e.g. file "a b c" would be shown as "a\ b\ c").
+
+
+ -f
+
+ If the -f option is included, only the filenames are shown,
+ with no dataset name, retention properties, or timestamps.
+
+
+ -p
+
+ Display the list of retained files in the pool specified using
+ a stable machine-parseable format. For more information, see
+ 'Parseable Output Format', below.
+
+
+ -o field[,...]
+
+ Display the specified field(s) in parseable format. Available
+ fields are dataset, policy, automatic, mountpoint, filename,
+ object, mode, sysattrs, size, uid, gid, crtime, mtime, ctime,
+ rtime, and expired.
+
+
+
+
zfs rollback [-rRf] snapshot
Rolls back the given dataset to a previous snapshot. When a dataset
@@ -2325,6 +2509,8 @@
recursive snapshot, you must rollback the individual child snap-
shots.
+ Datasets with mandatory retention policy may not be rolled back.
+
-r
Recursively destroys any snapshots more recent than the one
@@ -2344,8 +2530,8 @@
- zfs send [-vbpnC] [-[Rr[c]]] [-w compress|none] [-D [-m <memsize>]]
- [-[iI] <snapshot>] [-s <subopt>] <snapshot>
+ zfs send [-vbpnC] [-[Rr[c]]] [-w compress|none] [-D [-m memsize]]
+ [-[iI] snapshot] [-s subopt] snapshot
Creates a stream representation of the second snapshot, which is
written to standard output. The output can be redirected to a file
@@ -2532,7 +2718,7 @@
default argument, when the -w option is not specified.
- -m <memsize>
+ -m memsize
Limits the amount of memory used by deduplication processing to
the value specified in bytes, kbytes, mbytes, or gbytes by
@@ -2803,6 +2989,20 @@
+ Parseable Output Format
+ The zpool retained command provides a -p option that displays output in
+ a machine-parseable format. The output format is one or more lines of
+ colon (:) delimited fields. Output includes only those fields requested
+ by means of the -o option, in the order requested.
+
+
+ When you request multiple fields, any literal colon characters are
+ escaped by a backslash (\) before being output. Similarly, literal
+ backslash characters are also escaped (\\). This escape format is
+ parseable by using shell read(1) functions with the environment vari-
+ able set as IFS=:. Note that escaping is not done when you request only
+ a single field.
+
EXAMPLES
Example 1 Creating a ZFS File System Hierarchy
@@ -3237,15 +3437,21 @@
SEE ALSO
chmod(1), chown(1), gzip(1), pktool(1), setlabel(1), ssh(1), chmod(2),
chown(2), stat(2), write(2), fsync(3C), setflabel(3TSOL), dfstab(5),
- vfstab(5), attributes(7), datasets(7), filesystem(7), mount(8), shad-
- owd(8), share(8), share_nfs(8), share_smb(8), unshare(8), zfs_allow(8),
- zfs_encrypt(8), zfs_share(8), zonecfg(8), zpool(8)
+ vfstab(5), attributes(7), datasets(7), filesystem(7), sysattr(7),
+ mount(8), shadowd(8), share(8), share_nfs(8), share_smb(8), unshare(8),
+ zfs_allow(8), zfs_encrypt(8), zfs_share(8), zonecfg(8), zpool(8)
For information about other ZFS features, see zfs_allow(8),
zfs_encrypt(8), zfs_share(8), and the Managing ZFS File Systems in Ora-
cle Solaris 11.4 book.
+WARNINGS
+ Files in filesystems with mandatory retention that are retained but the
+ retention has not yet expired will prevent destruction of their con-
+ taining filesystem. There is no privilege which will allow this to be
+ overridden
+
NOTES
A file described as modified by the diff subcommand might have been
modified in multiple ways. Any action that causes a change in the
@@ -3253,4 +3459,4 @@
-Oracle Solaris 11.4 23 Sep 2021 zfs(8)
+Oracle Solaris 11.4 21 Mar 2022 zfs(8)
diff -NurbBw 11.4.42/man8/zoneadm.8 11.4.45/man8/zoneadm.8
--- 11.4.42/man8/zoneadm.8 2022-05-17 14:50:25.636623797 -0700
+++ 11.4.45/man8/zoneadm.8 2022-05-17 14:51:07.735981017 -0700
@@ -787,6 +787,10 @@
If -r is specified, reboot the zone. See the boot subcommand for
supported boot options.
+ Do not use the shutdown command on a newly installed zone that is
+ not yet configured. Instead, use the zoneadm halt command to force
+ a shutdown of the zone.
+
zoneadm savecore [-k] [-L] [-f dumpfile]
@@ -1804,4 +1808,4 @@
-Oracle Solaris 11.4 8 Oct 2021 zoneadm(8)
+Oracle Solaris 11.4 15 Nov 2021 zoneadm(8)
diff -NurbBw 11.4.42/man8/zonecfg.8 11.4.45/man8/zonecfg.8
--- 11.4.42/man8/zonecfg.8 2022-05-17 14:50:25.709452104 -0700
+++ 11.4.45/man8/zonecfg.8 2022-05-17 14:51:07.872259527 -0700
@@ -112,8 +112,8 @@
capped-memory
Limits for physical, swap, and locked memory. Optionally specify
- pagesize-policy or memory-reserve for physical memory of solaris-kz
- brand zone.
+ pagesize, pagesize-policy or memory-reserve for physical memory of
+ solaris-kz brand zone.
dataset
@@ -466,7 +466,7 @@
capped-memory
- physical, swap, locked, pagesize-policy, memory-reserve
+ physical, swap, locked, pagesize, pagesize-policy, memory-reserve
capped-cpu
@@ -786,6 +786,10 @@
level1 The level1 level includes the ADI, DAX, and VA Mask fea-
tures.
+
+ level2 The level2 level includes all features in level1 plus the
+ Memory Live Zone Reconfiguration feature.
+
If no value is set, the default kernel zone's host compatibility
level will only include features supported in Oracle Solaris 11.2.
@@ -801,8 +805,13 @@
The possible compatibility level modifiers are:
- adi Enables ADI feature and can only be used with default com-
- patibility level.
+ adi Enables ADI feature and can only be used with default
+ compatibility level.
+
+
+ memlzr Enables Memory Live Zone Reconfiguration feature. It can
+ only be used with the level1 or the default compatibility
+ levels.
The generic syntax for this property is:
@@ -1669,7 +1678,11 @@
virtual-cpus: ncpus
Specify the number of virtual CPUs configured for a solaris-kz
- brand zone. See the solaris-kz(7) man page.
+ brand zone.
+
+ Note: live reconfiguration of ncpus is disabled on certain plat-
+ forms if the kernel zone has been resumed or migrated. See the
+ solaris-kz(7) man page.
attr: name, type, value
@@ -3809,4 +3822,4 @@
-Oracle Solaris 11.4 29 Nov 2021 zonecfg(8)
+Oracle Solaris 11.4 28 Feb 2022 zonecfg(8)
diff -NurbBw 11.4.42/man8/zpool.8 11.4.45/man8/zpool.8
--- 11.4.42/man8/zpool.8 2022-05-17 14:50:25.767554039 -0700
+++ 11.4.45/man8/zpool.8 2022-05-17 14:51:07.971264301 -0700
@@ -49,7 +49,7 @@
[-S section[,...]] [-s all | field[,...]]
- zpool import [-d path ... |-c cachefile] [-D] [-F [-n]] <pool | id>
+ zpool import [-d path ... |-c cachefile] [-D] [-F [-n]] pool|id
zpool import [-o mntopts] [-o property=value] ... [-d path ... |
@@ -71,7 +71,8 @@
zpool label [-d path ... | -c cachefile] -R ...
- zpool list [-H] [-o property[,...]] [-T d|u ] [pool] ... [interval[count]]
+ zpool list [-H] [-o property[,...]] [-T d|u] [pool] ...
+ [interval [count]]
zpool monitor -t provider [-T d|u] [[-p] -o field[,...]] [pool] ...
@@ -96,14 +97,17 @@
zpool replace [-f] pool device [new_device]
+ zpool retained [-euanr] [-A | -f | [-p] -o field[,...]] [pool] ...
+
+
zpool scrub [-s] pool ...
zpool set property=value pool
- zpool split [-n [-l]] [-R altroot] [-o mntopts] [-o property=value] pool
- newpool [device ...]
+ zpool split [-n [-l]] [-R altroot] [-o mntopts] [-o property=value]
+ pool newpool [device ...]
zpool status [-S section[,...]] [-s all | field[,...]]
@@ -792,6 +796,22 @@
shortened column name, listsnaps.
+ retainedfilesystems
+
+ Displays a count of filesystems within this pool that have manda-
+ tory retention and retained files. This count does not decrease
+ when file retentions expire, but only when a mandatory retention
+ filesystem is destroyed.
+
+
+ retentionexpiry
+
+ Displays the latest/last retention timestamp of mandatory retention
+ filesystems in this pool. If that time has passed, the property
+ will also display (expired) indicating that all file retentions
+ have expired.
+
+
scrubinterval=manual | timeinterval
When scrubinterval is set to manual, scrub scheduling is disabled.
@@ -1308,8 +1328,8 @@
-S section[,...]]
A comma-separated list of sections to display. The list of sta-
- tus sections available are: pool, id, state, scan, config,
- dedup, errors.
+ tus sections available are: pool, id, state, retained, scan,
+ config, dedup, errors.
Without -S option all available sections will be displayed.
@@ -1409,7 +1429,7 @@
- zpool import [-d path ... |-c cachefile] [-D] [-F [-n]] <pool | id>
+ zpool import [-d path ... |-c cachefile] [-D] [-F [-n]] pool|id
zpool import [-o mntopts] [ -o property= value] ... [-d path ... |
-c cachefile] [-D] [-f] [-m] [-N] [-R root] [-F [-n]] [-l] [-t tmp-
pool] pool | id [newpool]
@@ -1543,7 +1563,7 @@
- zpool label [-d path ... | -c cachefile] -C <pool | id> [device]
+ zpool label [-d path ... | -c cachefile] -C pool|id [device]
Clears ZFS pool metadata on a specified inactive pool to make its
device(s) available for use in new pools or by other filesystems.
@@ -1567,14 +1587,14 @@
- zpool label -C <device>
+ zpool label -C device
Clears ZFS pool metadata on a specified device. A device must be
specified by using its full path and name. The device must not be a
part of an active pool, otherwise an error message is printed out.
- zpool label [-d path ... | -c cachefile] -R <pool | id> [device]
+ zpool label [-d path ... | -c cachefile] -R pool|id [device]
This is an undo operation for the zpool label -C command. It recov-
ers ZFS metadata for a specific pool and, if enough of the pool's
@@ -1601,7 +1621,7 @@
- zpool label -R <device>
+ zpool label -R device
Recovers all recoverable ZFS pool metadata found on specified
device. A device must be specified using its full path and name.
@@ -1771,6 +1791,65 @@
+ zpool retained [-euanr] [-A | -f | [-p] -o field[,...]] [pool]
+
+ Lists the mandatory retention filesystems with retained files in
+ the specified pool. If no pools are specified, then all pools with
+ filesystems with mandatory retention are shown.
+
+ -e/-u
+
+ These options select whether expired (-e) or unexpired (-u)
+ retention datasets and files are shown. If neither option is
+ included, all are shown.
+
+
+ -a/-n
+
+ These options select whether automatic (-a) or non-automatic
+ (-n) retention datasets are included. If neither option is
+ included, all are shown.
+
+
+ -r
+
+ If the -r option is included, all retained files within those
+ mandatory retention filesystems are also displayed.
+
+
+ -A
+
+ If the -A option is included, retained files are listed includ-
+ ing file information - mode, system attributes, crtime, mtime,
+ ctime, rtime, uid, gid, then filename. Output fields are space-
+ delimited with any spaces or backslashes preceded by a back-
+ slash (e.g. file "a b c" would be shown as "a\ b\ c").
+
+
+ -f
+
+ If the -f option is included, only the filenames are shown,
+ with no pool name, dataset name, retention properties, or time-
+ stamps. -f implies -r.
+
+
+ -p
+
+ Display the list of retained files in the pool using a stable
+ machine-parseable format. For more information, see 'Parseable
+ Output Format', below. -p implies -r.
+
+
+ -o field[,...]
+
+ Display the specified field(s) in parseable format. Available
+ fields are dataset, policy, automatic, mountpoint, filename,
+ object, mode, sysattrs, size, uid, gid, crtime, mtime, ctime,
+ rtime, and expired.
+
+
+
+
zpool scrub [-s] pool ...
Begins a scrub. The scrub examines all data in the specified pools
@@ -1816,6 +1895,9 @@
mirror vdev unless overridden by a device specification on the com-
mand line.
+ Pools cannot be split if they contain mandatory retention filesys-
+ tems.
+
When using a device argument, split includes the specified
device(s) in a new pool and, should any devices remain unspecified,
assigns the last device in each mirror vdev to that pool, as it
@@ -1895,8 +1977,8 @@
-S section[,...]]
A comma-separated list of sections to display. The list of sta-
- tus sections available are: pool, id, state, scan, config,
- dedup, errors.
+ tus sections available are: pool, id, state, retained, scan,
+ config, dedup, errors.
Without -S option all available sections will be displayed.
@@ -2045,12 +2127,10 @@
Parseable Output Format
- The "zpool monitor" command provides a -p option that displays output
- in a machine-parsable format. The output format is one or more lines of
- colon (:) delimited fields. Output includes only those fields requested
- by means of the -o option, in the order requested. Note that the -o
- all option, which displays all the fields cannot be used with parsable
- output option.
+ The zpool monitor and zpool retained commands provide a -p option that
+ displays output in a machine-parseable format. The output format is one
+ or more lines of colon (:) delimited fields. Output includes only those
+ fields requested by means of the -o option, in the order requested.
When you request multiple fields, any literal colon characters are
@@ -2683,35 +2763,7 @@
-
- Example 24 Shortening The syntax of vdevs
-
-
-
- The following example shows how to shorten the syntax of vdevs to be
- included in a pool by using {}.
-
-
-
- # zpool create tank raidz2 /test/c{1,2,3,4,5}disk
- root@vboxrf:/test# zpool status tank
- pool: tank
- state: ONLINE
- scan: none requested
- config:
-
- NAME STATE READ WRITE CKSUM
- tank ONLINE 0 0 0
- raidz2-0 ONLINE 0 0 0
- /test/c1disk ONLINE 0 0 0
- /test/c2disk ONLINE 0 0 0
- /test/c3disk ONLINE 0 0 0
- /test/c4disk ONLINE 0 0 0
- /test/c5disk ONLINE 0 0 0
-
-
-
- Example 25 Removing a raidz Data Device
+ Example 24 Removing a raidz Data Device
@@ -2783,7 +2835,7 @@
- Example 26 Removing a non-redundant Data Device and a meta device
+ Example 25 Removing a non-redundant Data Device and a meta device
@@ -2872,7 +2924,7 @@
- Example 27 Changing the pool guid of an existing pool
+ Example 26 Changing the pool guid of an existing pool
@@ -2931,14 +2983,20 @@
the new size of the LUN, and to relabel it. Instead, use the following
procedure:
- 1. Run zpool set autoexpand=on <zpool> once, and leave autoex-
- pand=on for the zpool all the time.
+ 1. Run zpool set autoexpand=on pool once, and leave autoex-
+ pand=on for the pool all the time.
+
+
+ 2. Expand the size of the LUN as desired. The pool will reflect
+ the size of the LUN automatically.
- 2. Expand the size of the LUN as desired. The zpool will
- reflect the size of the LUN automatically.
+ Files in filesystems with mandatory retention that are retained but the
+ retention has not yet expired will prevent destruction of their con-
+ taining pool and re-use of devices which are part of that pool. There
+ is no privilege which will allow this to be overridden.
NOTES
Each ZFS storage pool has an associated process, zpool-poolname, visi-
@@ -2947,4 +3005,4 @@
-Oracle Solaris 11.4 11 May 2021 zpool(8)
+Oracle Solaris 11.4 17 Jan 2022 zpool(8)
diff -NurbBw 11.4.42/man9f/ddi_cb_register.9f 11.4.45/man9f/ddi_cb_register.9f
--- 11.4.42/man9f/ddi_cb_register.9f 2022-05-17 14:50:25.807122029 -0700
+++ 11.4.45/man9f/ddi_cb_register.9f 2022-05-17 14:51:08.017994738 -0700
@@ -62,6 +62,13 @@
The flags parameter consists of the following:
+ DDI_CB_FLAG_COMM
+
+ The device driver uses pciv_send(9F) interfaces to communicate
+ across different domains or within the same domain. The driver may
+ receive callback notices that incoming data has been received.
+
+
DDI_CB_FLAG_INTR
The device driver participates in interrupt resource management.
@@ -72,30 +79,16 @@
rupt availability varies based on the overall needs of the system.
- DDI_CB_FLAG_SRIOV
-
- Indicates to the DDI framework that the device driver is IOV capa-
- ble. Normally IOV device drivers are expected to call pciv_vf_con-
- fig(9F)) to configure the VFs during attach and register callbacks
- with this flag set so that they can be informed through callback
- notices when VFs are unconfigured by the DDI framework.
-
- If the driver does not explicitly configure the VFs using
- pciv_vf_config() during attach then the PCIE framework will config-
- ure the VFs as part of the post-attach processing if this flag is
- set.
-
- The callback notices while configuring/unconfiguring is performed
- with two separate callbacks to the driver PRE and POST. This helps
- the drivers to prepare for the event during PRE and do the neces-
- sary initializations/cleanup during POST notices.
-
-
- DDI_CB_FLAG_COMM
+ DDI_CB_FLAG_IOR
- The device driver uses pciv_send(9F) interfaces to communicate
- across different domains or within the same domain. The driver may
- receive callback notices that incoming data has been received.
+ The device driver will receive I/O Resiliency events. The events
+ indicate when IOV virtual functions in the current logical domain
+ are suspended or resumed by the I/O Resiliency (IOR) feature. In
+ certain hardware configurations, the Oracle VM Server for SPARC
+ software allows IOV virtual functions to be assigned from one
+ domain to another. When a domain that owns a physical IOV device is
+ rebooted or shutdown, the IOR feature will suspend and resume any
+ IOV virtual functions that are assigned to other domains.
DDI_CB_FLAG_LSR
@@ -112,6 +105,25 @@
PCI and PCIe devices.
+ DDI_CB_FLAG_SRIOV
+
+ Indicates to the DDI framework that the device driver is IOV capa-
+ ble. Normally IOV device drivers are expected to call pciv_vf_con-
+ fig(9F)) to configure the VFs during attach and register callbacks
+ with this flag set so that they can be informed through callback
+ notices when VFs are unconfigured by the DDI framework.
+
+ If the driver does not explicitly configure the VFs using
+ pciv_vf_config() during attach then the PCIE framework will config-
+ ure the VFs as part of the post-attach processing if this flag is
+ set.
+
+ The callback notices while configuring/unconfiguring are performed
+ with two separate callbacks to the driver PRE and POST. This helps
+ the drivers to prepare for the event during PRE and do necessary
+ initializations and cleanup during POST notices.
+
+
The flags associated with a registered callback handler may be examined
or changed by the routines ddi_cb_get_flags(9F), ddi_cb_add_flags(9F),
@@ -139,251 +149,163 @@
failure while processing an action.
- For interrupt resource management, the action parameter can be one of
- the following:
-
- DDI_CB_INTR_ADD
-
- For interrupt resource management, the driver has more available
- interrupts. The driver can allocate more interrupt vectors and then
- set up more interrupt handling functions by using
- ddi_intr_alloc(9F).
-
-
- DDI_CB_INTR_REMOVE
-
- For interrupt resource management, the driver has fewer available
- interrupts. The driver must release any previously allocated inter-
- rupts in excess of what is now available by using
- ddi_intr_free(9F).
-
-
-
The cbarg parameter points to an action-specific argument. Each class
of registered actions specifies its own data structure that a callback
handler should dereference when it receives those actions.
- The cbarg parameter is defined as an integer in the case of
- DDI_CB_INTR_ADD and DDI_CB_INTR_REMOVE actions. The callback handler
- should cast the cbarg parameter to an integer. The integer represents
- how many interrupts have been added or removed from the total number
- available to the device driver.
-
-
- If a driver participates in interrupt resource management, it must reg-
- ister a callback with the DDI_CB_FLAG_INTR flag. The driver then
- receives the actions DDI_CB_INTR_ADD and DDI_CB_INTR_REMOVE whenever
- its interrupt availability has changed. The callback handler should use
- the interrupt functions ddi_intr_alloc(9F) and ddi_intr_free(9F) func-
- tions to respond accordingly. A driver is not required to allocate all
- interrupts that are available to it, but it is required to manage its
- allocations so that it never uses more interrupts than are currently
- available.
-
-
- When flags is set to DDI_CB_FLAG_SRIOV, the action parameter can be one
- of the following:
+ When flags is set to DDI_CB_FLAG_COMM, the action parameter can be:
- DDI_CB_PCIV_CONFIG_VF
+ DDI_CB_COMM_RECV Drivers are notified of incoming data described by
+ pciv_recv_event_t, which is passed as the cbarg
+ argument to the callback handler.
- The PF driver is being notified of its VF configuration request.
- The pciv_config_vf_t structure is being passed as cbarg to describe
- the configuration. The cmd field in pciv_config_vf_t indicates if
- the VFs are about to or have just been enabled or disabled.
- cbarg (when action is set to DDI_CB_PCIV_CONFIG_VF)
- pciv_config_vf_t
+ For all DDI_CB_COMM_RECV actions, the cbarg parameter points to an
+ argument of type pciv_recv_event_t, which is defined as:
typedef enum {
- PCIV_VFCFG_PARAM, /* Retrieve VF configuration parameters */
- PCIV_VF_ENABLE, /* Request to enable VFs synchronously */
- PCIV_VF_DISABLE, /* Request to disable VFs synchronously */
- PCIV_EVT_VFENABLE_PRE, /* VFs are just about to be enabled */
- PCIV_EVT_VFENABLE_POST, /* VFs have just been enabled */
- PCIV_EVT_VFDISABLE_PRE, /* VFs are just about to be disabled */
- PCIV_EVT_VFDISABLE_POST /* VFs have just been disabled */
- } pciv_vf_config_cmd_t;
-
- typedef struct pciv_config_vf {
- int version;
- pciv_vf_config_cmd_t cmd; /* pre/post VF enable/disable */
- uint16_t num_vf; /* number of VFs to be used */
- uint16_t first_vf_offset; /* offset between 1st VF & PF */
- uint16_t vf_stride; /* distance between VFs */
- boolean_t ari_cap; /* ARI capable hierarchy */
- uint32_t page_size; /* system page size */
- } pciv_config_vf_t;
-
-
-
- The cmd field in the pciv_config_vf_t informs the driver the reason for
- the callback execution. The driver can return one of the following
- codes back to the caller.
-
- DDI_SUCCESS
-
- The request was accepted and resources are properly configured.
-
-
- DDI_NOTAPPLICABLE
-
- The requested configuration is not applicable.
-
-
- DDI_REQRESET
-
- The requested configuration cannot be applied until device is reset
- (for (example, the PF hardware cannot dynamically adjust its inter-
- nal resources to satisfy the request.)
+ PCIV_EVT_READY = 0x1, /* peer side has registered the recv cb */
+ PCIV_EVT_NOT_READY, /* peer side has unregistered the recv cb */
+ PCIV_EVT_DRV_DATA, /* private driver data event */
+ PCIV_EVT_FABRIC /* PCIv framework and fabric admin event */
+ } pciv_event_type_t;
+ typedef struct pciv_recv_event {
+ pciv_event_type_t event; /* event type */
+ caddr_t buf; /* buffer address */
+ size_t nbyte; /* size of buffer */
+ uint32_t src_func; /* source function */
+ dom_id_t src_domain; /* source domain */
+ } pciv_recv_event_t;
- DDI_REQREATTACH
- The requested configuration cannot be applied unless the driver
- itself is reattached.
+ The member fields of pciv_recv_event_t are defined as:
- DDI_CB_PCIV_CLASS_CONFIG
+ event
- The PF driver is being notified of its VF Class Configuration
- changes. fciov_conf_t is being passed as cbarg to describe the
- class configuration for Fibre Channel devices. This data structure
- may change for devices other than Fibre Channel devices. Currently,
- only Fibre Channel devices are supported. The cmd field fciov_cmd_t
- indicate if the class configuration is being CONFIGURED/UNCONFIG-
- URED/UPDATED. The fciov_cfg_flags indicate which of the three class
- configuration parameters are being affected. The fci_vf_id identi-
- fies the VF.
+ Specifies which of these events occurred:
+ PCIV_EVT_READY Both local and remote end has registered its
+ event handler. The buf and nbyte fields
+ should be ignored.
+ PCIV_EVT_NOT_READY Remote end has not registered its event han-
+ dler. The buf and nbyte fields should be
+ ignored.
- cbarg (when action is set to DDI_CB_PCIV_CLASS_CONFIG)
- fciov_conf_t
- typedef struct fciov_conf {
- fciov_config_cmd_t fci_cmd; /* configuration op to be performed */
- uint16_t fci_vf_id; /* index of the VF to be configured */
- fciov_cfg_flags_t fci_flags; /* indicate which info is valid */
- uint8_t fci_node_wwn[8]; /* node WWN for the VF */
- uint8_t fci_port_wwn[8]; /* port WWN for the VF */
- uint16_t fci_bandwidth; /* percentile bandwidth for the VF */
- } fciov_conf_t;
+ PCIV_EVT_DRV_DATA Data in buf with nbyte size has been received
+ or sent. Data can only be interpreted by the
+ transmitter and receiver.
- Three commands are currently defined to configure, update or mod-
- ify, and unconfigure the attributes of a Fibre Channel SR-IOV VF.
+ PCIV_EVT_FABRIC Framework VF administration event, used
+ between framework and PF drivers for VF
+ administration purposes. Administration data
+ is stored in buf with nbyte size.
- typedef enum {
- FCIOV_VF_CONFIG = 0x1 /* Configure a FC VF */
- FCIOV_VF_UPDCONFIG = 0x2 /* Update configuration of a FC VF */
- FCIOV_VF_UNCONFIG = 0x4 /* Unconfigure a given FC VF */
- } fciov_config_cmd_t;
+ buf, nbyte
- Three commands are currently defined to configure, update the
- attributes. The following are the flags that provide the valid
- fields for a given command.
+ Incoming data is stored in a buffer of address buf with length of
+ nbyte. Not used for certain event types.
+ src_func
+ The source function number of the transmission. It is used by the
+ PF driver to identify the transmission source virtual function num-
+ ber. Besides source VF number, it can also be:
- typedef enum {
- FCIOV_NODE_WWN = 0x1 /* node WWN info is valid */
- FCIOV_PORT_WWN = 0x2 /* port WWN info is valid */
- FCIOV_BANDWIDTH = 0x4 /* bandwidth info is valid */
- } fciov_cfg_flags_t;
+ PCIV_PF Transmitter is the PF of the receiver.
- The driver can return one of the following codes back to the call-
- er.
+ PCIV_FRM Transmitter is the PCI Express framework rather than a
+ driver.
- DDI_SUCCESS
- The request was accepted and the class configuration has been suc-
- cessfully completed.
+ src_domain
+ The source domain of the transmission. It is used by PF driver to
+ identify the domain the transmission is from.
- When flags is set to DDI_CB_FLAG_COMM, the action parameter can be:
- DDI_CB_COMM_RECV Drivers are notified of incoming data described by
- pciv_recv_event_t, which is passed as the cbarg
- argument to the callback handler.
+ When flags is set to DDI_CB_FLAG_IOR, the action parameter can be one
+ of the following:
- cbarg (when action is set to DDI_CB_COMM_RECV)
- pciv_recv_event_t
+ DDI_CB_IOR_SUSPENDED Indicates that IOR has suspended an IOV virtual
+ function. The cbarg parameter points to a
+ ddi_cb_ior_t that describes the suspended
+ device.
- typedef enum {
- PCIV_EVT_READY = 0x1, /* peer side has registered the recv cb */
- PCIV_EVT_NOT_READY, /* peer side has unregistered the recv cb */
- PCIV_EVT_DRV_DATA, /* private driver data event */
- PCIV_EVT_FABRIC /* PCIv framework and fabric admin event */
- } pciv_event_type_t;
- typedef struct pciv_recv_event {
- pciv_event_type_t event; /* event type */
- caddr_t buf; /* buffer address */
- size_t nbyte; /* size of buffer */
- uint32_t src_func; /* source function */
- dom_id_t src_domain; /* source domain */
- } pciv_recv_event_t;
+ DDI_CB_IOR_RESUMED Indicates that IOR has resumed an IOV virtual
+ function. The cbarg parameter points to a
+ ddi_cb_ior_t that describes the resumed device.
- PCIV_EVT_READY
- Both local and remote end has registered its event handler. The buf
- and nbyte fields should be ignored
+ For all the IOR actions, the cbarg parameter points to an argument of
+ type ddi_cb_lsr_t, which is defined as:
+ typedef struct {
+ dev_info_t *ior_dip;
+ char ior_path[MAXPATHLEN];
+ } ddi_cb_ior_t;
- PCIV_EVT_NOT_READY
- Remote end has not registered its event handler. The buf and nbyte
- fields should be ignored
+ The member fields of ddi_cb_ior_t are defined as:
- PCIV_EVT_DRV_DATA
+ ior_dip
- Data in buf with nbyte size has been received or sent. Data can
- only be interpreted by the transmitter and receiver.
+ Pointer to the dev_info structure of the suspended/resumed device.
- PCIV_EVT_FABRIC
+ ior_path
- Framework VF administration event, used between framework and PF
- drivers for VF administration purposes. Administration data is
- stored in buf with nbyte size.
+ Full pathname of the suspended/resumed device.
- buf, nbyte
- Incoming data is stored in a buffer of address buf with length of
- nbyte. Not used for certain event types.
-
-
- src_func
-
- The source function number of the transmission. It is used by the
- PF driver to identify the transmission source virtual function num-
- ber. Besides source VF number, it can also be:
+ For interrupt resource management, the action parameter can be one of
+ the following:
- PCIV_PF Transmitter is the PF of the receiver.
+ DDI_CB_INTR_ADD More interrupts are now available. The driver can
+ allocate and use more vectors using
+ ddi_intr_alloc(9F).
- PCIV_FRM Transmitter is the PCI Express framework rather than a
- driver.
+ DDI_CB_INTR_REMOVE Fewer interrupts are now available. The driver
+ must release any previously allocated interrupts
+ in excess of what is now available by using
+ ddi_intr_free(9F).
- src_domain
+ The cbarg parameter is defined as an integer in the case of
+ DDI_CB_INTR_ADD and DDI_CB_INTR_REMOVE actions. The callback handler
+ should cast the cbarg parameter to an integer. The integer represents
+ how many interrupts have been added or removed from the total number
+ available to the device driver.
- The source domain of the transmission. It is used by PF driver to
- identify the domain the transmission is from.
+ If a driver participates in interrupt resource management, it must reg-
+ ister a callback with the DDI_CB_FLAG_INTR flag. The driver then
+ receives the actions DDI_CB_INTR_ADD and DDI_CB_INTR_REMOVE whenever
+ its interrupt availability has changed. The callback handler should use
+ the interrupt functions ddi_intr_alloc(9F) and ddi_intr_free(9F) to
+ respond accordingly. A driver is not required to allocate all inter-
+ rupts that are available to it, but it is required to manage its allo-
+ cations so that it never uses more interrupts than are currently avail-
+ able.
For Live Suspend & Resume, the action parameter can be one of the fol-
@@ -412,7 +334,7 @@
- For all the LSR actions, the cbarg parameter points to the argument of
+ For all the LSR actions, the cbarg parameter points to an argument of
the same type, ddi_cb_lsr_t, which is defined as:
typedef struct ddi_cb_lsr {
@@ -423,77 +345,84 @@
- The activities member specifies what I/O activities of the device will
- be live suspended/resumed (DDI_CB_LSR_SUSPEND and DDI_CB_LSR_RESUME),
- or the I/O activities that the device driver supports
- (DDI_CB_LSR_QUERY_CAPABILITY).
+ The member fields of ddi_cb_lsr_t are defined as:
+ activities
- For PCI/PCIe devices, the activities member in ddi_cb_lsr_t can be a
- value bit-ORed from the following:
+ Specifies what I/O activities to suspend or resume during a
+ DDI_CB_LSR_SUSPEND or DDI_CB_LSR_RESUME action, or what activities
+ the device driver can suspend as reported from the
+ DDI_CB_LSR_QUERY_CAPABILITY action. It can be a bit-ORed value of
+ the following:
- DDI_CB_LSR_ACT_DMA DMA activities
+ DDI_CB_LSR_ACT_DMA DMA activities.
- DDI_CB_LSR_ACT_PIO Programmed I/O activities
+ DDI_CB_LSR_ACT_PIO Programmed I/O activities.
- DDI_CB_LSR_ACT_INTR Interrupt activities
+ DDI_CB_LSR_ACT_INTR Interrupt activities.
- The impacts member specifies the side effects the LSR operation will
- impose on the device. For PCI/PCIe devices, it can be bit-ORed value of
- the following:
+ impacts
+
+ Specifies the side effects the LSR operation will impose on the
+ device. It can be a bit-ORed value of the following:
DDI_CB_LSR_IMP_DMA_ADDR_CHANGE
During the LSR operation, the device will undergo DMA address
- changes. The device driver should unbind and rebind the DMA buf-
- fers.
+ changes. The device driver should unbind and rebind the DMA
+ buffers.
DDI_CB_LSR_IMP_DMA_PROP_CHANGE
- During the LSR operation, the platform hardware changes may cause
- the driver's DMA transaction properties to be invalid, such as the
- lowest and highest DMA address range, DMA address alignment, DMA
- segment boundary, etc. The driver needs to destroy and reallocate
- DMA handles.
+ During the LSR operation, the platform hardware changes may
+ cause the driver's DMA transaction properties to be invalid,
+ such as the lowest and highest DMA address range, DMA address
+ alignment, DMA segment boundary, etc. The driver needs to
+ destroy and reallocate DMA handles.
DDI_CB_LSR_IMP_DEVICE_RESET
- During the LSR operation, the device will undergo device reset. The
- device driver must restore the hardware context during live resume.
+ During the LSR operation, the device will undergo device reset.
+ The device driver must restore the hardware context during live
+ resume.
DDI_CB_LSR_IMP_DEVICE_REPLACE
- During the LSR operation, the device will be replaced. The device
- driver needs to check the device identity.
+ During the LSR operation, the device will be replaced. The
+ device driver needs to check the device identity.
DDI_CB_LSR_IMP_LOSE_POWER
- During the LSR operation, the device will lose power. The device
- driver needs to restore device hardware context during live resume.
- If necessary, the driver should reload firmware.
+ During the LSR operation, the device will lose power. The
+ device driver needs to restore device hardware context during
+ live resume. If necessary, the driver should reload firmware.
DDI_CB_LSR_IMP_SURPRISE_REMOVE
- The device is surprise removed before live suspend. The device may
- be back or not before live resume. Device driver needs to check the
- device identity when live resume, and then restore device hardware
- context. If necessary, the driver should reload firmware.
+ The device is surprise removed before live suspend. The device
+ may be back or not before live resume. Device driver needs to
+ check the device identity when live resume, and then restore
+ device hardware context. If necessary, the driver should reload
+ firmware.
- The reason member is a predefined string to specify the cause of the
- LSR operation. It is used for printing purposes. There is no predefined
- string and it may be NULL for DDI_CB_LSR_SUSPEND and DDI_CB_LSR_RESUME.
- For DDI_CB_LSR_QUERY_CAPABILITY, the driver must set it to NULL.
+ reason
+
+ A predefined string that specifies the cause of the LSR operation.
+ It is used for printing purposes. There is no predefined string and
+ it may be NULL for DDI_CB_LSR_SUSPEND and DDI_CB_LSR_RESUME. For
+ DDI_CB_LSR_QUERY_CAPABILITY, the driver must set it to NULL.
+
The driver's implementation should make the LSR operation transparent
@@ -516,10 +445,191 @@
cases, returning in milliseconds should be acceptable while returning
in seconds is not.
+
+ When flags is set to DDI_CB_FLAG_SRIOV, the action parameter can be one
+ of the following:
+
+ DDI_CB_PCIV_CONFIG_VF The PF driver is being notified of a VF
+ configuration request. The cbarg parameter
+ points to a pciv_config_vf_t that describes
+ the request.
+
+
+ DDI_CB_PCIV_CLASS_CONFIG The PF driver is being notified of VF class
+ configuration changes. The cbarg parameter
+ points to a fciov_conf_t that describes the
+ class configuration. This action is only
+ for Fibre Channel devices.
+
+
+
+ For all DDI_CB_PCIV_CONFIG_VF actions, the cbarg parameter points to an
+ argument of type pciv_recv_event_t, which is defined as:
+
+ typedef enum {
+ PCIV_VFCFG_PARAM, /* Retrieve VF configuration parameters */
+ PCIV_VF_ENABLE, /* Request to enable VFs synchronously */
+ PCIV_VF_DISABLE, /* Request to disable VFs synchronously */
+ PCIV_EVT_VFENABLE_PRE, /* VFs are just about to be enabled */
+ PCIV_EVT_VFENABLE_POST, /* VFs have just been enabled */
+ PCIV_EVT_VFDISABLE_PRE, /* VFs are just about to be disabled */
+ PCIV_EVT_VFDISABLE_POST /* VFs have just been disabled */
+ } pciv_vf_config_cmd_t;
+
+ typedef struct pciv_config_vf {
+ int version;
+ pciv_vf_config_cmd_t cmd;
+ uint16_t num_vf;
+ uint16_t first_vf_offset;
+ uint16_t vf_stride;
+ boolean_t ari_cap;
+ uint32_t page_size;
+ } pciv_config_vf_t;
+
+
+
+ The member fields of pciv_config_vf_t are defined as:
+
+ version
+
+ Specifies current version of the callback protocol.
+
+
+ cmd
+
+ Specifies the reason for the callback:
+
+ PCIV_VFCFG_PARAM Retrieve supported VF configuration
+ parameters from the the device driver.
+
+
+ PCIV_VF_ENABLE Request to enable VFs synchronously.
+
+
+ PCIV_VF_DISABLE Request to disable VFs synchronously.
+
+
+ PCIV_EVT_VFENABLE_PRE Preliminary event to prepare to enable
+ VFs.
+
+
+ PCIV_EVT_VFENABLE_POST Concluding event after enabling VFs.
+
+
+ PCIV_EVT_VFDISABLE_PRE Preliminary event to prepare to disable
+ VFs.
+
+
+ PCIV_EVT_VFDISABLE_POST Concluding event after disabling VFs.
+
+
+
+ num_vf
+
+ Indicates the number of VFs to be used.
+
+
+ first_vf_offset
+
+ Specifies the offset between PF and first VF.
+
+
+ vf_stride
+
+ Specifies the offset distance between each VF.
+
+
+ ari_cap
+
+ Specifies if Alternative Routing IDs (ARI) are supported.
+
+
+ page_size
+
+ Specifies the system memory page size.
+
+
+
+ For all DDI_CB_PCIV_CLASS_CONFIG actions, the cbarg parameter points to
+ an argument of type fciov_conf_t, which is defined as:
+
+ typedef enum {
+ FCIOV_VF_CONFIG = 0x1, /* Configure a FC VF */
+ FCIOV_VF_UPDCONFIG = 0x2, /* Update configuration of a FC VF */
+ FCIOV_VF_UNCONFIG = 0x4 /* Unconfigure a FC VF */
+ } fciov_config_cmd_t;
+
+ typedef enum {
+ FCIOV_NODE_WWN = 0x1, /* Node WWN information is valid */
+ FCIOV_PORT_WWN = 0x2, /* Port WWN information is valid */
+ FCIOV_BANDWIDTH = 0x4 /* Bandwidth information is valid */
+ } fciov_cfg_flags_t;
+
+ typedef struct fciov_conf {
+ fciov_config_cmd_t fci_cmd;
+ uint16_t fci_vf_id;
+ fciov_cfg_flags_t fci_flags;
+ uint8_t fci_node_wwn[8];
+ uint8_t fci_port_wwn[8];
+ uint16_t fci_bandwidth;
+ } fciov_conf_t;
+
+
+
+ The member fields of fciov_conf_t are defined as follows:
+
+ fci_cmd
+
+ Specifies one of the following commands:
+
+ FCIOV_VF_CONFIG Configure the specified VF.
+
+
+ FCIOV_VF_UPDCONFIG Update or modify the specified VF.
+
+
+ FCIOV_VF_UNCONFIG Unconfigure the specified VF.
+
+
+
+ fci_vf_id
+
+ Specifies which VF is configured or unconfigured.
+
+
+ fci_flags
+
+ Flags to indicate which information is valid:
+
+ FCIOV_NODE_WWN Node WWN information is valid.
+
+
+ FCIOV_PORT_WWN Port WWN information is valid.
+
+
+ FCIOV_BANDWIDTH Bandwidth information is valid.
+
+
+
+ fci_node_wwn
+
+ Node WWN for the VF.
+
+
+ fci_port_wwn
+
+ Port WWN for the VF.
+
+
+ fci_bandwidth
+
+ Percentile bandwidth for the VF.
+
+
RETURN VALUES
The ddi_cb_register() and ddi_cb_unregister() functions return:
- DDI_SUCCESS on success
+ DDI_SUCCESS Successful completion
DDI_EINVAL An invalid parameter was given when registering a call-
@@ -532,12 +642,32 @@
- The cbfunc routine must return:
+ For DDI_CB_PCIV_CONFIG_VF and DDI_CB_PCIV_CLASS_CONFIG actions, the
+ cbfunc routine must return:
+
+ DDI_SUCCESS Successful completion
+
+
+ DDI_NOTAPPLICABLE Requested configuration is not applicable
+
- DDI_SUCCESS on success
+ DDI_REQRESET Requested configuration cannot be applied until
+ device is reset. (For example, the PF hardware
+ cannot dynamically adjust its internal resources
+ to satisfy the request.)
- DDI_ENOTSUP The device does not support the operation
+ DDI_REQREATTACH Requested configuration cannot be applied unless
+ the driver itself is reattached.
+
+
+
+ For all other actions, the cbfunc routine must return:
+
+ DDI_SUCCESS Successful completion
+
+
+ DDI_ENOTSUP Operation is not supported
DDI_FAILURE Implementation specific failure
@@ -943,12 +1074,18 @@
Participation in interrupt resource management ends when a driver uses
the ddi_cb_unregister() function to unregister its callback function.
The callback function must still operate properly until after the call
- to the ddi_cb_unregister() function completes. If addinterrupts were
- given to the driver because of its participation, then a final use of
- the callback function occurs to release the additional interrupts. The
- call to the ddi_cb_unregister() function blocks until the final use of
- the registered callback function is finished.
+ to the ddi_cb_unregister() function completes. If additional interrupts
+ were given to the driver because of its participation, then a final use
+ of the callback function occurs to release the additional interrupts.
+ The call to the ddi_cb_unregister() function blocks until the final use
+ of the registered callback function is finished.
+
+
+ Users of these interfaces that register for DDI_CB_FLAG_IOR events are
+ advised to call ddi_cb_register() with a dip argument for a device that
+ itself is not an IOV virtual function. Using a non-physical pseudo
+ device owned by the device driver is preferred.
-Oracle Solaris 11.4 11 May 2021 ddi_cb_register(9F)
+Oracle Solaris 11.4 3 January 2022 ddi_cb_register(9F)
diff -NurbBw 11.4.42/man9f/rwlock.9f 11.4.45/man9f/rwlock.9f
--- 11.4.42/man9f/rwlock.9f 2022-05-17 14:50:26.243693216 -0700
+++ 11.4.45/man9f/rwlock.9f 2022-05-17 14:51:08.570969254 -0700
@@ -3,9 +3,9 @@
NAME
- rwlock, rw_create, rw_init, rw_destroy, rw_enter, rw_exit, rw_tryenter,
- rw_downgrade, rw_tryupgrade, rw_read_locked - readers/writer lock func-
- tions
+ rwlock, rw_create, rw_init, rw_destroy, rw_enter, rw_enter_sig,
+ rw_exit, rw_tryenter, rw_downgrade, rw_tryupgrade, rw_read_locked -
+ readers/writer lock functions
SYNOPSIS
#include <sys/ksynch.h>
@@ -23,6 +23,9 @@
void rw_enter(krwlock_t *rwlp, krw_t enter_type);
+ int rw_enter_sig(krwlock_t *rwlp, krw_t enter_type);
+
+
void rw_exit(krwlock_t *rwlp);
@@ -144,6 +147,12 @@
threads R and W deadlock.
+ The rw_enter_sig() function is similar to rw_enter(), except it returns
+ the appropriate error number if a signal (for example, by kill(2)) is
+ sent to the thread. Where the operation is interrupted, EINTR is
+ returned.
+
+
The rw_exit() function releases the lock and may wake up one or more
threads waiting on the lock.
@@ -179,6 +188,12 @@
-1 rw_create() was not successful.
+ 0 rw_enter_sig() was successful.
+
+
+ EINTR rw_enter_sig() was interrupted.
+
+
0 rw_tryenter() could not obtain the lock without blocking.
@@ -216,4 +231,4 @@
-Oracle Solaris 11.4 27 Nov 2017 rwlock(9F)
+Oracle Solaris 11.4 21 Feb 2022 rwlock(9F)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment