mirror of https://github.com/mkerrisk/man-pages
listxattr.2: Add note on handling increases in sizes of keys or values
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
9c321ba20b
commit
a8215524ac
|
@ -171,6 +171,18 @@ To keep the code simple, the program assumes that attribute keys and
|
|||
values are constant during the execution of the program.
|
||||
A production program should expect and handle changes during
|
||||
execution of the program.
|
||||
For example,
|
||||
the number of bytes required for attribute keys
|
||||
might increase between the two calls to
|
||||
.BR listxattr ().
|
||||
An application could handle this possibility using
|
||||
a loop that retries the call
|
||||
(perhaps up to a predetermined maximum number of attempts)
|
||||
with a larger buffer each time it fails with the error
|
||||
.BR ERANGE .
|
||||
Calls to
|
||||
.BR getxattr (2)
|
||||
could be handled similarly.
|
||||
|
||||
The following output was recorded by first creating a file, setting
|
||||
some extended file attributes,
|
||||
|
|
Loading…
Reference in New Issue