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