getExtendedAttribute(named:buffer:)

Get the value of the named extended attribute.

FileDescriptor+Syscalls.swift:129

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

func getExtendedAttribute(named name: String, buffer: UnsafeMutableRawBufferPointer?) -> Result<Int, Errno>

Parameters

name

The name of the extended attribute.

buffer

The buffer into which the value is written. If buffer is nil then the return value is the size of the buffer required to read the value. If there is not enough space in the buffer then Errno.outOfRange is returned.

Returns

The size of the extended attribute value.

The corresponding C function is fgetxattr.