listExtendedAttributes(_:)

List the names of extended attributes.

FileDescriptor+Syscalls.swift:110

This declaration is gated by at least one @_spi attribute.

func listExtendedAttributes(_ buffer: UnsafeMutableBufferPointer<CChar>?) -> Result<Int, Errno>

Parameters

buffer

The buffer into which names are written. Names are written are NULL terminated UTF-8 strings and are returned in an arbitrary order. There is no padding between strings. If buffer is nil then the return value is the size of the buffer required to list all extended attributes. If there is not enough space in the buffer then Errno.outOfRange is returned.

Returns

The size of the extended attribute list.

The corresponding C function is flistxattr.