Debian Codegraph @

upstream/debian-trixie/man2/FS_IOC_SETFSLABEL.2const

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