<commit_before>.\"
.\" Copyright (c) 2001 <NAME> <<EMAIL>>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd March 28, 2001
.Dt EXTATTR 2
.Os
.Sh NAME
.Nm extattr_get_fd ,
.Nm extattr_set_fd ,
.Nm extattr_delete_fd ,
.Nm extattr_get_file ,
.Nm extattr_set_file ,
.Nm extattr_delete_file
.Nd system calls to manipulate VFS extended attributes
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In sys/types.h
.In sys/extattr.h
.In sys/uio.h
.Ft ssize_t
.Fn extattr_get_fd "int fd" "int attrnamespace" "const char *attrname" "void *data" "size_t nbytes"
.Ft int
.Fn extattr_set_fd "int fd" "int attrnamespace" "const char *attrname" "const void *data" "size_t nbytes"
.Ft int
.Fn extattr_delete_fd "int fd" "int attrnamespace" "const char *attrname"
.Ft ssize_t
.Fn extattr_get_file "const char *path" "int attrnamespace" "const char *attrname" "void *data" "size_t nbytes"
.Ft int
.Fn extattr_set_file "const char *path" "int attrnamespace" "const char *attrname" "const void *data" "size_t nbytes"
.Ft int
.Fn extattr_delete_file "const char *path" "int attrnamespace" "const char *attrname"
.Sh DESCRIPTION
Named extended attributes are meta-data associated with vnodes
representing files and directories.
They exist as
.Qq Li name=value
pairs within a set of namespaces.
The
.Fn extattr_get_file
call retrieves the value of the specified extended attribute into
a buffer pointed to by
.Fa data
of size
.Fa nbytes .
The
.Fn extattr_set_file
call sets the value of the specified extended attribute to the data
described by
.Fa data .
The
.Fn extattr_delete_file
call deletes the extended attribute specified.
The
.Fn extattr_get_file
and
.Fn extattr_set_file
calls consume the
.Fa data
and
.Fa nbytes
arguments in the style of
.Xr read 2
and
.Xr write 2 ,
respectively.
If
.Fa data
is
.Dv NULL
in a call to
.Fn extattr_get_file
then the size of defined extended attribute data will be returned, rather
than the quantity read, permitting applications to test the size of the
data without performing a read.
.Pp
The
.Fn extatttr_get_fd ,
.Fn extattr_set_fd ,
and
.Fn extattr_delete_fd
calls are identical to their
.Qq Li _file
counterparts except for the first argument.
The
.Qq Li _fd
functions take a file descriptor, while the
.Qq Li _file
functions take a path.<commit_msg>Add brief mention of the extattr_*_link() system call variants.<commit_after>.\"
.\" Copyright (c) 2001 <NAME> <<EMAIL>>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd March 28, 2001
.Dt EXTATTR 2
.Os
.Sh NAME
.Nm extattr_get_fd ,
.Nm extattr_set_fd ,
.Nm extattr_delete_fd ,
.Nm extattr_get_file ,
.Nm extattr_set_file ,
.Nm extattr_delete_file
.Nm extattr_get_link ,
.Nm extattr_set_link ,
.Nm extattr_delete_link
.Nd system calls to manipulate VFS extended attributes
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
.In sys/types.h
.In sys/extattr.h
.In sys/uio.h
.Ft ssize_t
.Fn extattr_get_fd "int fd" "int attrnamespace" "const char *attrname" "void *data" "size_t nbytes"
.Ft int
.Fn extattr_set_fd "int fd" "int attrnamespace" "const char *attrname" "const void *data" "size_t nbytes"
.Ft int
.Fn extattr_delete_fd "int fd" "int attrnamespace" "const char *attrname"
.Ft ssize_t
.Fn extattr_get_file "const char *path" "int attrnamespace" "const char *attrname" "void *data" "size_t nbytes"
.Ft int
.Fn extattr_set_file "const char *path" "int attrnamespace" "const char *attrname" "const void *data" "size_t nbytes"
.Ft int
.Fn extattr_delete_file "const char *path" "int attrnamespace" "const char *attrname"
.Ft ssize_t
.Fn extattr_get_link "const char *path" "int attrnamespace" "const char *attrname" "void *data" "size_t nbytes"
.Ft int
.Fn extattr_set_link "const char *path" "int attrnamespace" "const char *attrname" "const void *data" "size_t nbytes"
.Ft int
.Fn extattr_delete_link "const char *path" "int attrnamespace" "const char *attrname"
.Sh DESCRIPTION
Named extended attributes are meta-data associated with vnodes
representing files and directories.
They exist as
.Qq Li name=value
pairs within a set of namespaces.
The
.Fn extattr_get_file
call retrieves the value of the specified extended attribute into
a buffer pointed to by
.Fa data
of size
.Fa nbytes .
The
.Fn extattr_set_file
call sets the value of the specified extended attribute to the data
described by
.Fa data .
The
.Fn extattr_delete_file
call deletes the extended attribute specified.
The
.Fn extattr_get_file
and
.Fn extattr_set_file
calls consume the
.Fa data
and
.Fa nbytes
arguments in the style of
.Xr read 2
and
.Xr write 2 ,
respectively.
If
.Fa data
is
.Dv NULL
in a call to
.Fn extattr_get_file
then the size of defined extended attribute data will be returned, rather
than the quantity read, permitting applications to test the size of the
data without performing a read.
The
.Fn extattr_delete_link ,
.Fn extattr_get_link ,
and
.Fn extattr_set_link
functions behave in the same way as their _file counterparts, except that
they do not follow symlinks.
.Pp
The
.Fn extatttr_get_fd ,
.Fn extattr_set_fd ,
and
.Fn extattr_delete_fd
calls are identical to their
.Qq Li _file
counterparts except for the first argument.
The
.Qq Li _fd
functions take a file descriptor, while the
.Qq Li _file
functions take a path.
{'fraction_non_alphanumeric': 0.07916720215910551, 'fraction_numerical': 0.003855545559696697, 'mean_word_length': 4.283095723014257, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5372462', 'n_tokens_mistral': 2555, 'n_tokens_neox': 2343, 'n_words': 1101}