]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man/man2/ioctl_fslabel.2
man/, share/mk/: Move man*/ to man/
[thirdparty/man-pages.git] / man / man2 / ioctl_fslabel.2
CommitLineData
bcdf6f9c
ES
1.\" Copyright (c) 2018, Red Hat, Inc. All rights reserved.
2.\"
e4a74ca8 3.\" SPDX-License-Identifier: GPL-2.0-or-later
4c1c5274 4.TH ioctl_fslabel 2 (date) "Linux man-pages (unreleased)"
bcdf6f9c
ES
5.SH NAME
6ioctl_fslabel \- get or set a filesystem label
c0baf2ba
AC
7.SH LIBRARY
8Standard C library
8fc3b2cf 9.RI ( libc ", " \-lc )
bcdf6f9c 10.SH SYNOPSIS
c7db92b9 11.nf
9c9e0561 12.BR "#include <linux/fs.h>" " /* Definition of " *FSLABEL* " constants */"
bcdf6f9c 13.B #include <sys/ioctl.h>
c6d039a3 14.P
bcdf6f9c 15.BI "int ioctl(int " fd ", FS_IOC_GETFSLABEL, char " label [FSLABEL_MAX]);
bcdf6f9c 16.BI "int ioctl(int " fd ", FS_IOC_SETFSLABEL, char " label [FSLABEL_MAX]);
c7db92b9 17.fi
bcdf6f9c
ES
18.SH DESCRIPTION
19If a filesystem supports online label manipulation, these
20.BR ioctl (2)
21operations can be used to get or set the filesystem label for the filesystem
22on which
f72f6f26 23.I fd
bcdf6f9c
ES
24resides.
25The
26.B FS_IOC_SETFSLABEL
27operation requires privilege
28.RB ( CAP_SYS_ADMIN ).
29.SH RETURN VALUE
5e833e27
MK
30On success zero is returned.
31On error, \-1 is returned, and
bcdf6f9c
ES
32.I errno
33is set to indicate the error.
bcdf6f9c 34.SH ERRORS
e8d28f7c 35Possible errors include (but are not limited to) the following:
c11e258b
MK
36.TP
37.B EFAULT
38.I label
39references an inaccessible memory area.
bcdf6f9c
ES
40.TP
41.B EINVAL
42The specified label exceeds the maximum label length for the filesystem.
43.TP
44.B ENOTTY
45This can appear if the filesystem does not support online label manipulation.
46.TP
47.B EPERM
48The calling process does not have sufficient permissions to set the label.
4131356c
AC
49.SH STANDARDS
50Linux.
51.SH HISTORY
52Linux 4.18.
c6d039a3 53.P
bcdf6f9c
ES
54They were previously known as
55.B BTRFS_IOC_GET_FSLABEL
56and
57.B BTRFS_IOC_SET_FSLABEL
58and were private to Btrfs.
bcdf6f9c
ES
59.SH NOTES
60The maximum string length for this interface is
61.BR FSLABEL_MAX ,
b957f81f 62including the terminating null byte (\[aq]\\0\[aq]).
bcdf6f9c 63Filesystems have differing maximum label lengths, which may or
5e833e27
MK
64may not include the terminating null.
65The string provided to
bcdf6f9c
ES
66.B FS_IOC_SETFSLABEL
67must always be null-terminated, and the string returned by
68.B FS_IOC_GETFSLABEL
69will always be null-terminated.
70.SH SEE ALSO
71.BR ioctl (2),
72.BR blkid (8)