* Re: [PATCH v2] chrt: Make priority optional for policies that don't use it
From: Benno Schulenberg @ 2025-06-18 8:18 UTC (permalink / raw)
To: Madadi Vineeth Reddy, util-linux, Karel Zak
In-Reply-To: <20250617182403.47095-1-vineethr@linux.ibm.com>
[-- Attachment #1.1: Type: text/plain, Size: 974 bytes --]
Op 17-06-2025 om 20:24 schreef Madadi Vineeth Reddy:
> Currently, chrt requires a priority argument even for scheduling
> policies like SCHED_OTHER and SCHED_BATCH, which ignore it.
>
> This change relaxes that requirement. Now, priority is only expected
> for SCHED_FIFO and SCHED_RR. For other policies, a default value of 0
> is set internally and no argument is required on the command line.
Doesn't this alter the "show-the-current-policy-and-priority" behavior
when no priority is given? Currently `./chrt --help` says (trimmed):
Set policy:
chrt [options] --pid <priority> <pid>
Get policy:
chrt [options] -p <pid>
Without the proposed change, running `chrt --other --pid $$` says:
pid 1427's current scheduling policy: SCHED_OTHER
pid 1427's current scheduling priority: 0
After the change, that same command outputs nothing. Maybe that is
fine, but it would require some adjustment of the docs.
Benno
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply
* [PATCH v2] chrt: Make priority optional for policies that don't use it
From: Madadi Vineeth Reddy @ 2025-06-17 18:24 UTC (permalink / raw)
To: util-linux, Karel Zak; +Cc: vineethr
Currently, chrt requires a priority argument even for scheduling
policies like SCHED_OTHER and SCHED_BATCH, which ignore it.
This change relaxes that requirement. Now, priority is only expected
for SCHED_FIFO and SCHED_RR. For other policies, a default value of 0
is set internally and no argument is required on the command line.
This simplifies usage when modifying runtime parameters like
--sched-runtime for non-realtime tasks.
For example, to change the EEVDF tunable base_slice, one currently
needs to run:
chrt -v -o -T 1000000 -p 0 $PID
Passing '0' after -p is not intutive and not required as priority is
not applicable to SCHED_OTHER tasks. Now with this patch, one can do:
chrt -v -o -T 1000000 -p $PID
Passing '0' still works ensuring ABI doesn't break.
Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
---
Changes in v2:
- Updated the man page to reflect the optional priority behavior (Karel Zak)
- Renamed variable to 'need_prio' (Karel Zak)
Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
---
schedutils/chrt.1.adoc | 12 ++++++++----
schedutils/chrt.c | 16 +++++++++++-----
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/schedutils/chrt.1.adoc b/schedutils/chrt.1.adoc
index 77add535d..4f419b5f6 100644
--- a/schedutils/chrt.1.adoc
+++ b/schedutils/chrt.1.adoc
@@ -58,16 +58,16 @@ Set scheduling policy to *SCHED_FIFO* (first in-first out).
Set scheduling policy to *SCHED_RR* (round-robin scheduling). When no policy is defined, the *SCHED_RR* is used as the default.
*-b*, *--batch*::
-Set scheduling policy to *SCHED_BATCH* (scheduling batch processes). Linux-specific, supported since 2.6.16. The priority argument has to be set to zero.
+Set scheduling policy to *SCHED_BATCH* (scheduling batch processes). Linux-specific, supported since 2.6.16. Since util-linux v2.42, the priority argument is optional; if specified, it must be set to zero.
*-i*, *--idle*::
-Set scheduling policy to *SCHED_IDLE* (scheduling very low priority jobs). Linux-specific, supported since 2.6.23. The priority argument has to be set to zero.
+Set scheduling policy to *SCHED_IDLE* (scheduling very low priority jobs). Linux-specific, supported since 2.6.23. Since util-linux v2.42, the priority argument is optional; if specified, it must be set to zero.
*-d*, *--deadline*::
-Set scheduling policy to *SCHED_DEADLINE* (sporadic task model deadline scheduling). Linux-specific, supported since 3.14. The priority argument has to be set to zero. See also *--sched-runtime*, *--sched-deadline* and *--sched-period*. The relation between the options required by the kernel is runtime <= deadline <= period. *chrt* copies _period_ to _deadline_ if *--sched-deadline* is not specified and _deadline_ to _runtime_ if *--sched-runtime* is not specified. It means that at least *--sched-period* has to be specified. See *sched*(7) for more details.
+Set scheduling policy to *SCHED_DEADLINE* (sporadic task model deadline scheduling). Linux-specific, supported since 3.14. Since util-linux v2.42, the priority argument is optional; if specified, it must be set to zero. See also *--sched-runtime*, *--sched-deadline* and *--sched-period*. The relation between the options required by the kernel is runtime <= deadline <= period. *chrt* copies _period_ to _deadline_ if *--sched-deadline* is not specified and _deadline_ to _runtime_ if *--sched-runtime* is not specified. It means that at least *--sched-period* has to be specified. See *sched*(7) for more details.
*-d*, *--ext*::
-Set scheduling policy to *SCHED_EXT* (BPF program-defined scheduling). Linux-specific, supported since 6.12. The priority argument has to be set to zero.
+Set scheduling policy to *SCHED_EXT* (BPF program-defined scheduling). Linux-specific, supported since 6.12. Since util-linux v2.42, the priority argument is optional; if specified, it must be set to zero.
== SCHEDULING OPTIONS
@@ -132,6 +132,10 @@ Reset priorities to default for a process{colon}::
____
*chrt -o -p 0* _PID_
____
+Set a custom slice of 1 ms for a SCHED_OTHER task (priority is optional for policies other than SCHED_FIFO and SCHED_RR){colon}::
+____
+*chrt -o -T 1000000 -p* _PID_
+____
See *sched*(7) for a detailed discussion of the different scheduler classes and how they interact.
== PERMISSIONS
diff --git a/schedutils/chrt.c b/schedutils/chrt.c
index cf99935dc..eb1717acc 100644
--- a/schedutils/chrt.c
+++ b/schedutils/chrt.c
@@ -495,20 +495,26 @@ int main(int argc, char **argv)
}
}
- if (((ctl->pid > -1) && argc - optind < 1) ||
- ((ctl->pid == -1) && argc - optind < 2)) {
+ bool need_prio = (ctl->policy == SCHED_FIFO || ctl->policy == SCHED_RR);
+
+ if (((ctl->pid > -1) && argc - optind < (need_prio ? 1 : 0)) ||
+ ((ctl->pid == -1) && argc - optind < (need_prio ? 2 : 1))) {
warnx(_("bad usage"));
errtryhelp(EXIT_FAILURE);
}
- if ((ctl->pid > -1) && (ctl->verbose || argc - optind == 1)) {
+ if ((ctl->pid > -1) && (ctl->verbose || argc - optind == (need_prio ? 1 : 0))) {
show_sched_info(ctl);
- if (argc - optind == 1)
+ if (argc - optind == (need_prio ? 1 : 0))
return EXIT_SUCCESS;
}
errno = 0;
- ctl->priority = strtos32_or_err(argv[optind], _("invalid priority argument"));
+
+ if (need_prio || argc - optind == 2)
+ ctl->priority = strtos32_or_err(argv[optind], _("invalid priority argument"));
+ else
+ ctl->priority = 0;
if (ctl->runtime && !supports_runtime_param(ctl->policy))
errx(EXIT_FAILURE, _("--sched-runtime option is supported for %s"),
--
2.49.0
^ permalink raw reply related
* Re: [PATCH] chrt: Make priority optional for policies that don't use it
From: Madadi Vineeth Reddy @ 2025-06-17 17:04 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
In-Reply-To: <4kuoetpvezrzurjsgbu37jngbu5qteqowcdvukhoh6jlz3rcso@jr2ofz4ddfwm>
Hi Karel,
On 17/06/25 17:35, Karel Zak wrote:
> On Mon, Jun 16, 2025 at 12:52:18AM +0530, Madadi Vineeth Reddy wrote:
>> Currently, chrt requires a priority argument even for scheduling
>> policies like SCHED_OTHER and SCHED_BATCH, which ignore it.
>>
>> This change relaxes that requirement. Now, priority is only expected
>> for SCHED_FIFO and SCHED_RR. For other policies, a default value of 0
>> is set internally and no argument is required on the command line.
>>
>> This simplifies usage when modifying runtime parameters like
>> --sched-runtime for non-realtime tasks.
>>
>> For example, to change the EEVDF tunable base_slice, one currently
>> needs to run:
>> chrt -v -o -T 1000000 -p 0 $PID
>>
>> Passing '0' after -p is not intutive and not required as priority is
>> not applicable to SCHED_OTHER tasks. Now with this patch, one can do:
>> chrt -v -o -T 1000000 -p $PID
>>
>> Passing '0' still works ensuring ABI doesn't break.
>
> Looks good. It would be nice to update the man page and add a note
> that -p is not required since util-linux v2.42.
>
I believe you meant that the priority argument is not required for some
scheduling policies. The -p / --pid option is still required.
I’ll update the man page accordingly.
>> + bool policy_needs_priority = (ctl->policy == SCHED_FIFO || ctl->policy == SCHED_RR);
>
> Nitpicking... can't we use a shorter name, for example "need_prio"? ;-)
Sure, will update it in v2. Thanks for taking a look.
Thanks,
Madadi Vineeth Reddy
>
> Karel
>
^ permalink raw reply
* Re: [PATCH] chrt: Make priority optional for policies that don't use it
From: Karel Zak @ 2025-06-17 12:05 UTC (permalink / raw)
To: Madadi Vineeth Reddy; +Cc: util-linux
In-Reply-To: <20250615192218.70289-1-vineethr@linux.ibm.com>
On Mon, Jun 16, 2025 at 12:52:18AM +0530, Madadi Vineeth Reddy wrote:
> Currently, chrt requires a priority argument even for scheduling
> policies like SCHED_OTHER and SCHED_BATCH, which ignore it.
>
> This change relaxes that requirement. Now, priority is only expected
> for SCHED_FIFO and SCHED_RR. For other policies, a default value of 0
> is set internally and no argument is required on the command line.
>
> This simplifies usage when modifying runtime parameters like
> --sched-runtime for non-realtime tasks.
>
> For example, to change the EEVDF tunable base_slice, one currently
> needs to run:
> chrt -v -o -T 1000000 -p 0 $PID
>
> Passing '0' after -p is not intutive and not required as priority is
> not applicable to SCHED_OTHER tasks. Now with this patch, one can do:
> chrt -v -o -T 1000000 -p $PID
>
> Passing '0' still works ensuring ABI doesn't break.
Looks good. It would be nice to update the man page and add a note
that -p is not required since util-linux v2.42.
> + bool policy_needs_priority = (ctl->policy == SCHED_FIFO || ctl->policy == SCHED_RR);
Nitpicking... can't we use a shorter name, for example "need_prio"? ;-)
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* [PATCH] chrt: Make priority optional for policies that don't use it
From: Madadi Vineeth Reddy @ 2025-06-15 19:22 UTC (permalink / raw)
To: util-linux; +Cc: vineethr
Currently, chrt requires a priority argument even for scheduling
policies like SCHED_OTHER and SCHED_BATCH, which ignore it.
This change relaxes that requirement. Now, priority is only expected
for SCHED_FIFO and SCHED_RR. For other policies, a default value of 0
is set internally and no argument is required on the command line.
This simplifies usage when modifying runtime parameters like
--sched-runtime for non-realtime tasks.
For example, to change the EEVDF tunable base_slice, one currently
needs to run:
chrt -v -o -T 1000000 -p 0 $PID
Passing '0' after -p is not intutive and not required as priority is
not applicable to SCHED_OTHER tasks. Now with this patch, one can do:
chrt -v -o -T 1000000 -p $PID
Passing '0' still works ensuring ABI doesn't break.
Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
---
schedutils/chrt.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/schedutils/chrt.c b/schedutils/chrt.c
index cf99935dc..339f3e318 100644
--- a/schedutils/chrt.c
+++ b/schedutils/chrt.c
@@ -495,20 +495,26 @@ int main(int argc, char **argv)
}
}
- if (((ctl->pid > -1) && argc - optind < 1) ||
- ((ctl->pid == -1) && argc - optind < 2)) {
+ bool policy_needs_priority = (ctl->policy == SCHED_FIFO || ctl->policy == SCHED_RR);
+
+ if (((ctl->pid > -1) && argc - optind < (policy_needs_priority ? 1 : 0)) ||
+ ((ctl->pid == -1) && argc - optind < (policy_needs_priority ? 2 : 1))) {
warnx(_("bad usage"));
errtryhelp(EXIT_FAILURE);
}
- if ((ctl->pid > -1) && (ctl->verbose || argc - optind == 1)) {
+ if ((ctl->pid > -1) && (ctl->verbose || argc - optind == (policy_needs_priority ? 1 : 0))) {
show_sched_info(ctl);
- if (argc - optind == 1)
+ if (argc - optind == (policy_needs_priority ? 1 : 0))
return EXIT_SUCCESS;
}
errno = 0;
- ctl->priority = strtos32_or_err(argv[optind], _("invalid priority argument"));
+
+ if (policy_needs_priority || argc - optind == 2)
+ ctl->priority = strtos32_or_err(argv[optind], _("invalid priority argument"));
+ else
+ ctl->priority = 0;
if (ctl->runtime && !supports_runtime_param(ctl->policy))
errx(EXIT_FAILURE, _("--sched-runtime option is supported for %s"),
--
2.49.0
^ permalink raw reply related
* Re: [PATCH 1/6] remove two leftover license lines from colors.{c,h}
From: Karel Zak @ 2025-06-09 12:44 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: util-linux
In-Reply-To: <20250602141436.11156-1-bensberg@telfort.nl>
On Mon, Jun 02, 2025 at 04:14:31PM +0200, Benno Schulenberg wrote:
> include/colors.h | 3 ---
> lib/colors.c | 3 ---
> 2 files changed, 6 deletions(-)
Applied (all patches in the set), thanks.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: Questions about util-linux
From: Thomas Weißschuh @ 2025-06-08 21:37 UTC (permalink / raw)
To: Nick Piaddo; +Cc: util-linux@vger.kernel.org
In-Reply-To: <IM79iX-yrSm2eLiLvGaZqJbIZaqT9SuLnpz0GuSvYOizxuYCJucKrIfwPYCjCos13Y4njHyPz3ftnmz6y5MrsTr6plHxqBIHUDF59iH-GlA=@protonmail.com>
On 2025-06-05 10:25:07+0000, Nick Piaddo wrote:
> **As my first post on this mailing list, please advise if "this is NOT the way..."**
>
> Hi,
>
> I am developing a personal project in Rust for which I need to probe block
> devices, create, and mount partitions; `libblkid`, `libfdisk`, and `libmount`
> fit the bill perfectly.
So you want to use the original C libraries and wrap them from rust,
correct? Not reimplement them.
These libraries are LGPL. Your crates, for which are asking about
internal details are licensed as Apache or MIT, which looks iffy.
Especially if the libraries are then linked statically.
Best stick to the LGPL.
> So, I am writing Rust bindings for `util-linux-2.39` (published on `crates.io`):
> - `rsblkid`: [crate](https://crates.io/crates/rsblkid) [docs](https://docs.rs/rsblkid/latest/rsblkid/)
> - `rsfdisk`: [crate](https://crates.io/crates/rsfdisk) [docs](https://docs.rs/rsfdisk/latest/rsfdisk/)
> - `rsmount`: [crate](https://crates.io/crates/rsmount) [docs](https://docs.rs/rsmount/latest/rsmount/)
>
> They are first drafts with APIs that are still in flux, with low test coverage,
> and some C functions are still missing their Rust equivalents.
>
> Even after going through:
> - the source code of each C library,
> - their documentation pages,
> - the manpages of `blkid`, `fdisk`, `mount`,
Also look at libblkid(3)
> - and searching the net for as much information as I could find,
>
> the docs of each crate still reflects my limited knowledge of `util-linux`.
>
> So, I do have a few questions I hope experts on this list may be able to
> answer (see further down). **Warning:** It's a long read!
These are a lot of questions. I'll respond to the ones I have
answers to. The amount most likely reduces your chances to get
responses.
If these questions were generated automatically please mention it.
> Nick
>
> ## How are questions structured?
>
> Most questions follow the pattern described below:
<snip>
> Please mention the ID of the question you are answering, or are seeking
> clarifications for. It will make the conversation easier to follow.
I will reply inline. Right below the question.
This will keep the context very celar.
> Thanks! (^-^)b
>
> ## General questions
>
> G1 - Would it be possible to provide a way to define a destructor for functions
> registering callbacks, long-lived or otherwise?
>
> Interoperating with C, and registering callback functions requires Rust to
> allocate state data on the heap.
>
> From the [Rustonomicon](https://doc.rust-lang.org/nomicon/ffi.html#destructors)
> we learn that:
> > Foreign libraries often hand off ownership of resources to the calling code.
> > When this occurs, we must use Rust's destructors to provide safety and
> > guarantee the release of these resources (especially in the case of panic).
>
> To free dynamically allocated Rust data, C functions registering callbacks
> should have a signature like the one shown below:
>
> ```C
> void widget_register_callback(
> widget_t *widget,
> void *data,
> void (*callback)(void*, event_t),
> void (*destroy)(void*)
> );
> ```
>
> See this blog post [Neat Rust Tricks: Passing Rust Closures to
> C](http://blog.sagetheprogrammer.com/neat-rust-tricks-passing-rust-closures-to-c)
> for a presentation of what I dream `util-linux` had. (╥﹏╥)つ
>
> While reading `util-linux`'s source code, I identified three types of functions
> to register callbacks:
>
> - functions for which it is essentially impossible to create Rust bindings,
> case in point: `fdisk_table_sort_partitions` (see documentation further down).
> This function has a signature that looks like the example below.
This should only be true for closures. If you use a regular function with
static lifetime fdisk_table_sort_partitions() should work fine.
A closure does not make sense here anyways.
> - functions for registering long-lived callbacks with a signature like the one
> shown below
>
> ```C
> void widget_register_callback(
> widget_t *widget,
> void (*callback)(void*, event_t),
> );
> ```
> For example, `mnt_table_set_parser_errcb` that acts on a `struct
> libmnt_table`. This structure has an internal field to store a data pointer,
> along with specialized accessor functions to get/set it (respectively
> `mnt_table_get_userdata `, and `mnt_table_set_userdata `). However, lacking a
> way to define a destructor, this function will leak memory each time it is
> called to replace a callback.
The mnt_table is owned by your rust code. So the rust code can clean up
the userdata together with the mnt_table.
> - functions for registering short-lived callbacks with a signature like the one
> shown below
>
> ```C
> void widget_register_callback(
> widget_t *widget,
> void *data,
> void (*callback)(void*, event_t),
> );
> ```
> For example, `mnt_table_find_next_fs` which is the closest to the ideal form.
> Although it lacks a way to define a destructor, being short-lived, it allows
> the enclosing Rust binding to take care of releasing resources allocated on
> the heap.
Here the data should be owned by the function calling
mnt_table_find_next_fs() and it will be cleaned up nicely when the
function returns.
>
> https://github.com/util-linux/util-linux/blob/stable/v2.39/libfdisk/src/fdiskP.h#L200-L205
Why use v2.39 and not the latest versions?
Some of your problems may already be resolved there.
<snip a lot of blablabla>
> G2 - How can I create device images that will trigger errors when running
> unit-tests?
<blabla>
> Knowing how to create an intentionally broken device image would be wonderful.
> It would allow me to increase test coverage of my Rust-bindings.
This question does not make sense. It's not the responsibility of your
code to look at the raw image file.
util-linux is fuzzed with random input as part of oss-fuzz.
> ## libblkid
>
> B1 - Are there public accessor functions on the roadmap of `libblkid` for
> reading the private fields `bid_pri`, `bid_devno`, and `bid_time` in
> `blkid_dev_struct`?
>
> For the moment, I can not accurately reproduce the way data about a
> `blkid_struct_dev` is printed in `/run/blkid/blkid.tab` due to not being able
> to access the relevant fields.
blkid.tab is an internal file. Why do you need to reproduce it?
<snip>
> B2 - Does anyone know what the function `blkid_dev_set_search` is supposed to
> do?
>
> There are no docstrings for this function. Although I read its source code, I
> could not figure out its purpose. <('^-^)
>
> https://github.com/util-linux/util-linux/blob/stable/v2.39/libblkid/src/dev.c#L150-L172
Seems quite obvious to me. It allows you to search for files with a
certain tag value.
<snip the code>
Why is all this pointless code in the email?
If somebody is not capable of looking up the code they won't be able to
help anyways.
> B3 - Do I define `size` as `uint64_t` or `int64_t`?
>
> The `size` field in `struct blkid_struct_probe` is of type `uint64_t`. But,
> according to the documentation, its accessor function `blkid_probe_get_sectors`
> may return `-1` in case of error.
`struct blkid_struct_probe` is internal. The types it uses are of no
concern to your code. Stick to the public interface.
> Reading the code of `blkid_probe_get_sectors`, I can see that it just divides
> `size` by 512 which would never return a negative value (see below).
If the function is documented as being able to return an error, then
write your code with this consideration.
<snip>
> B4 - Is the documentation out-of-date or just anticipating a future change?
>
> The function `blkid_probe_set_sectorsize` always returns `0`, but its docstring
> says otherwise.
The docstring defines the interface, trust it.
<snip>
> B5 - Is there a list of all file systems supported by `libblkid`?
> By searching the source code, I managed to constitute a list of supported file
> systems gathered in the enum
> [`FileSystem`](https://docs.rs/rsblkid/latest/rsblkid/partition/enum.FileSystem.html#variants)
> in `rsblkid`.
>
> It would be nice if I could double-check its accuracy from an official
> reference.
blkid --list-filesystems
This is documented.
> B6 - Is there a list of all tags supported by `libblkid`?
>
> By searching the source code, I managed to constitute a list of supported tags
> gathered in the enum
> [`Tag`](https://docs.rs/rsblkid/latest/rsblkid/device/enum.Tag.html#variants)
> in `rsblkid`.
>
> It would be nice if I could double-check its accuracy from an official
> reference.
This is documented in libblkid(3).
I wouldn't represent this as enum, though.
<snip>
> ## libmount
>
> M1 - Does `libmount` plan to provide public functions to access/set the
> private `fmt` field in `struct libmnt_table`?
>
> From what I understand, `struct libmnt_table` is a generic data type used to
> represent either of the following files:
> - `/etc/fstab`
> - `/proc/#/mountinfo`
> - `/run/mount/utab`
> - `/proc/swaps`
>
> The `fmt` field helps distinguish each subtype, and being able to set it would
> make it easier for me to instantiate the appropriate type Rust-side (i.e.
> `FsTab`, `MountInfo`, `UTab`, `Swaps`).
Why do you need this?
<snip>
> M2 - If we were to split `struct libmnt_fs` into one type per file format,
> would we get data types resembling `struct entry_fstab`, `struct
> entry_mountinfo`, `struct entry_utab`, `struct_swaps` described below?
>
> As far as I can tell, `struct libmnt_fs` is a multi-purpose data type
> representing a line in either of the following files:
> - `/etc/fstab`
> - `/proc/#/mountinfo`
> - `/run/mount/utab`
> - `/proc/swaps`
>
> Each file has a distinct format. So, some fields present in `struct libmnt_fs`
> do not apply to certain files.
All of this is private implementation why do you need it?
<snip>
> M3 - About `struct libmnt_fs` mentioned in question `M2`, is the following a
> good partition of which subsets of functions, acting on the struct, are
> specific/exclusive to each type of file entry? (We assume that items not in
> a union of the subsets below are shared between line types)
>
> ### Functions specific/exclusive to `/etc/fstab`
>
> - `mnt_fs_append_comment`
> - `mnt_fs_append_options `
> - `mnt_fs_get_comment `
> - `mnt_fs_get_freq `
> - `mnt_fs_get_fstype `
> - `mnt_fs_get_option `
> - `mnt_fs_get_options `
> - `mnt_fs_get_passno `
> - `mnt_fs_get_source `
> - `mnt_fs_get_tag `
> - `mnt_fs_get_target `
> - `mnt_fs_match_fstype `
> - `mnt_fs_match_options `
> - `mnt_fs_match_target `
> - `mnt_fs_prepend_options `
> - `mnt_fs_print_debug `
> - `mnt_fs_set_comment `
> - `mnt_fs_set_freq `
> - `mnt_fs_set_fstype `
> - `mnt_fs_set_options `
> - `mnt_fs_set_passno `
> - `mnt_fs_set_source `
> - `mnt_fs_set_target `
> - `mnt_fs_streq_target `
> - `mnt_fs_to_mntent `
> - `mnt_new_fs `
This question does not make sense.
> ### Functions specific/exclusive to `/proc/#/mountinfo`
>
> - `mnt_fs_get_devno `
> - `mnt_fs_get_fs_options `
> - `mnt_fs_get_fstype `
> - `mnt_fs_get_id `
> - `mnt_fs_get_optional_fields `
> - `mnt_fs_get_parent_id `
> - `mnt_fs_get_propagation `
> - `mnt_fs_get_root `
> - `mnt_fs_get_target `
> - `mnt_fs_get_tid `
> - `mnt_fs_get_vfs_options `
> - `mnt_fs_get_vfs_options_all `
> - `mnt_fs_match_fstype `
> - `mnt_fs_match_target `
> - `mnt_fs_print_debug `
> - `mnt_fs_strdup_options `
> - `mnt_fs_streq_target `
This list also does not make sense.
> ### Functions specific/exclusive to `/run/mount/utab`
>
> - `mnt_fs_append_attributes `
> - `mnt_fs_get_attribute `
> - `mnt_fs_get_attributes `
> - `mnt_fs_get_bindsrc `
> - `mnt_fs_get_id `
> - `mnt_fs_get_root `
> - `mnt_fs_get_user_options `
> - `mnt_fs_match_options `
> - `mnt_fs_match_target `
> - `mnt_fs_prepend_attributes `
> - `mnt_fs_set_attributes `
> - `mnt_fs_set_bindsrc `
> - `mnt_fs_set_root `
> - `mnt_fs_set_source `
> - `mnt_fs_streq_target `
Why is for example `mnt_fs_print_debug` missing?
This looks random.
Don't try to "improve" the API. It will break at some point.
<snip>
> M5 - Could anyone provide more information about the format used by the entries
> in `/run/mount/utab`? Are the definitions reproduced below correct?
>
> By reading the code for the `mnt_parse_utab_line` function, I identified the
> following keys for possible key-value pairs in `/run/mount/utab`.
Why? It is a private implementation detail.
<snip>
> M6 - Can the `SRC` key mentioned in question `M5` have a:
> - tag (UUID, PARTUUID, LABEL, etc.)
> - network ID (Samba: `smb://ip-address-or-hostname/shared-dir`, SSHFS:
> `user@ip-address-or-hostname:/shared-dir`, etc.)
> as value? (e.g. SRC="UUID=ac4f36bf-191b-4fb0-b808-6d7fc9fc88be")
Still a private implementation detail.
> M7 - What does `mnt_fs_set_root` do? Is it meant for `/proc/self/mountinfo`,
> `/run/mount/utab`, or both?
>
> Although `libmnt_fs` can represent a line in `/proc/self/mountinfo`, files in
> `/proc` are usually read-only, managed directly by the Linux kernel.
>
> However, the docstring of `mnt_fs_set_root` says that it is supposed to modify
> an entry in `/proc/self/mountinfo`.
It modifies the entry in memory.
> M8 - What is `mnt_context_apply_fstab` supposed to do?
Looks to me like it extends the context with information found in
/etc/fstab.
<snip>
> Thank you for reading this far. Please accept my apologies for making you go
> through this wall of text m(__)m
Please don't quote all this code.
Thomas
^ permalink raw reply
* Zakup energii w modelu SPOT
From: Andrzej Chrobak @ 2025-06-06 7:55 UTC (permalink / raw)
To: util-linux
Szanowni Państwo,
jeśli oczekują Państwo obniżenia rachunków za energię elektryczną i poszukują elastycznego modelu zakupowego, to myślę, że zainteresuje Państwa nasze rozwiązanie.
Specjalizujemy się w sprzedaży energii elektrycznej w oparciu o godzinowe ceny Rynku Dnia Następnego Towarowej Giełdy Energii, znane również jako rynek SPOT.
Dzięki modelowi RDN mają Państwo możliwość obniżenia rachunków i wyeliminowania ryzyka wysokich stałych opłat w długim okresie. Dodatkowo nie ma konieczności deklaracji zużycia, a ewentualne zmiany nie pociągają za sobą kar finansowych.
Zapraszamy do skorzystania z naszego wsparcia, które pozwoli Państwu zaoszczędzić i mieć kontrolę nad ceną energii, bez potrzeby podpisywania długoterminowych umów.
Czy chcielibyście Państwo omówić szczegóły takiej oferty?
Pozdrawiam
Andrzej Chrobak
^ permalink raw reply
* Questions about util-linux
From: Nick Piaddo @ 2025-06-05 10:25 UTC (permalink / raw)
To: util-linux@vger.kernel.org
**As my first post on this mailing list, please advise if "this is NOT the way..."**
Hi,
I am developing a personal project in Rust for which I need to probe block
devices, create, and mount partitions; `libblkid`, `libfdisk`, and `libmount`
fit the bill perfectly.
So, I am writing Rust bindings for `util-linux-2.39` (published on `crates.io`):
- `rsblkid`: [crate](https://crates.io/crates/rsblkid) [docs](https://docs.rs/rsblkid/latest/rsblkid/)
- `rsfdisk`: [crate](https://crates.io/crates/rsfdisk) [docs](https://docs.rs/rsfdisk/latest/rsfdisk/)
- `rsmount`: [crate](https://crates.io/crates/rsmount) [docs](https://docs.rs/rsmount/latest/rsmount/)
They are first drafts with APIs that are still in flux, with low test coverage,
and some C functions are still missing their Rust equivalents.
Even after going through:
- the source code of each C library,
- their documentation pages,
- the manpages of `blkid`, `fdisk`, `mount`,
- and searching the net for as much information as I could find,
the docs of each crate still reflects my limited knowledge of `util-linux`.
So, I do have a few questions I hope experts on this list may be able to
answer (see further down). **Warning:** It's a long read!
Thank you for your help! (´ ˘ `ㅅ)
Nick
## How are questions structured?
Most questions follow the pattern described below:
```
<id> "-" <question>"?"
<context>
{<url>
<quote>};
<id> = <capital-letter><seq-num>;
<capital-letter> = "G" | "B" | "F" | "M";
<seq-num> = <digit>, {<digit>};
<digit> = "0" | "1" | "2" | "3" | "4" | 5 | "6" | 7 | "8" | "9";
```
- `<id>`: unique ID for each question.
- `<question>`: text describing the question.
- `<context>`: text describing the issue that prompted the question.
- `<url>`: link to a source file/documentation page of a function cited in
`<context>`.
- `<quote>`: excerpt from documentation/source code at `<url>`.
About `<id>`:
-`<capital-letter>`: can be one of
+ `G` for a general question about `util-linux`
+ `B` for a specific question about `libblkid`
+ `F` for a specific question about `libfdisk`
+ `M` for a specific question about `libmount`
- `<seq-num>`: a sequence number.
Please mention the ID of the question you are answering, or are seeking
clarifications for. It will make the conversation easier to follow.
Thanks! (^-^)b
## General questions
G1 - Would it be possible to provide a way to define a destructor for functions
registering callbacks, long-lived or otherwise?
Interoperating with C, and registering callback functions requires Rust to
allocate state data on the heap.
From the [Rustonomicon](https://doc.rust-lang.org/nomicon/ffi.html#destructors)
we learn that:
> Foreign libraries often hand off ownership of resources to the calling code.
> When this occurs, we must use Rust's destructors to provide safety and
> guarantee the release of these resources (especially in the case of panic).
To free dynamically allocated Rust data, C functions registering callbacks
should have a signature like the one shown below:
```C
void widget_register_callback(
widget_t *widget,
void *data,
void (*callback)(void*, event_t),
void (*destroy)(void*)
);
```
See this blog post [Neat Rust Tricks: Passing Rust Closures to
C](http://blog.sagetheprogrammer.com/neat-rust-tricks-passing-rust-closures-to-c)
for a presentation of what I dream `util-linux` had. (╥﹏╥)つ
While reading `util-linux`'s source code, I identified three types of functions
to register callbacks:
- functions for which it is essentially impossible to create Rust bindings,
case in point: `fdisk_table_sort_partitions` (see documentation further down).
This function has a signature that looks like the example below.
```C
void widget_register_callback(
widget_t *widget,
void (*callback)(event_t),
);
```
You will notice that it does not:
+ have a data pointer (`void *data`),
+ provide a callback function that accepts a `void*` parameter,
+ offer a way to set a destructor.
- functions for registering long-lived callbacks with a signature like the one
shown below
```C
void widget_register_callback(
widget_t *widget,
void (*callback)(void*, event_t),
);
```
For example, `mnt_table_set_parser_errcb` that acts on a `struct
libmnt_table`. This structure has an internal field to store a data pointer,
along with specialized accessor functions to get/set it (respectively
`mnt_table_get_userdata `, and `mnt_table_set_userdata `). However, lacking a
way to define a destructor, this function will leak memory each time it is
called to replace a callback.
- functions for registering short-lived callbacks with a signature like the one
shown below
```C
void widget_register_callback(
widget_t *widget,
void *data,
void (*callback)(void*, event_t),
);
```
For example, `mnt_table_find_next_fs` which is the closest to the ideal form.
Although it lacks a way to define a destructor, being short-lived, it allows
the enclosing Rust binding to take care of releasing resources allocated on
the heap.
https://github.com/util-linux/util-linux/blob/stable/v2.39/libfdisk/src/fdiskP.h#L200-L205
```C
struct fdisk_table {
struct list_head parts; /* partitions */
int refcount;
size_t nents; /* number of partitions */
};
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libfdisk-docs/libfdisk-Table.html#fdisk-table-sort-partitions
```text
int
fdisk_table_sort_partitions (struct fdisk_table *tb,
int (*cmp) (struct fdisk_partition *, struct fdisk_partition *));
Sort partition in the table.
Parameters
tb table
cmp compare function
Returns
0 on success, <0 on error.
```
https://github.com/util-linux/util-linux/blob/stable/v2.39/libmount/src/mountP.h#L249-L273
```C
/*
* fstab/mountinfo file
*/
struct libmnt_table {
int fmt; /* MNT_FMT_* file format */
int nents; /* number of entries */
int refcount; /* reference counter */
int comms; /* enable/disable comment parsing */
char *comm_intro; /* First comment in file */
char *comm_tail; /* Last comment in file */
struct libmnt_cache *cache; /* canonicalized paths/tags cache */
int (*errcb)(struct libmnt_table *tb,
const char *filename, int line);
int (*fltrcb)(struct libmnt_fs *fs, void *data);
void *fltrcb_data;
int noautofs; /* ignore autofs mounts */
struct list_head ents; /* list of entries (libmnt_fs) */
void *userdata;
};
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Table-of-filesystems.html#mnt-table-set-parser-errcb
```text
int
mnt_table_set_parser_errcb (struct libmnt_table *tb,
int (*cb) (struct libmnt_table *tb, const char *filename, int line));
The error callback function is called by table parser (mnt_table_parse_file())
in case of a syntax error. The callback function could be used for error
evaluation, libmount will continue/stop parsing according to callback return
codes:
<0 : fatal error (abort parsing) 0 : success (parsing continues) >0 :
recoverable error (the line is ignored, parsing continues).
Parameters
tb pointer to table
cb pointer to callback function
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Table-of-filesystems.html#mnt-table-get-userdata
```text
void *
mnt_table_get_userdata (struct libmnt_table *tb);
Parameters
tb pointer to tab
Returns
pointer to user's data.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Table-of-filesystems.html#mnt-table-set-userdata
```text
int
mnt_table_set_userdata (struct libmnt_table *tb,
void *data);
Sets pointer to the private user data.
Parameters
tb pointer to tab
data pointer to user data
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Table-of-filesystems.html#mnt-table-find-next-fs
```text
int
mnt_table_find_next_fs (struct libmnt_table *tb,
struct libmnt_iter *itr,
int (*match_func) (struct libmnt_fs *, void *),
void *userdata,
struct libmnt_fs **fs);
This function allows searching in tb .
Parameters
tb table
itr iterator
match_func function returning 1 or 0
userdata extra data for match_func
fs NULL or returns pointer to the next matching table entry
Returns
negative number in case of error, 1 at end of table or 0 o success.
```
G2 - How can I create device images that will trigger errors when running
unit-tests?
For example, files in `util-linux/tests/expected/blkid` show the expected
outputs after probing the properties of device images in
`util-linux/tests/ts/blkid/images-fs`.
Each image in the directory has a well-formed partition table, so tests will
always walk the "happy path". There is no image that could, for example,
trigger a collision error between probing results.
Rust provides its own test framework, with which it is easy to check functions
(including error cases) at a more granular level than with the test suite in
`util-linux`.
Knowing how to create an intentionally broken device image would be wonderful.
It would allow me to increase test coverage of my Rust-bindings.
## libblkid
B1 - Are there public accessor functions on the roadmap of `libblkid` for
reading the private fields `bid_pri`, `bid_devno`, and `bid_time` in
`blkid_dev_struct`?
For the moment, I can not accurately reproduce the way data about a
`blkid_struct_dev` is printed in `/run/blkid/blkid.tab` due to not being able
to access the relevant fields.
Example of a line in `/run/blkid/blkid.tab`
```text
<device DEVNO="0xfe01" TIME="1687337407.788618" PRI="45" LABEL="root" UUID="9e4adae9-4122-47fe-848f-67a9eb726207" BLOCK_SIZE="4096" TYPE="ext4">/dev/mapper/vg_nixos-root</device>
```
What I can currently output from Rust
```text
<device LABEL="root" UUID="9e4adae9-4122-47fe-848f-67a9eb726207" BLOCK_SIZE="4096" TYPE="ext4">/dev/mapper/vg_nixos-root</device>
```
https://github.com/util-linux/util-linux/blob/8aa25617467a1249669cff7240ca31973bf9a127/libblkid/src/blkidP.h#L45-L61
```C
struct blkid_struct_dev
{
struct list_head bid_devs; /* All devices in the cache */
struct list_head bid_tags; /* All tags for this device */
blkid_cache bid_cache; /* Dev belongs to this cache */
char *bid_name; /* Device real path (as used in cache) */
char *bid_xname; /* Device path as used by application (maybe symlink..) */
char *bid_type; /* Preferred device TYPE */
int bid_pri; /* Device priority */
dev_t bid_devno; /* Device major/minor number */
time_t bid_time; /* Last update time of device */
suseconds_t bid_utime; /* Last update time (microseconds) */
unsigned int bid_flags; /* Device status bitflags */
char *bid_label; /* Shortcut to device LABEL */
char *bid_uuid; /* Shortcut to binary UUID */
};
```
B2 - Does anyone know what the function `blkid_dev_set_search` is supposed to
do?
There are no docstrings for this function. Although I read its source code, I
could not figure out its purpose. <('^-^)
https://github.com/util-linux/util-linux/blob/stable/v2.39/libblkid/src/dev.c#L150-L172
```C
int blkid_dev_set_search(blkid_dev_iterate iter,
const char *search_type, const char *search_value)
{
char *new_type, *new_value;
if (!iter || iter->magic != DEV_ITERATE_MAGIC || !search_type ||
!search_value)
return -1;
new_type = malloc(strlen(search_type)+1);
new_value = malloc(strlen(search_value)+1);
if (!new_type || !new_value) {
free(new_type);
free(new_value);
return -1;
}
strcpy(new_type, search_type);
strcpy(new_value, search_value);
free(iter->search_type);
free(iter->search_value);
iter->search_type = new_type;
iter->search_value = new_value;
return 0;
}
```
B3 - Do I define `size` as `uint64_t` or `int64_t`?
The `size` field in `struct blkid_struct_probe` is of type `uint64_t`. But,
according to the documentation, its accessor function `blkid_probe_get_sectors`
may return `-1` in case of error.
Reading the code of `blkid_probe_get_sectors`, I can see that it just divides
`size` by 512 which would never return a negative value (see below).
https://github.com/util-linux/util-linux/blob/stable/v2.39/libblkid/src/blkidP.h#L203-L233
```C
/*
* Low-level probing control struct
*/
struct blkid_struct_probe
{
int fd; /* device file descriptor */
uint64_t off; /* begin of data on the device */
uint64_t size; /* end of data on the device */
dev_t devno; /* device number (st.st_rdev) */
dev_t disk_devno; /* devno of the whole-disk or 0 */
unsigned int blkssz; /* sector size (BLKSSZGET ioctl) */
mode_t mode; /* struct stat.sb_mode */
uint64_t zone_size; /* zone size (BLKGETZONESZ ioctl) */
int flags; /* private library flags */
int prob_flags; /* always zeroized by blkid_do_*() */
uint64_t wipe_off; /* begin of the wiped area */
uint64_t wipe_size; /* size of the wiped area */
struct blkid_chain *wipe_chain; /* superblock, partition, ... */
struct list_head buffers; /* list of buffers */
struct list_head hints;
struct blkid_chain chains[BLKID_NCHAINS]; /* array of chains */
struct blkid_chain *cur_chain; /* current chain */
struct list_head values; /* results */
struct blkid_struct_probe *parent; /* for clones */
struct blkid_struct_probe *disk_probe; /* whole-disk probing */
};
```
https://github.com/util-linux/util-linux/blob/stable/v2.39/libblkid/src/blkid.h.in#L85-L90
```C
/**
* blkid_loff_t:
*
* 64-bit signed number for offsets and sizes
*/
typedef int64_t blkid_loff_t;
```
https://github.com/util-linux/util-linux/blob/8aa25617467a1249669cff7240ca31973bf9a127/libblkid/src/probe.c#L1971-L1983
```C
/**
* blkid_probe_get_sectors:
* @pr: probe
*
* Returns: 512-byte sector count or -1 in case of error.
*/
blkid_loff_t blkid_probe_get_sectors(blkid_probe pr)
{
return (blkid_loff_t) (pr->size >> 9);
}
```
B4 - Is the documentation out-of-date or just anticipating a future change?
The function `blkid_probe_set_sectorsize` always returns `0`, but its docstring
says otherwise.
https://github.com/util-linux/util-linux/blob/8aa25617467a1249669cff7240ca31973bf9a127/libblkid/src/probe.c#L2014-L2030
```C
/**
* blkid_probe_set_sectorsize:
* @pr: probe
* @sz: new size (to overwrite system default)
*
* Note that blkid_probe_set_device() resets this setting. Use it after
* blkid_probe_set_device() and before any probing call.
*
* Since: 2.30
*
* Returns: 0 or <0 in case of error
*/
int blkid_probe_set_sectorsize(blkid_probe pr, unsigned int sz)
{
pr->blkssz = sz;
return 0;
}
```
B5 - Is there a list of all file systems supported by `libblkid`?
By searching the source code, I managed to constitute a list of supported file
systems gathered in the enum
[`FileSystem`](https://docs.rs/rsblkid/latest/rsblkid/partition/enum.FileSystem.html#variants)
in `rsblkid`.
It would be nice if I could double-check its accuracy from an official
reference.
B6 - Is there a list of all tags supported by `libblkid`?
By searching the source code, I managed to constitute a list of supported tags
gathered in the enum
[`Tag`](https://docs.rs/rsblkid/latest/rsblkid/device/enum.Tag.html#variants)
in `rsblkid`.
It would be nice if I could double-check its accuracy from an official
reference.
## libfdisk
F1 - What is a `grain size`?
The documentation of `fdisk_get_grain_size` says "grain in bytes used to align
partitions (usually 1MiB)" but does not elaborate.
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libfdisk-docs/libfdisk-Context.html#fdisk-get-grain-size
I stumbled on this answer about partition alignment during my search:
"What is partition alignment and why whould I need it?"
https://superuser.com/a/393918
Is it what `fdisk_get_grain_size` is refering to?
F2 - Are `fdisk_labelitem_*` supposed to have globally unique values, or is the
overlap intentional?
The way they are currently defined `SUN_LABELITEM_LABELID`,
`BSD_LABELITEM_TYPE`,`SGI_LABELITEM_PCYLCOUNT` , and `GPT_LABELITEM_FIRSTLBA`
end up having the same numerical value i.e. `__FDISK_NLABELITEMS = 8`.
As I understand it, these LABELITEM are fields in a partition table header for
their respective partition table types.
To represent them in Rust, I use
[HeaderEntry](https://docs.rs/rsfdisk/latest/rsfdisk/partition_table/enum.HeaderEntry.html#)
which groups the LABELITEMs in a unified enum.
This enum uses a workaround to convert a `HeaderEntry` to the native `u32`
value used by `libfdisk`
https://github.com/nickpiaddo/rsfdisk/blob/main/src/core/partition_table/header_entry_enum.rs
But converting back from `u32` to `HeaderEntry` is all but impossible if the
value of each `fdisk_labelitem_*` is not globally unique.
See their definitions below.
https://github.com/util-linux/util-linux/blob/8aa25617467a1249669cff7240ca31973bf9a127/libfdisk/src/libfdisk.h.in#L414-L425
```C
/**
* fdisk_labelitem_gen:
* @FDISK_LABELITEM_ID: Unique disk identifier
* @__FDISK_NLABELITEMS: Specifies reserved range for generic items (0..7)
*
* Generic disklabel items.
*/
enum fdisk_labelitem_gen {
FDISK_LABELITEM_ID = 0,
__FDISK_NLABELITEMS = 8
};
```
https://github.com/util-linux/util-linux/blob/8aa25617467a1249669cff7240ca31973bf9a127/libfdisk/src/libfdisk.h.in#L634-L655
```C
/**
* fdisk_labelitem_sun:
* @SUN_LABELITEM_LABELID: Label ID
* @SUN_LABELITEM_VTOCID: Volume ID
* @SUN_LABELITEM_RPM: Rpm
* @SUN_LABELITEM_ACYL: Alternate cylinders
* @SUN_LABELITEM_PCYL: Physical cylinders
* @SUN_LABELITEM_APC: Extra sects/cyl
* @SUN_LABELITEM_INTRLV: Interleave
*
* SUN specific label items.
*/
enum fdisk_labelitem_sun {
SUN_LABELITEM_LABELID = __FDISK_NLABELITEMS,
SUN_LABELITEM_VTOCID,
SUN_LABELITEM_RPM,
SUN_LABELITEM_ACYL,
SUN_LABELITEM_PCYL,
SUN_LABELITEM_APC,
SUN_LABELITEM_INTRLV
};
```
https://github.com/util-linux/util-linux/blob/8aa25617467a1249669cff7240ca31973bf9a127/libfdisk/src/libfdisk.h.in#L661-L697
```C
/**
* fdisk_labelitem_bsd:
* @BSD_LABELITEM_TYPE: type
* @BSD_LABELITEM_DISK: disk
* @BSD_LABELITEM_PACKNAME: packname
* @BSD_LABELITEM_FLAGS: flags (removable, ecc, badsect)
* @BSD_LABELITEM_SECSIZE: Bytes/Sector
* @BSD_LABELITEM_NTRACKS: Tracks/Cylinder
* @BSD_LABELITEM_SECPERCYL: Sectors/Cylinder
* @BSD_LABELITEM_CYLINDERS: Cylinders
* @BSD_LABELITEM_RPM: rpm
* @BSD_LABELITEM_INTERLEAVE: interleave
* @BSD_LABELITEM_TRACKSKEW: trackskew
* @BSD_LABELITEM_CYLINDERSKEW: cylinderskew
* @BSD_LABELITEM_HEADSWITCH: headswitch
* @BSD_LABELITEM_TRKSEEK: track-to-track seek
*
* BSD specific label items.
*/
enum fdisk_labelitem_bsd {
/* specific */
BSD_LABELITEM_TYPE = __FDISK_NLABELITEMS,
BSD_LABELITEM_DISK,
BSD_LABELITEM_PACKNAME,
BSD_LABELITEM_FLAGS,
BSD_LABELITEM_SECSIZE,
BSD_LABELITEM_NTRACKS,
BSD_LABELITEM_SECPERCYL,
BSD_LABELITEM_CYLINDERS,
BSD_LABELITEM_RPM,
BSD_LABELITEM_INTERLEAVE,
BSD_LABELITEM_TRACKSKEW,
BSD_LABELITEM_CYLINDERSKEW,
BSD_LABELITEM_HEADSWITCH,
BSD_LABELITEM_TRKSEEK
};
```
https://github.com/util-linux/util-linux/blob/8aa25617467a1249669cff7240ca31973bf9a127/libfdisk/src/libfdisk.h.in#L704-L719
```C
/**
* fdisk_labelitem_sgi:
* @SGI_LABELITEM_PCYLCOUNT: Physical cylinders
* @SGI_LABELITEM_SPARECYL: Extra sects/cyl
* @SGI_LABELITEM_ILFACT: nterleave
* @SGI_LABELITEM_BOOTFILE: Bootfile
*
* SGI specific label items.
*/
enum fdisk_labelitem_sgi {
SGI_LABELITEM_PCYLCOUNT = __FDISK_NLABELITEMS,
SGI_LABELITEM_SPARECYL,
SGI_LABELITEM_ILFACT,
SGI_LABELITEM_BOOTFILE
};
```
https://github.com/util-linux/util-linux/blob/8aa25617467a1249669cff7240ca31973bf9a127/libfdisk/src/libfdisk.h.in#L775-L798
```C
/**
* fdisk_labelitem_gpt:
* @GPT_LABELITEM_ID: GPT disklabel UUID (!= partition UUID)
* @GPT_LABELITEM_FIRSTLBA: First Usable LBA
* @GPT_LABELITEM_LASTLBA: Last Usable LBA
* @GPT_LABELITEM_ALTLBA: Alternative LBA (backup header LBA)
* @GPT_LABELITEM_ENTRIESLBA: Partitions entries array LBA
* @GPT_LABELITEM_ENTRIESALLOC: Number of allocated entries in entries array
* @GPT_LABELITEM_ENTRIESLASTLBA: Last LBA where is entries array
*
* GPT specific label items.
*/
enum fdisk_labelitem_gpt {
/* generic */
GPT_LABELITEM_ID = FDISK_LABELITEM_ID,
/* specific */
GPT_LABELITEM_FIRSTLBA = __FDISK_NLABELITEMS,
GPT_LABELITEM_LASTLBA,
GPT_LABELITEM_ALTLBA,
GPT_LABELITEM_ENTRIESLBA,
GPT_LABELITEM_ENTRIESALLOC,
GPT_LABELITEM_ENTRIESLASTLBA
};
```
F3 - In the function `fdisk_locate_disklabel`, in what unit are `offset`, and
`size` expressed? bytes? sectors?
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libfdisk-docs/libfdisk-Label.html#fdisk-locate-disklabel
```text
int
fdisk_locate_disklabel (struct fdisk_context *cxt,
int n,
const char **name,
uint64_t *offset,
size_t *size);
Locate disklabel and returns info about n item of the label.
For example GPT is composed from three items, PMBR and GPT, n=0 return offset
to PMBR and n=1 return offset to GPT Header and n=2 returns offset to GPT array
of partitions, n=3 and n=4 returns location of the backup GPT label at the end
of the disk.
The function returns the current in-memory situation. It's possible that a
header location is modified by write operation, for example when enabled
minimization (see fdisk_gpt_enable_minimize()). In this case it's better to
call this function after fdisk_write_disklabel().
For more details see 'D' expert fdisk command.
Parameters
cxt context
n N item
name return item name
offset return offset where is item
size of the item
Returns
0 on success, <0 on error, 1 no more items.
```
## libmount
M1 - Does `libmount` plan to provide public functions to access/set the
private `fmt` field in `struct libmnt_table`?
From what I understand, `struct libmnt_table` is a generic data type used to
represent either of the following files:
- `/etc/fstab`
- `/proc/#/mountinfo`
- `/run/mount/utab`
- `/proc/swaps`
The `fmt` field helps distinguish each subtype, and being able to set it would
make it easier for me to instantiate the appropriate type Rust-side (i.e.
`FsTab`, `MountInfo`, `UTab`, `Swaps`).
https://github.com/util-linux/util-linux/blob/stable/v2.39/libmount/src/mountP.h#L252-L287
```C
/*
* fstab/mountinfo file
*/
struct libmnt_table {
int fmt; /* MNT_FMT_* file format */
int nents; /* number of entries */
int refcount; /* reference counter */
int comms; /* enable/disable comment parsing */
char *comm_intro; /* First comment in file */
char *comm_tail; /* Last comment in file */
struct libmnt_cache *cache; /* canonicalized paths/tags cache */
int (*errcb)(struct libmnt_table *tb,
const char *filename, int line);
int (*fltrcb)(struct libmnt_fs *fs, void *data);
void *fltrcb_data;
int noautofs; /* ignore autofs mounts */
struct list_head ents; /* list of entries (libmnt_fs) */
void *userdata;
};
/*
* Tab file format
*/
enum {
MNT_FMT_GUESS,
MNT_FMT_FSTAB, /* /etc/{fs,m}tab */
MNT_FMT_MTAB = MNT_FMT_FSTAB, /* alias */
MNT_FMT_MOUNTINFO, /* /proc/#/mountinfo */
MNT_FMT_UTAB, /* /run/mount/utab */
MNT_FMT_SWAPS /* /proc/swaps */
};
```
M2 - If we were to split `struct libmnt_fs` into one type per file format,
would we get data types resembling `struct entry_fstab`, `struct
entry_mountinfo`, `struct entry_utab`, `struct_swaps` described below?
As far as I can tell, `struct libmnt_fs` is a multi-purpose data type
representing a line in either of the following files:
- `/etc/fstab`
- `/proc/#/mountinfo`
- `/run/mount/utab`
- `/proc/swaps`
Each file has a distinct format. So, some fields present in `struct libmnt_fs`
do not apply to certain files.
https://github.com/util-linux/util-linux/blob/stable/v2.39/libmount/src/mountP.h#L188-L239
```C
/*
* This struct represents one entry in a fstab/mountinfo file.
* (note that fstab[1] means the first column from fstab, and so on...)
*/
struct libmnt_fs {
struct list_head ents;
struct libmnt_table *tab;
int refcount; /* reference counter */
unsigned int opts_age; /* to sync with optlist */
struct libmnt_optlist *optlist;
int id; /* mountinfo[1]: ID */
int parent; /* mountinfo[2]: parent */
dev_t devno; /* mountinfo[3]: st_dev */
char *bindsrc; /* utab, full path from fstab[1] for bind mounts */
char *source; /* fstab[1], mountinfo[10], swaps[1]:
* source dev, file, dir or TAG */
char *tagname; /* fstab[1]: tag name - "LABEL", "UUID", ..*/
char *tagval; /* tag value */
char *root; /* mountinfo[4]: root of the mount within the FS */
char *target; /* mountinfo[5], fstab[2]: mountpoint */
char *fstype; /* mountinfo[9], fstab[3]: filesystem type */
char *optstr; /* fstab[4], merged options */
char *vfs_optstr; /* mountinfo[6]: fs-independent (VFS) options */
char *opt_fields; /* mountinfo[7]: optional fields */
char *fs_optstr; /* mountinfo[11]: fs-dependent options */
char *user_optstr; /* userspace mount options */
char *attrs; /* mount attributes */
int freq; /* fstab[5]: dump frequency in days */
int passno; /* fstab[6]: pass number on parallel fsck */
/* /proc/swaps */
char *swaptype; /* swaps[2]: device type (partition, file, ...) */
off_t size; /* swaps[3]: swaparea size */
off_t usedsize; /* swaps[4]: used size */
int priority; /* swaps[5]: swap priority */
int flags; /* MNT_FS_* flags */
pid_t tid; /* /proc/<tid>/mountinfo otherwise zero */
char *comment; /* fstab comment */
void *userdata; /* library independent data */
};
```
### `/etc/fstab`
```C
struct entry_fstab {
struct list_head ents;
struct libmnt_table *tab;
int refcount; /* reference counter */
unsigned int opts_age; /* to sync with optlist */
struct libmnt_optlist *optlist;
char *bindsrc; /* utab, full path from fstab[1] for bind mounts */
char *source; /* fstab[1], mountinfo[10], swaps[1]:
* source dev, file, dir or TAG */
char *tagname; /* fstab[1]: tag name - "LABEL", "UUID", ..*/
char *tagval; /* tag value */
char *target; /* mountinfo[5], fstab[2]: mountpoint */
char *fstype; /* mountinfo[9], fstab[3]: filesystem type */
char *optstr; /* fstab[4], merged options */
char *user_optstr; /* userspace mount options */
char *attrs; /* mount attributes */
int freq; /* fstab[5]: dump frequency in days */
int passno; /* fstab[6]: pass number on parallel fsck */
char *comment; /* fstab comment */
void *userdata; /* library independent data */
};
```
### `/proc/#/mountinfo`
```C
struct entry_mountinfo {
struct list_head ents;
struct libmnt_table *tab;
int refcount; /* reference counter */
unsigned int opts_age; /* to sync with optlist */
struct libmnt_optlist *optlist;
int id; /* mountinfo[1]: ID */
int parent; /* mountinfo[2]: parent */
dev_t devno; /* mountinfo[3]: st_dev */
char *source; /* fstab[1], mountinfo[10], swaps[1]:
* source dev, file, dir or TAG */
char *root; /* mountinfo[4]: root of the mount within the FS */
char *target; /* mountinfo[5], fstab[2]: mountpoint */
char *fstype; /* mountinfo[9], fstab[3]: filesystem type */
char *vfs_optstr; /* mountinfo[6]: fs-independent (VFS) options */
char *opt_fields; /* mountinfo[7]: optional fields */
char *fs_optstr; /* mountinfo[11]: fs-dependent options */
char *user_optstr; /* userspace mount options */
pid_t tid; /* /proc/<tid>/mountinfo otherwise zero */
};
```
### `/run/mount/utab`
```C
struct entry_utab {
struct list_head ents;
struct libmnt_table *tab;
int refcount; /* reference counter */
unsigned int opts_age; /* to sync with optlist */
struct libmnt_optlist *optlist;
int id; /* mountinfo[1]: ID */
int parent; /* mountinfo[2]: parent */
dev_t devno; /* mountinfo[3]: st_dev */
char *bindsrc; /* utab, full path from fstab[1] for bind mounts */
char *source; /* fstab[1], mountinfo[10], swaps[1]:
* source dev, file, dir or TAG */
char *root; /* mountinfo[4]: root of the mount within the FS */
char *target; /* mountinfo[5], fstab[2]: mountpoint */
char *user_optstr; /* userspace mount options */
char *attrs; /* mount attributes */
void *userdata; /* library independent data */
};
```
### `/proc/swaps`
```C
struct entry_swaps {
struct list_head ents;
struct libmnt_table *tab;
int refcount; /* reference counter */
unsigned int opts_age; /* to sync with optlist */
struct libmnt_optlist *optlist;
char *source; /* fstab[1], mountinfo[10], swaps[1]:
* source dev, file, dir or TAG */
/* /proc/swaps */
char *swaptype; /* swaps[2]: device type (partition, file, ...) */
off_t size; /* swaps[3]: swaparea size */
off_t usedsize; /* swaps[4]: used size */
int priority; /* swaps[5]: swap priority */
};
```
M3 - About `struct libmnt_fs` mentioned in question `M2`, is the following a
good partition of which subsets of functions, acting on the struct, are
specific/exclusive to each type of file entry? (We assume that items not in
a union of the subsets below are shared between line types)
### Functions specific/exclusive to `/etc/fstab`
- `mnt_fs_append_comment`
- `mnt_fs_append_options `
- `mnt_fs_get_comment `
- `mnt_fs_get_freq `
- `mnt_fs_get_fstype `
- `mnt_fs_get_option `
- `mnt_fs_get_options `
- `mnt_fs_get_passno `
- `mnt_fs_get_source `
- `mnt_fs_get_tag `
- `mnt_fs_get_target `
- `mnt_fs_match_fstype `
- `mnt_fs_match_options `
- `mnt_fs_match_target `
- `mnt_fs_prepend_options `
- `mnt_fs_print_debug `
- `mnt_fs_set_comment `
- `mnt_fs_set_freq `
- `mnt_fs_set_fstype `
- `mnt_fs_set_options `
- `mnt_fs_set_passno `
- `mnt_fs_set_source `
- `mnt_fs_set_target `
- `mnt_fs_streq_target `
- `mnt_fs_to_mntent `
- `mnt_new_fs `
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-append-comment
```text
int
mnt_fs_append_comment (struct libmnt_fs *fs,
const char *comm);
See also mnt_fs_set_comment().
Parameters
fs fstab entry pointer
comm comment string
Returns
0 on success or <0 in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-append-options
```text
int
mnt_fs_append_options (struct libmnt_fs *fs,
const char *optstr);
Parses (splits) optstr and appends results to VFS, FS and userspace lists of options.
If optstr is NULL, then fs is not modified and 0 is returned.
Parameters
fs fstab/mtab/mountinfo entry
optstr mount options
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-comment
```text
const char *
mnt_fs_get_comment (struct libmnt_fs *fs);
Parameters
fs fstab/mtab/mountinfo entry pointer
Returns
0 on success, 1 when not found the name or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-freq
```text
int
mnt_fs_get_freq (struct libmnt_fs *fs);
Parameters
fs fstab/mtab/mountinfo entry pointer
Returns
dump frequency in days.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-fstype
```text
const char *
mnt_fs_get_fstype (struct libmnt_fs *fs);
Parameters
fs fstab/mtab/mountinfo entry pointer
Returns
pointer to filesystem type.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-option
```text
int
mnt_fs_get_option (struct libmnt_fs *fs,
const char *name,
char **value,
size_t *valsz);
Parameters
fs fstab/mtab/mountinfo entry pointer
name option name
value returns pointer to the beginning of the value (e.g. name=VALUE) or NULL
valsz returns size of options value or 0
Returns
0 on success, 1 when name not found or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-options
```text
const char *
mnt_fs_get_options (struct libmnt_fs *fs);
Parameters
fs fstab/mtab/mountinfo entry pointer
Returns
pointer to string or NULL in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-passno
```text
int
mnt_fs_get_passno (struct libmnt_fs *fs);
Parameters
fs fstab/mtab entry pointer
Returns
"pass number on parallel fsck".
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-source
```text
const char *
mnt_fs_get_source (struct libmnt_fs *fs);
Parameters
fs struct libmnt_file (fstab/mtab/mountinfo) fs
Returns
mount source. Note that the source could be unparsed TAG (LABEL/UUID). See also mnt_fs_get_srcpath() and mnt_fs_get_tag().
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-tag
```text
int
mnt_fs_get_tag (struct libmnt_fs *fs,
const char **name,
const char **value);
"TAG" is NAME=VALUE (e.g. LABEL=foo)
The TAG is the first column in the fstab file. The TAG or "srcpath" always has to be set for all entries.
See also mnt_fs_get_source().
char *src;
struct libmnt_fs *fs = mnt_table_find_target(tb, "/home", MNT_ITER_FORWARD);
if (!fs)
goto err;
src = mnt_fs_get_srcpath(fs);
if (!src) {
char *tag, *val;
if (mnt_fs_get_tag(fs, &tag, &val) == 0)
printf("%s: %s\n", tag, val); // LABEL or UUID
} else
printf("device: %s\n", src); // device or bind path
Parameters
fs fs
name returns pointer to NAME string
value returns pointer to VALUE string
Returns
0 on success or negative number in case a TAG is not defined.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-target
```text
const char *
mnt_fs_get_target (struct libmnt_fs *fs);
Parameters
fs fstab/mtab/mountinfo entry pointer
Returns
pointer to mountpoint path or NULL
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-match-fstype
```text
int
mnt_fs_match_fstype (struct libmnt_fs *fs,
const char *types);
For more details see mnt_match_fstype().
Parameters
fs filesystem
types filesystem name or comma delimited list of filesystems
Returns
1 if fs type is matching to types , else 0. The function returns 0 when types is NULL.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-match-options
```text
int
mnt_fs_match_options (struct libmnt_fs *fs,
const char *options);
For more details see mnt_match_options().
Parameters
fs filesystem
options comma delimited list of options (and nooptions)
Returns
1 if fs type is matching to options , else 0. The function returns 0 when types is NULL.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-match-target
```text
int
mnt_fs_match_target (struct libmnt_fs *fs,
const char *target,
struct libmnt_cache *cache);
Possible are three attempts: 1) compare target with fs->target
2) realpath(target ) with fs->target
3) realpath(target ) with realpath(fs->target ) if fs is not from /proc/self/mountinfo.
However, if mnt_cache_set_targets(cache, mtab) was called, and the path target or fs->target is found in the mtab , the canonicalization is is not performed (see mnt_resolve_target()).
The 2nd and 3rd attempts are not performed when cache is NULL.
Parameters
fs filesystem
target mountpoint path
cache tags/paths cache or NULL
Returns
1 if fs target is equal to target , else 0.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-prepend-options
```text
int
mnt_fs_prepend_options (struct libmnt_fs *fs,
const char *optstr);
Parses (splits) optstr and prepends the results to VFS, FS and userspace lists of options.
If optstr is NULL, then fs is not modified and 0 is returned.
Parameters
fs fstab/mtab/mountinfo entry
optstr mount options
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-print-debug
```text
int
mnt_fs_print_debug (struct libmnt_fs *fs,
FILE *file);
Parameters
fs fstab/mtab/mountinfo entry
file file stream
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-comment
```text
int
mnt_fs_set_comment (struct libmnt_fs *fs,
const char *comm);
Note that the comment has to be terminated by '\n' (new line), otherwise the whole filesystem entry will be written as a comment to the tabfile (e.g. fstab).
Parameters
fs fstab entry pointer
comm comment string
Returns
0 on success or <0 in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-freq
```text
int
mnt_fs_set_freq (struct libmnt_fs *fs,
int freq);
Parameters
fs fstab/mtab entry pointer
freq dump frequency in days
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-fstype
```text
int
mnt_fs_set_fstype (struct libmnt_fs *fs,
const char *fstype);
This function creates a private copy (strdup()) of fstype .
Parameters
fs fstab/mtab/mountinfo entry
fstype filesystem type
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-options
```text
int
mnt_fs_set_options (struct libmnt_fs *fs,
const char *optstr);
Splits optstr to VFS, FS and userspace mount options and updates relevant parts of fs .
Parameters
fs fstab/mtab/mountinfo entry pointer
optstr options string
Returns
0 on success, or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-passno
```text
int
mnt_fs_set_passno (struct libmnt_fs *fs,
int passno);
Parameters
fs fstab/mtab entry pointer
passno pass number
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-source
```text
int
mnt_fs_set_source (struct libmnt_fs *fs,
const char *source);
This function creates a private copy (strdup()) of source .
Parameters
fs fstab/mtab/mountinfo entry
source new source
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-target
```text
int
mnt_fs_set_target (struct libmnt_fs *fs,
const char *tgt);
This function creates a private copy (strdup()) of tgt .
Parameters
fs fstab/mtab/mountinfo entry
tgt mountpoint
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-streq-target
```text
int
mnt_fs_streq_target (struct libmnt_fs *fs,
const char *path);
Compares fs target path with path . The redundant slashes are ignored. This
function compares strings and does not canonicalize the paths. See also more
generic mnt_fs_match_target().
Parameters
fs fs
path mount point
Returns
1 if fs target path equal to path , otherwise 0.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-to-mntent
```text
int
mnt_fs_to_mntent (struct libmnt_fs *fs,
struct mntent **mnt);
Copies the information from fs to struct mntent mnt . If mnt is already set,
then the struct mntent items are reallocated and updated. See also
mnt_free_mntent().
Parameters
fs filesystem
mnt mount description (as described in mntent.h)
Returns
0 on success and a negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-new-fs
```text
struct libmnt_fs *
mnt_new_fs (void);
The initial refcount is 1, and needs to be decremented to release the resources of the filesystem.
Returns
newly allocated struct libmnt_fs.
```
### Functions specific/exclusive to `/proc/#/mountinfo`
- `mnt_fs_get_devno `
- `mnt_fs_get_fs_options `
- `mnt_fs_get_fstype `
- `mnt_fs_get_id `
- `mnt_fs_get_optional_fields `
- `mnt_fs_get_parent_id `
- `mnt_fs_get_propagation `
- `mnt_fs_get_root `
- `mnt_fs_get_target `
- `mnt_fs_get_tid `
- `mnt_fs_get_vfs_options `
- `mnt_fs_get_vfs_options_all `
- `mnt_fs_match_fstype `
- `mnt_fs_match_target `
- `mnt_fs_print_debug `
- `mnt_fs_strdup_options `
- `mnt_fs_streq_target `
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-devno
```text
dev_t
mnt_fs_get_devno (struct libmnt_fs *fs);
Parameters
fs /proc/self/mountinfo entry
Returns
value of st_dev for files on filesystem or 0 in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-fs-options
```text
const char *
mnt_fs_get_fs_options (struct libmnt_fs *fs);
Parameters
fs fstab/mtab/mountinfo entry pointer
Returns
pointer to superblock (fs-depend) mount option string or NULL.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-fstype
```text
const char *
mnt_fs_get_fstype (struct libmnt_fs *fs);
Parameters
fs fstab/mtab/mountinfo entry pointer
Returns
pointer to filesystem type.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-id
```text
int
mnt_fs_get_id (struct libmnt_fs *fs);
Parameters
fs /proc/self/mountinfo entry
Returns
mount ID (unique identifier of the mount) or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-optional-fields
```text
const char *
mnt_fs_get_optional_fields (struct libmnt_fs *fs);
Parameters
fs mountinfo entry pointer
Returns
pointer to string with mountinfo optional fields or NULL in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-parent-id
```text
int
mnt_fs_get_parent_id (struct libmnt_fs *fs);
Parameters
fs /proc/self/mountinfo entry
Returns
parent mount ID or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-propagation
```text
int
mnt_fs_get_propagation (struct libmnt_fs *fs,
unsigned long *flags);
Note that this function sets flags to zero if no propagation flags are found in
the mountinfo file. The kernel default is MS_PRIVATE, this flag is not stored
in the mountinfo file.
Parameters
fs mountinfo entry
flags returns propagation MS_* flags as present in the mountinfo file
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-root
```text
const char *
mnt_fs_get_root (struct libmnt_fs *fs);
Parameters
fs /proc/self/mountinfo entry
Returns
root of the mount within the filesystem or NULL
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-target
```text
const char *
mnt_fs_get_target (struct libmnt_fs *fs);
Parameters
fs fstab/mtab/mountinfo entry pointer
Returns
pointer to mountpoint path or NULL
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-tid
```text
pid_t
mnt_fs_get_tid (struct libmnt_fs *fs);
Parameters
fs /proc/tid/mountinfo entry
Returns
TID (task ID) for filesystems read from the mountinfo file
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-vfs-options
```text
const char *
mnt_fs_get_vfs_options (struct libmnt_fs *fs);
Parameters
fs fstab/mtab entry pointer
Returns
pointer to fs-independent (VFS) mount option string or NULL.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-vfs-options-all
```text
char *
mnt_fs_get_vfs_options_all (struct libmnt_fs *fs);
Parameters
fs fstab/mtab entry pointer
Returns
pointer to newlly allocated string (can be freed by free(3)) or NULL in case of
error. The string contains all (including defaults) mount options.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-match-fstype
```text
int
mnt_fs_match_fstype (struct libmnt_fs *fs,
const char *types);
For more details see mnt_match_fstype().
Parameters
fs filesystem
types filesystem name or comma delimited list of filesystems
Returns
1 if fs type is matching to types , else 0. The function returns 0 when types is NULL.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-match-target
```text
int
mnt_fs_match_target (struct libmnt_fs *fs,
const char *target,
struct libmnt_cache *cache);
Possible are three attempts: 1) compare target with fs->target
2) realpath(target ) with fs->target
3) realpath(target ) with realpath(fs->target ) if fs is not from /proc/self/mountinfo.
However, if mnt_cache_set_targets(cache, mtab) was called, and the path target
or fs->target is found in the mtab , the canonicalization is is not performed
(see mnt_resolve_target()).
The 2nd and 3rd attempts are not performed when cache is NULL.
Parameters
fs filesystem
target mountpoint path
cache tags/paths cache or NULL
Returns
1 if fs target is equal to target , else 0.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-print-debug
```text
int
mnt_fs_print_debug (struct libmnt_fs *fs,
FILE *file);
Parameters
fs fstab/mtab/mountinfo entry
file file stream
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-strdup-options
```text
char *
mnt_fs_strdup_options (struct libmnt_fs *fs);
Merges all mount options (VFS, FS and userspace) to one options string and
returns the result. This function does not modify fs .
Parameters
fs
fstab/mtab/mountinfo entry pointer
Returns
pointer to string (can be freed by free(3)) or NULL in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-streq-target
```text
int
mnt_fs_streq_target (struct libmnt_fs *fs,
const char *path);
Compares fs target path with path . The redundant slashes are ignored. This
function compares strings and does not canonicalize the paths. See also more
generic mnt_fs_match_target().
Parameters
fs fs
path mount point
Returns
1 if fs target path equal to path , otherwise 0.
```
### Functions specific/exclusive to `/run/mount/utab`
- `mnt_fs_append_attributes `
- `mnt_fs_get_attribute `
- `mnt_fs_get_attributes `
- `mnt_fs_get_bindsrc `
- `mnt_fs_get_id `
- `mnt_fs_get_root `
- `mnt_fs_get_user_options `
- `mnt_fs_match_options `
- `mnt_fs_match_target `
- `mnt_fs_prepend_attributes `
- `mnt_fs_set_attributes `
- `mnt_fs_set_bindsrc `
- `mnt_fs_set_root `
- `mnt_fs_set_source `
- `mnt_fs_streq_target `
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-append-attributes
```text
int
mnt_fs_append_attributes (struct libmnt_fs *fs,
const char *optstr);
Appends mount attributes. (See mnt_fs_set_attributes()).
Parameters
fs fstab/mtab/mountinfo entry
optstr options string
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-attribute
```text
int
mnt_fs_get_attribute (struct libmnt_fs *fs,
const char *name,
char **value,
size_t *valsz);
Parameters
fs fstab/mtab/mountinfo entry pointer
name option name
value returns pointer to the beginning of the value (e.g. name=VALUE) or NULL
valsz returns size of options value or 0
Returns
0 on success, 1 when name not found or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-attributes
```text
const char *
mnt_fs_get_attributes (struct libmnt_fs *fs);
Parameters
fs fstab/mtab entry pointer
Returns
pointer to attributes string or NULL.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-bindsrc
```text
const char *
mnt_fs_get_bindsrc (struct libmnt_fs *fs);
Parameters
fs /run/mount/utab entry
Returns
full path that was used for mount(2) on MS_BIND
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-id
```text
int
mnt_fs_get_id (struct libmnt_fs *fs);
Parameters
fs /proc/self/mountinfo entry
Returns
mount ID (unique identifier of the mount) or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-root
```text
const char *
mnt_fs_get_root (struct libmnt_fs *fs);
Parameters
fs /proc/self/mountinfo entry
Returns
root of the mount within the filesystem or NULL
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-user-options
```text
const char *
mnt_fs_get_user_options (struct libmnt_fs *fs);
Parameters
fs fstab/mtab entry pointer
Returns
pointer to userspace mount option string or NULL.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-match-options
```text
int
mnt_fs_match_options (struct libmnt_fs *fs,
const char *options);
For more details see mnt_match_options().
Parameters
fs filesystem
options comma delimited list of options (and nooptions)
Returns
1 if fs type is matching to options , else 0. The function returns 0 when types is NULL.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-match-target
```text
int
mnt_fs_match_target (struct libmnt_fs *fs,
const char *target,
struct libmnt_cache *cache);
Possible are three attempts: 1) compare target with fs->target
2) realpath(target ) with fs->target
3) realpath(target ) with realpath(fs->target ) if fs is not from /proc/self/mountinfo.
However, if mnt_cache_set_targets(cache, mtab) was called, and the path target
or fs->target is found in the mtab , the canonicalization is is not performed
(see mnt_resolve_target()).
The 2nd and 3rd attempts are not performed when cache is NULL.
Parameters
fs filesystem
target mountpoint path
cache tags/paths cache or NULL
Returns
1 if fs target is equal to target , else 0.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-prepend-attributes
```text
int
mnt_fs_prepend_attributes (struct libmnt_fs *fs,
const char *optstr);
Prepends mount attributes. (See mnt_fs_set_attributes()).
Parameters
fs fstab/mtab/mountinfo entry
optstr options string
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-attributes
```text
int
mnt_fs_set_attributes (struct libmnt_fs *fs,
const char *optstr);
Sets mount attributes. The attributes are mount(2) and mount(8) independent
options, these options are not sent to the kernel and are not interpreted by
libmount. The attributes are stored in /run/mount/utab only.
The attributes are managed by libmount in userspace only. It's possible that
information stored in userspace will not be available for libmount after
CLONE_FS unshare. Be careful, and don't use attributes if possible.
Parameters
fs fstab/mtab/mountinfo entry
optstr options string
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-bindsrc
```text
int
mnt_fs_set_bindsrc (struct libmnt_fs *fs,
const char *src);
Parameters
fs filesystem
src path
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-root
```text
int
mnt_fs_set_root (struct libmnt_fs *fs,
const char *path);
Parameters
fs mountinfo entry
path root path
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-source
```text
int
mnt_fs_set_source (struct libmnt_fs *fs,
const char *source);
This function creates a private copy (strdup()) of source .
Parameters
fs fstab/mtab/mountinfo entry
source new source
Returns
0 on success or negative number in case of error.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-streq-target
```text
int
mnt_fs_streq_target (struct libmnt_fs *fs,
const char *path);
Compares fs target path with path . The redundant slashes are ignored. This
function compares strings and does not canonicalize the paths. See also more
generic mnt_fs_match_target().
Parameters
fs fs
path mount point
Returns
1 if fs target path equal to path , otherwise 0.
```
### Functions specific/exclusive to `/proc/swaps`
- `mnt_fs_get_priority `
- `mnt_fs_get_size `
- `mnt_fs_get_swaptype `
- `mnt_fs_get_usedsize `
- `mnt_fs_set_priority `
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-priority
```text
int
mnt_fs_get_priority (struct libmnt_fs *fs);
Parameters
fs /proc/swaps entry
Returns
priority
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-size
```text
off_t
mnt_fs_get_size (struct libmnt_fs *fs);
Parameters
fs /proc/swaps entry
Returns
size
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-swaptype
```text
const char *
mnt_fs_get_swaptype (struct libmnt_fs *fs);
Parameters
fs /proc/swaps entry
Returns
swap type or NULL
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-get-usedsize
```text
off_t
mnt_fs_get_usedsize (struct libmnt_fs *fs);
Parameters
fs /proc/swaps entry
Returns
used size
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-priority
```text
int
mnt_fs_set_priority (struct libmnt_fs *fs,
int prio);
Parameters
fs /proc/swaps entry
prio priority
Returns
0 or -1 in case of error
Since: 2.28
```
M4 - What role does the `userdata` field in `libmnt_fs` play? For which file
entry is it necessary? `fstab`, `mountinfo`, `utab`, `swaps`?
https://github.com/util-linux/util-linux/blob/8aa25617467a1249669cff7240ca31973bf9a127/libmount/src/mountP.h#L237
```C
void *userdata; /* library independent data */
```
M5 - Could anyone provide more information about the format used by the entries
in `/run/mount/utab`? Are the definitions reproduced below correct?
By reading the code for the `mnt_parse_utab_line` function, I identified the
following keys for possible key-value pairs in `/run/mount/utab`.
A cursory search on the web yielded these definitions:
- `SRC`: the mounted device,
- `TARGET`: the device’s mount point,
- `ROOT`: ??
- `BINDSRC`: the source of a bind mount,
- `OPTS`: mount options,
- `ATTRS`: options independent from those used by the mount syscall and mount
command. They are neither sent to the kernel, nor interpreted by libmount. They
are stored in /run/mount/utab, and managed by libmount in userspace only.
https://github.com/util-linux/util-linux/blob/8aa25617467a1249669cff7240ca31973bf9a127/libmount/src/tab_parse.c#L326-L368
```C
if (!fs->id && !strncmp(p, "ID=", 3)) {
int rc = 0;
end = next_s32(p + 3, &fs->id, &rc);
if (!end || rc)
return rc;
} else if (!fs->source && !strncmp(p, "SRC=", 4)) {
char *v = unmangle(p + 4, &end);
if (!v)
goto enomem;
if (__mnt_fs_set_source_ptr(fs, v))
free(v);
} else if (!fs->target && !strncmp(p, "TARGET=", 7)) {
fs->target = unmangle(p + 7, &end);
if (!fs->target)
goto enomem;
} else if (!fs->root && !strncmp(p, "ROOT=", 5)) {
fs->root = unmangle(p + 5, &end);
if (!fs->root)
goto enomem;
} else if (!fs->bindsrc && !strncmp(p, "BINDSRC=", 8)) {
fs->bindsrc = unmangle(p + 8, &end);
if (!fs->bindsrc)
goto enomem;
} else if (!fs->user_optstr && !strncmp(p, "OPTS=", 5)) {
fs->user_optstr = unmangle(p + 5, &end);
if (!fs->user_optstr)
goto enomem;
} else if (!fs->attrs && !strncmp(p, "ATTRS=", 6)) {
fs->attrs = unmangle(p + 6, &end);
if (!fs->attrs)
goto enomem;
} else {
/* unknown variable */
while (*p && *p != ' ') p++;
}
```
M6 - Can the `SRC` key mentioned in question `M5` have a:
- tag (UUID, PARTUUID, LABEL, etc.)
- network ID (Samba: `smb://ip-address-or-hostname/shared-dir`, SSHFS:
`user@ip-address-or-hostname:/shared-dir`, etc.)
as value? (e.g. SRC="UUID=ac4f36bf-191b-4fb0-b808-6d7fc9fc88be")
M7 - What does `mnt_fs_set_root` do? Is it meant for `/proc/self/mountinfo`,
`/run/mount/utab`, or both?
Although `libmnt_fs` can represent a line in `/proc/self/mountinfo`, files in
`/proc` are usually read-only, managed directly by the Linux kernel.
However, the docstring of `mnt_fs_set_root` says that it is supposed to modify
an entry in `/proc/self/mountinfo`.
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-root
```text
int
mnt_fs_set_root (struct libmnt_fs *fs,
const char *path);
Parameters
fs mountinfo entry
path root path
Returns
0 on success or negative number in case of error.
```
M8 - What is `mnt_context_apply_fstab` supposed to do?
The documentation only says "This function is optional".
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Library-high-level-context.html#mnt-context-apply-fstab
```text
int
mnt_context_apply_fstab (struct libmnt_context *cxt);
This function is optional.
Parameters
cxt mount context
Returns
0 on success, negative number in case of error.
```
M9 - Why does `mnt_optstr_prepend_option("", "ro", "recursive")` return
`"ro=recursive,"`, but `mnt_optstr_append_option("", "ro", "recursive")` return
`"ro=recursive"`? What is the extra comma after the keyword `recursive` output
by `mnt_optstr_prepend_option` for?
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Options-string.html#mnt-optstr-prepend-option
```text
int
mnt_optstr_prepend_option (char **optstr,
const char *name,
const char *value);
Parameters
optstr option string or NULL, returns a reallocated string
name value name
value value
Returns
0 on success or <0 in case of error. After an error the optstr should be unmodified.
```
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Options-string.html#mnt-optstr-append-option
```text
int
mnt_optstr_append_option (char **optstr,
const char *name,
const char *value);
Parameters
optstr option string or NULL, returns a reallocated string
name value name
value value
Returns
0 on success or <0 in case of error. After an error the optstr should be unmodified.
```
M10 - In option maps, what does using the mask `MNT_INVERT` do to mountflags
(e.g. `noatime`, `suid`, others)?
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Option-maps.html#MNT-INVERT:CAPS
```text
#define MNT_INVERT (1 << 1) /* invert the mountflag */
```
M11 - Which definition is correct, or am I conflating two notions?
The function `mnt_fs_set_freq` sets the backup frequency (in days) of a drive in
`/etc/fstab`. According to `libmount`, it takes an integer value.
But, from [An introduction to the Linux /etc/fstab
file](https://www.redhat.com/en/blog/etc-fstab) the value in the fifth column
on each line` in `/etc/fstab` can only take two values, `0 = no backup` or `1 =
dump utility backup of a partition`.
> Backup Operation: (the first digit) this is a binary system where 1 = dump
> utility backup of a partition. 0 = no backup. This is an outdated backup
> method and should NOT be used.
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/libmount-docs/libmount-Filesystem.html#mnt-fs-set-freq
```text
int
mnt_fs_set_freq (struct libmnt_fs *fs,
int freq);
Parameters
fs fstab/mtab entry pointer
freq dump frequency in days
Returns
0 on success or negative number in case of error.
```
Thank you for reading this far. Please accept my apologies for making you go
through this wall of text m(__)m
^ permalink raw reply
* [PATCH 6/6] treewide: replace postal address in license specifier with a terse URL
From: Benno Schulenberg @ 2025-06-02 14:14 UTC (permalink / raw)
To: util-linux
In-Reply-To: <20250602141436.11156-1-bensberg@telfort.nl>
This brings the license specifier into the internet age.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
disk-utils/fsck.cramfs.c | 5 ++---
disk-utils/mkfs.cramfs.c | 5 ++---
include/caputils.h | 5 ++---
include/plymouth-ctrl.h | 4 +---
lib/caputils.c | 5 ++---
lib/exec_shell.c | 5 ++---
lib/plymouth-ctrl.c | 4 +---
libblkid/src/blkid.h.in | 5 ++---
libfdisk/src/libfdisk.h.in | 5 ++---
libmount/python/context.c | 5 ++---
libmount/python/fs.c | 5 ++---
libmount/python/pylibmount.c | 5 ++---
libmount/python/tab.c | 5 ++---
libmount/src/libmount.h.in | 5 ++---
login-utils/last.1.adoc | 3 +--
login-utils/last.c | 3 +--
login-utils/lslogins.c | 5 ++---
login-utils/su-common.c | 8 ++++----
login-utils/sulogin-consoles.c | 4 +---
login-utils/sulogin-consoles.h | 4 +---
login-utils/sulogin.8.adoc | 3 +--
login-utils/sulogin.c | 3 +--
login-utils/utmpdump.1.adoc | 3 +--
login-utils/utmpdump.c | 3 +--
misc-utils/enosys.c | 5 ++---
misc-utils/fadvise.c | 5 ++---
misc-utils/fincore.c | 5 ++---
misc-utils/findmnt.c | 5 ++---
misc-utils/getopt.c | 5 ++---
misc-utils/lsblk.c | 5 ++---
misc-utils/lsclocks.c | 5 ++---
misc-utils/pipesz.c | 5 ++---
misc-utils/waitpid.c | 5 ++---
misc-utils/wipefs.c | 5 ++---
schedutils/chrt.1.adoc | 5 ++---
schedutils/chrt.c | 5 ++---
schedutils/sched_attr.h | 5 ++---
schedutils/taskset.1.adoc | 5 ++---
schedutils/taskset.c | 5 ++---
schedutils/uclampset.1.adoc | 5 ++---
schedutils/uclampset.c | 5 ++---
sys-utils/chcpu.c | 5 ++---
sys-utils/chmem.c | 5 ++---
sys-utils/choom.c | 5 ++---
sys-utils/fallocate.c | 5 ++---
sys-utils/ipcmk.c | 5 ++---
sys-utils/lsipc.c | 5 ++---
sys-utils/mount.8.adoc | 5 ++---
sys-utils/setpriv.c | 5 ++---
sys-utils/umount.8.adoc | 5 ++---
sys-utils/umount.c | 5 ++---
sys-utils/unshare.c | 5 ++---
sys-utils/wdctl.c | 5 ++---
sys-utils/zramctl.c | 5 ++---
tests/helpers/test_enosys.c | 5 ++---
tests/helpers/test_mkfds.c | 5 ++---
tests/helpers/test_mkfds.h | 5 ++---
tests/helpers/test_mkfds_ppoll.c | 5 ++---
58 files changed, 108 insertions(+), 169 deletions(-)
diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c
index b5d64c36a..8384bd5da 100644
--- a/disk-utils/fsck.cramfs.c
+++ b/disk-utils/fsck.cramfs.c
@@ -16,9 +16,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
* 1999/12/03: Linus Torvalds (cramfs tester and unarchive program)
* 2000/06/03: Daniel Quinlan (CRC and length checking program)
diff --git a/disk-utils/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c
index c8130055d..64d3a3371 100644
--- a/disk-utils/mkfs.cramfs.c
+++ b/disk-utils/mkfs.cramfs.c
@@ -15,9 +15,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
/*
diff --git a/include/caputils.h b/include/caputils.h
index 8fc214e7f..0a966d96e 100644
--- a/include/caputils.h
+++ b/include/caputils.h
@@ -9,9 +9,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#ifndef CAPUTILS_H
diff --git a/include/plymouth-ctrl.h b/include/plymouth-ctrl.h
index b6f129956..98bf6f88f 100644
--- a/include/plymouth-ctrl.h
+++ b/include/plymouth-ctrl.h
@@ -15,9 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
* Author: Werner Fink <werner@suse.de>
*/
diff --git a/lib/caputils.c b/lib/caputils.c
index 23866c071..6c71c06b8 100644
--- a/lib/caputils.c
+++ b/lib/caputils.c
@@ -9,9 +9,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <sys/prctl.h>
diff --git a/lib/exec_shell.c b/lib/exec_shell.c
index 96d3e95a8..ffe65f006 100644
--- a/lib/exec_shell.c
+++ b/lib/exec_shell.c
@@ -11,9 +11,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <stdlib.h>
diff --git a/lib/plymouth-ctrl.c b/lib/plymouth-ctrl.c
index 2d3deda07..81f9c9f7d 100644
--- a/lib/plymouth-ctrl.c
+++ b/lib/plymouth-ctrl.c
@@ -18,9 +18,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
* Author: Werner Fink <werner@suse.de>
*/
diff --git a/libblkid/src/blkid.h.in b/libblkid/src/blkid.h.in
index 91fc3b0be..db70d9e5a 100644
--- a/libblkid/src/blkid.h.in
+++ b/libblkid/src/blkid.h.in
@@ -15,9 +15,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#ifndef _BLKID_BLKID_H
diff --git a/libfdisk/src/libfdisk.h.in b/libfdisk/src/libfdisk.h.in
index be3b22e7a..7385755e4 100644
--- a/libfdisk/src/libfdisk.h.in
+++ b/libfdisk/src/libfdisk.h.in
@@ -13,9 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#ifndef _LIBFDISK_H
diff --git a/libmount/python/context.c b/libmount/python/context.c
index 36cf488f8..ca96ca5b8 100644
--- a/libmount/python/context.c
+++ b/libmount/python/context.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include "pylibmount.h"
diff --git a/libmount/python/fs.c b/libmount/python/fs.c
index a8e60eea7..cb48c43a1 100644
--- a/libmount/python/fs.c
+++ b/libmount/python/fs.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
/*
diff --git a/libmount/python/pylibmount.c b/libmount/python/pylibmount.c
index 03af1eeb0..e8c191602 100644
--- a/libmount/python/pylibmount.c
+++ b/libmount/python/pylibmount.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include "pylibmount.h"
diff --git a/libmount/python/tab.c b/libmount/python/tab.c
index 8401ee1b2..14a39da85 100644
--- a/libmount/python/tab.c
+++ b/libmount/python/tab.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include "pylibmount.h"
diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in
index 33c6381c8..9d173ff0e 100644
--- a/libmount/src/libmount.h.in
+++ b/libmount/src/libmount.h.in
@@ -16,9 +16,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#ifndef _LIBMOUNT_MOUNT_H
diff --git a/login-utils/last.1.adoc b/login-utils/last.1.adoc
index f3ee91c54..76079222f 100644
--- a/login-utils/last.1.adoc
+++ b/login-utils/last.1.adoc
@@ -13,8 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+along with this program. If not, see <https://gnu.org/licenses/>.
////
ifdef::neverdefined[---]
diff --git a/login-utils/last.c b/login-utils/last.c
index 0f202ceaf..85e3dfaeb 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -21,8 +21,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index b7f10667e..678f75c4c 100644
--- a/login-utils/lslogins.c
+++ b/login-utils/lslogins.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <stdio.h>
diff --git a/login-utils/su-common.c b/login-utils/su-common.c
index 4f2856e60..2cdeba857 100644
--- a/login-utils/su-common.c
+++ b/login-utils/su-common.c
@@ -13,10 +13,10 @@
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details. You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- * USA.
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
*
* Based on an implementation by David MacKenzie <djm@gnu.ai.mit.edu>.
diff --git a/login-utils/sulogin-consoles.c b/login-utils/sulogin-consoles.c
index 0dca949f4..cb9eb02bb 100644
--- a/login-utils/sulogin-consoles.c
+++ b/login-utils/sulogin-consoles.c
@@ -16,9 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
* Author: Werner Fink <werner@suse.de>
*/
diff --git a/login-utils/sulogin-consoles.h b/login-utils/sulogin-consoles.h
index 608c4f84f..d3b4298e4 100644
--- a/login-utils/sulogin-consoles.h
+++ b/login-utils/sulogin-consoles.h
@@ -15,9 +15,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program (see the file COPYING); if not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301, USA.
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
* Author: Werner Fink <werner@suse.de>
*/
diff --git a/login-utils/sulogin.8.adoc b/login-utils/sulogin.8.adoc
index db61ed4fb..52b749dc0 100644
--- a/login-utils/sulogin.8.adoc
+++ b/login-utils/sulogin.8.adoc
@@ -14,8 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+along with this program. If not, see <https://gnu.org/licenses/>.
////
ifdef::neverdefined[---]
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index cfc642070..0de850508 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -21,8 +21,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <sys/mman.h>
#include <sys/types.h>
diff --git a/login-utils/utmpdump.1.adoc b/login-utils/utmpdump.1.adoc
index 8dd21f09c..35468b6f7 100644
--- a/login-utils/utmpdump.1.adoc
+++ b/login-utils/utmpdump.1.adoc
@@ -13,8 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+along with this program. If not, see <https://gnu.org/licenses/>.
////
ifdef::neverdefined[---]
diff --git a/login-utils/utmpdump.c b/login-utils/utmpdump.c
index ce9ad718b..65de1628e 100644
--- a/login-utils/utmpdump.c
+++ b/login-utils/utmpdump.c
@@ -22,8 +22,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
diff --git a/misc-utils/enosys.c b/misc-utils/enosys.c
index 2d3d833d4..68e426c9d 100644
--- a/misc-utils/enosys.c
+++ b/misc-utils/enosys.c
@@ -11,9 +11,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <stddef.h>
diff --git a/misc-utils/fadvise.c b/misc-utils/fadvise.c
index 0b8cbb05c..abbc3a62d 100644
--- a/misc-utils/fadvise.c
+++ b/misc-utils/fadvise.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <fcntl.h>
diff --git a/misc-utils/fincore.c b/misc-utils/fincore.c
index 2f878abb6..c297c1045 100644
--- a/misc-utils/fincore.c
+++ b/misc-utils/fincore.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <sys/mman.h>
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index 1211bfa07..ee9371e69 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c
index ae35baaf8..70a7edf89 100644
--- a/misc-utils/getopt.c
+++ b/misc-utils/getopt.c
@@ -12,9 +12,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
/*
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
index da44bd631..af6ab0450 100644
--- a/misc-utils/lsblk.c
+++ b/misc-utils/lsblk.c
@@ -15,9 +15,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <stdio.h>
#include <errno.h>
diff --git a/misc-utils/lsclocks.c b/misc-utils/lsclocks.c
index 42a91fb94..24761bbd3 100644
--- a/misc-utils/lsclocks.c
+++ b/misc-utils/lsclocks.c
@@ -13,9 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <stdio.h>
diff --git a/misc-utils/pipesz.c b/misc-utils/pipesz.c
index 6eb5cc001..0d1a2fc92 100644
--- a/misc-utils/pipesz.c
+++ b/misc-utils/pipesz.c
@@ -13,9 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <getopt.h>
diff --git a/misc-utils/waitpid.c b/misc-utils/waitpid.c
index 379246b26..f108206a9 100644
--- a/misc-utils/waitpid.c
+++ b/misc-utils/waitpid.c
@@ -13,9 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <sys/epoll.h>
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c
index 04d8ae8c2..a215088a4 100644
--- a/misc-utils/wipefs.c
+++ b/misc-utils/wipefs.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/schedutils/chrt.1.adoc b/schedutils/chrt.1.adoc
index 3d3948050..77add535d 100644
--- a/schedutils/chrt.1.adoc
+++ b/schedutils/chrt.1.adoc
@@ -19,9 +19,8 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <https://gnu.org/licenses/>.
////
ifdef::neverdefined[---]
diff --git a/schedutils/chrt.c b/schedutils/chrt.c
index 075b592bb..cf99935dc 100644
--- a/schedutils/chrt.c
+++ b/schedutils/chrt.c
@@ -13,9 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
* Copyright (C) 2004 Robert Love
*/
diff --git a/schedutils/sched_attr.h b/schedutils/sched_attr.h
index e597bced8..4d437046b 100644
--- a/schedutils/sched_attr.h
+++ b/schedutils/sched_attr.h
@@ -8,9 +8,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
* Copyright (C) 2004 Robert Love
* Copyright (C) 2020-2021 Qais Yousef
diff --git a/schedutils/taskset.1.adoc b/schedutils/taskset.1.adoc
index 8c4d84dcc..9773303f7 100644
--- a/schedutils/taskset.1.adoc
+++ b/schedutils/taskset.1.adoc
@@ -17,9 +17,8 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <https://gnu.org/licenses/>.
////
ifdef::neverdefined[---]
diff --git a/schedutils/taskset.c b/schedutils/taskset.c
index dedcdf602..b52cd4338 100644
--- a/schedutils/taskset.c
+++ b/schedutils/taskset.c
@@ -10,9 +10,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
* Copyright (C) 2004 Robert Love
* Copyright (C) 2010 Karel Zak <kzak@redhat.com>
diff --git a/schedutils/uclampset.1.adoc b/schedutils/uclampset.1.adoc
index fb48b2bf8..001793b06 100644
--- a/schedutils/uclampset.1.adoc
+++ b/schedutils/uclampset.1.adoc
@@ -19,9 +19,8 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <https://gnu.org/licenses/>.
////
ifdef::neverdefined[---]
diff --git a/schedutils/uclampset.c b/schedutils/uclampset.c
index b1ae32b3d..7b7e3f22b 100644
--- a/schedutils/uclampset.c
+++ b/schedutils/uclampset.c
@@ -10,9 +10,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
* Copyright (C) 2020-2021 Qais Yousef
* Copyright (C) 2020-2021 Arm Ltd
diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c
index ab765a67e..4a2ce66ff 100644
--- a/sys-utils/chcpu.c
+++ b/sys-utils/chcpu.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <ctype.h>
diff --git a/sys-utils/chmem.c b/sys-utils/chmem.c
index 17d782f25..932d0af13 100644
--- a/sys-utils/chmem.c
+++ b/sys-utils/chmem.c
@@ -13,9 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <stdio.h>
#include <unistd.h>
diff --git a/sys-utils/choom.c b/sys-utils/choom.c
index 673b6f7e2..e818ab41d 100644
--- a/sys-utils/choom.c
+++ b/sys-utils/choom.c
@@ -13,9 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c
index fff75b03f..7b65481cc 100644
--- a/sys-utils/fallocate.c
+++ b/sys-utils/fallocate.c
@@ -17,9 +17,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/sys-utils/ipcmk.c b/sys-utils/ipcmk.c
index 5fa5869c6..cccb92c70 100644
--- a/sys-utils/ipcmk.c
+++ b/sys-utils/ipcmk.c
@@ -17,9 +17,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <errno.h>
diff --git a/sys-utils/lsipc.c b/sys-utils/lsipc.c
index a89ed4c5c..f0e81dbfd 100644
--- a/sys-utils/lsipc.c
+++ b/sys-utils/lsipc.c
@@ -17,9 +17,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
*
* lsipc is inspired by the ipcs utility. The aim is to create
diff --git a/sys-utils/mount.8.adoc b/sys-utils/mount.8.adoc
index 0e431004b..061e20aaa 100644
--- a/sys-utils/mount.8.adoc
+++ b/sys-utils/mount.8.adoc
@@ -25,9 +25,8 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <https://gnu.org/licenses/>.
////
ifdef::neverdefined[---]
diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c
index d714650e8..c6ff7718e 100644
--- a/sys-utils/setpriv.c
+++ b/sys-utils/setpriv.c
@@ -13,9 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <cap-ng.h>
diff --git a/sys-utils/umount.8.adoc b/sys-utils/umount.8.adoc
index 4f45dec7f..b91014cc7 100644
--- a/sys-utils/umount.8.adoc
+++ b/sys-utils/umount.8.adoc
@@ -20,9 +20,8 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <https://gnu.org/licenses/>.
////
ifdef::neverdefined[---]
diff --git a/sys-utils/umount.c b/sys-utils/umount.c
index d8ab3f7ca..c115f44a0 100644
--- a/sys-utils/umount.c
+++ b/sys-utils/umount.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <stdio.h>
diff --git a/sys-utils/unshare.c b/sys-utils/unshare.c
index fe140a0c7..e7c8c0f26 100644
--- a/sys-utils/unshare.c
+++ b/sys-utils/unshare.c
@@ -13,9 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <errno.h>
diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c
index 6559b5441..9290eb312 100644
--- a/sys-utils/wdctl.c
+++ b/sys-utils/wdctl.c
@@ -14,9 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <sys/ioctl.h>
#include <getopt.h>
diff --git a/sys-utils/zramctl.c b/sys-utils/zramctl.c
index fdb173ea5..175ad98d5 100644
--- a/sys-utils/zramctl.c
+++ b/sys-utils/zramctl.c
@@ -13,9 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <getopt.h>
diff --git a/tests/helpers/test_enosys.c b/tests/helpers/test_enosys.c
index 98f8d15ee..c6d1f7f60 100644
--- a/tests/helpers/test_enosys.c
+++ b/tests/helpers/test_enosys.c
@@ -11,9 +11,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include <err.h>
diff --git a/tests/helpers/test_mkfds.c b/tests/helpers/test_mkfds.c
index f7673c865..57f99e5a3 100644
--- a/tests/helpers/test_mkfds.c
+++ b/tests/helpers/test_mkfds.c
@@ -12,9 +12,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#include "c.h"
diff --git a/tests/helpers/test_mkfds.h b/tests/helpers/test_mkfds.h
index 7d679b44f..1002ee19d 100644
--- a/tests/helpers/test_mkfds.h
+++ b/tests/helpers/test_mkfds.h
@@ -12,9 +12,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*/
#ifndef TEST_MKFDS_H
diff --git a/tests/helpers/test_mkfds_ppoll.c b/tests/helpers/test_mkfds_ppoll.c
index fd1022616..2cd367b44 100644
--- a/tests/helpers/test_mkfds_ppoll.c
+++ b/tests/helpers/test_mkfds_ppoll.c
@@ -12,9 +12,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://gnu.org/licenses/>.
*
*/
--
2.48.1
^ permalink raw reply related
* [PATCH 5/6] docs: stop the copyright verbiage from getting included in the POT file
From: Benno Schulenberg @ 2025-06-02 14:14 UTC (permalink / raw)
To: util-linux
In-Reply-To: <20250602141436.11156-1-bensberg@telfort.nl>
For some reason the asciidoc parser from `po4a` includes *all* comments
from an adoc file into the util-linux-man.pot file. Xgettext had a way
to include only certain comments, but `po4a` does not appear to have a
dedicated mechanism for this.
So... use some bricolage: insert a fruitless 'ifdef' as a barrier
between the copyright/license comment and the title line. This
prevents `po4a` from seeing the two things as belonging together.
This shrinks the util-linux-man.pot file by 1267 lines (2.5%),
equivalent to nearly 67kB (4.8%).
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
disk-utils/addpart.8.adoc | 2 ++
disk-utils/blockdev.8.adoc | 2 ++
disk-utils/cfdisk.8.adoc | 2 ++
disk-utils/delpart.8.adoc | 2 ++
disk-utils/fdformat.8.adoc | 2 ++
disk-utils/fdisk.8.adoc | 2 ++
disk-utils/fsck.8.adoc | 2 ++
disk-utils/fsck.minix.8.adoc | 2 ++
disk-utils/mkfs.bfs.8.adoc | 2 ++
disk-utils/mkfs.minix.8.adoc | 2 ++
disk-utils/mkswap.8.adoc | 2 ++
disk-utils/partx.8.adoc | 2 ++
disk-utils/resizepart.8.adoc | 2 ++
disk-utils/sfdisk.8.adoc | 2 ++
disk-utils/swaplabel.8.adoc | 2 ++
lib/terminal-colors.d.5.adoc | 1 +
libblkid/libblkid.3.adoc | 2 ++
libsmartcols/scols-filter.5.adoc | 2 ++
libuuid/man/uuid.3.adoc | 2 ++
libuuid/man/uuid_clear.3.adoc | 2 ++
libuuid/man/uuid_compare.3.adoc | 2 ++
libuuid/man/uuid_copy.3.adoc | 2 ++
libuuid/man/uuid_generate.3.adoc | 2 ++
libuuid/man/uuid_is_null.3.adoc | 2 ++
libuuid/man/uuid_parse.3.adoc | 2 ++
libuuid/man/uuid_time.3.adoc | 2 ++
libuuid/man/uuid_unparse.3.adoc | 2 ++
login-utils/chfn.1.adoc | 2 ++
login-utils/chsh.1.adoc | 2 ++
login-utils/last.1.adoc | 2 ++
login-utils/login.1.adoc | 2 ++
login-utils/lslogins.1.adoc | 2 ++
login-utils/newgrp.1.adoc | 2 ++
login-utils/sulogin.8.adoc | 2 ++
login-utils/utmpdump.1.adoc | 2 ++
login-utils/vipw.8.adoc | 2 ++
lsfd-cmd/lsfd.1.adoc | 2 ++
misc-utils/blkid.8.adoc | 2 ++
misc-utils/cal.1.adoc | 2 ++
misc-utils/fincore.1.adoc | 2 ++
misc-utils/findfs.8.adoc | 2 ++
misc-utils/hardlink.1.adoc | 2 ++
misc-utils/kill.1.adoc | 2 ++
misc-utils/lastlog2.8.adoc | 2 ++
misc-utils/logger.1.adoc | 2 ++
misc-utils/look.1.adoc | 2 ++
misc-utils/lslocks.8.adoc | 2 ++
misc-utils/mcookie.1.adoc | 2 ++
misc-utils/rename.1.adoc | 2 ++
misc-utils/uuidd.8.adoc | 2 ++
misc-utils/uuidgen.1.adoc | 2 ++
misc-utils/uuidparse.1.adoc | 2 ++
misc-utils/whereis.1.adoc | 2 ++
misc-utils/wipefs.8.adoc | 2 ++
schedutils/chrt.1.adoc | 2 ++
schedutils/coresched.1.adoc | 4 +---
schedutils/taskset.1.adoc | 2 ++
schedutils/uclampset.1.adoc | 2 ++
sys-utils/ctrlaltdel.8.adoc | 2 ++
sys-utils/dmesg.1.adoc | 2 ++
sys-utils/eject.1.adoc | 2 ++
sys-utils/flock.1.adoc | 2 ++
sys-utils/fstab.5.adoc | 2 ++
sys-utils/hwclock.8.adoc | 2 ++
sys-utils/ipcmk.1.adoc | 2 ++
sys-utils/ipcrm.1.adoc | 2 ++
sys-utils/ipcs.1.adoc | 2 ++
sys-utils/ldattach.8.adoc | 2 ++
sys-utils/lsns.8.adoc | 2 ++
sys-utils/mount.8.adoc | 2 ++
sys-utils/prlimit.1.adoc | 2 ++
sys-utils/renice.1.adoc | 2 ++
sys-utils/setpgid.1.adoc | 2 ++
sys-utils/setsid.1.adoc | 2 ++
sys-utils/umount.8.adoc | 2 ++
term-utils/mesg.1.adoc | 2 ++
term-utils/script.1.adoc | 2 ++
term-utils/setterm.1.adoc | 2 ++
term-utils/wall.1.adoc | 2 ++
term-utils/write.1.adoc | 2 ++
text-utils/bits.1.adoc | 2 ++
text-utils/col.1.adoc | 2 ++
text-utils/colcrt.1.adoc | 2 ++
text-utils/colrm.1.adoc | 2 ++
text-utils/column.1.adoc | 2 ++
text-utils/hexdump.1.adoc | 2 ++
text-utils/line.1.adoc | 2 ++
text-utils/more.1.adoc | 2 ++
text-utils/pg.1.adoc | 2 ++
text-utils/rev.1.adoc | 2 ++
text-utils/ul.1.adoc | 2 ++
91 files changed, 180 insertions(+), 3 deletions(-)
diff --git a/disk-utils/addpart.8.adoc b/disk-utils/addpart.8.adoc
index 1c1a9dc04..ef3fe0673 100644
--- a/disk-utils/addpart.8.adoc
+++ b/disk-utils/addpart.8.adoc
@@ -5,6 +5,8 @@ Copyright 2007 Karel Zak <kzak@redhat.com>
Copyright 2007 Red Hat, Inc.
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= addpart(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/blockdev.8.adoc b/disk-utils/blockdev.8.adoc
index 3c4178b63..a923c563c 100644
--- a/disk-utils/blockdev.8.adoc
+++ b/disk-utils/blockdev.8.adoc
@@ -5,6 +5,8 @@ Copyright 2007 Karel Zak <kzak@redhat.com>
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= blockdev(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/cfdisk.8.adoc b/disk-utils/cfdisk.8.adoc
index 121d023ab..33bbd4af6 100644
--- a/disk-utils/cfdisk.8.adoc
+++ b/disk-utils/cfdisk.8.adoc
@@ -13,6 +13,8 @@ manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
////
+ifdef::neverdefined[---]
+
= cfdisk(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/delpart.8.adoc b/disk-utils/delpart.8.adoc
index e52e25419..be2e77c36 100644
--- a/disk-utils/delpart.8.adoc
+++ b/disk-utils/delpart.8.adoc
@@ -5,6 +5,8 @@ Copyright 2007 Karel Zak <kzak@redhat.com>
Copyright 2007 Red Hat, Inc.
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= delpart(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/fdformat.8.adoc b/disk-utils/fdformat.8.adoc
index d57f49d04..e717cb5c7 100644
--- a/disk-utils/fdformat.8.adoc
+++ b/disk-utils/fdformat.8.adoc
@@ -3,6 +3,8 @@
Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= fdformat(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/fdisk.8.adoc b/disk-utils/fdisk.8.adoc
index 13e7147bb..d53ab432a 100644
--- a/disk-utils/fdisk.8.adoc
+++ b/disk-utils/fdisk.8.adoc
@@ -6,6 +6,8 @@ Copyright 2012 Davidlohr Bueso <dave@gnu.org>
Copyright (C) 2013 Karel Zak <kzak@redhat.com>
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= fdisk(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/fsck.8.adoc b/disk-utils/fsck.8.adoc
index 8631bcd79..cfc4a072c 100644
--- a/disk-utils/fsck.8.adoc
+++ b/disk-utils/fsck.8.adoc
@@ -3,6 +3,8 @@
Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
This file may be copied under the terms of the GNU General Public License.
////
+ifdef::neverdefined[---]
+
= fsck(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/fsck.minix.8.adoc b/disk-utils/fsck.minix.8.adoc
index 37baaced5..7dfbc6688 100644
--- a/disk-utils/fsck.minix.8.adoc
+++ b/disk-utils/fsck.minix.8.adoc
@@ -3,6 +3,8 @@
Copyright 1992, 1993, 1994 Rickard E. Faith (faith@cs.unc.edu)
May be freely distributed.
////
+ifdef::neverdefined[---]
+
= fsck.minix(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/mkfs.bfs.8.adoc b/disk-utils/mkfs.bfs.8.adoc
index e66f8e0b5..647b0d5bb 100644
--- a/disk-utils/mkfs.bfs.8.adoc
+++ b/disk-utils/mkfs.bfs.8.adoc
@@ -3,6 +3,8 @@
Copyright 1999 Andries E. Brouwer (aeb@cwi.nl)
May be freely distributed.
////
+ifdef::neverdefined[---]
+
= mkfs.bfs(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/mkfs.minix.8.adoc b/disk-utils/mkfs.minix.8.adoc
index f747ee40f..99ff263fa 100644
--- a/disk-utils/mkfs.minix.8.adoc
+++ b/disk-utils/mkfs.minix.8.adoc
@@ -6,6 +6,8 @@ Copyright 2012 Davidlohr Bueso <dave@gnu.org>
Copyright (C) 2013 Karel Zak <kzak@redhat.com>
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= mkfs.minix(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/mkswap.8.adoc b/disk-utils/mkswap.8.adoc
index a7838ae91..ace8dde73 100644
--- a/disk-utils/mkswap.8.adoc
+++ b/disk-utils/mkswap.8.adoc
@@ -3,6 +3,8 @@
Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= mkswap(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/partx.8.adoc b/disk-utils/partx.8.adoc
index 180f1c32b..552cc6178 100644
--- a/disk-utils/partx.8.adoc
+++ b/disk-utils/partx.8.adoc
@@ -6,6 +6,8 @@ Copyright 2007 Red Hat, Inc.
Copyright 2010 Davidlohr Bueso <dave@gnu.org>
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= partx(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/resizepart.8.adoc b/disk-utils/resizepart.8.adoc
index b07680b61..e65215b55 100644
--- a/disk-utils/resizepart.8.adoc
+++ b/disk-utils/resizepart.8.adoc
@@ -5,6 +5,8 @@ Copyright 2012 Vivek Goyal <vgoyal@redhat.com>
Copyright 2012 Red Hat, Inc.
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= resizepart(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/sfdisk.8.adoc b/disk-utils/sfdisk.8.adoc
index ac81ec939..99849a638 100644
--- a/disk-utils/sfdisk.8.adoc
+++ b/disk-utils/sfdisk.8.adoc
@@ -12,6 +12,8 @@ manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
////
+ifdef::neverdefined[---]
+
= sfdisk(8)
:doctype: manpage
:man manual: System Administration
diff --git a/disk-utils/swaplabel.8.adoc b/disk-utils/swaplabel.8.adoc
index 0a1a1136f..94fc38d1f 100644
--- a/disk-utils/swaplabel.8.adoc
+++ b/disk-utils/swaplabel.8.adoc
@@ -3,6 +3,8 @@
Copyright 2010 Jason Borden <jborden@bluehost.com>
This file may be copied under the terms of the GNU General Public License.
////
+ifdef::neverdefined[---]
+
= swaplabel(8)
:doctype: manpage
:man manual: System Administration
diff --git a/lib/terminal-colors.d.5.adoc b/lib/terminal-colors.d.5.adoc
index 4936947b1..40ed8b966 100644
--- a/lib/terminal-colors.d.5.adoc
+++ b/lib/terminal-colors.d.5.adoc
@@ -6,6 +6,7 @@ Copyright (C) 2014 Karel Zak <kzak@redhat.com>
Copyright 2014 Red Hat, Inc.
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
= terminal-colors.d(5)
:doctype: manpage
diff --git a/libblkid/libblkid.3.adoc b/libblkid/libblkid.3.adoc
index 853d12134..9c92bc5c7 100644
--- a/libblkid/libblkid.3.adoc
+++ b/libblkid/libblkid.3.adoc
@@ -5,6 +5,8 @@ This man page was created for libblkid.so.1.0 from e2fsprogs-1.24.
This file may be copied under the terms of the GNU Lesser General Public License.
Created Wed Sep 14 12:02:12 2001, Andreas Dilger
////
+ifdef::neverdefined[---]
+
= libblkid(3)
:doctype: manpage
:man manual: Programmer's Manual
diff --git a/libsmartcols/scols-filter.5.adoc b/libsmartcols/scols-filter.5.adoc
index 939da7733..54a1b7251 100644
--- a/libsmartcols/scols-filter.5.adoc
+++ b/libsmartcols/scols-filter.5.adoc
@@ -4,6 +4,8 @@ Copyright (C) 2023 Karel Zak <kzak@redhat.com>
This file may be copied under the terms of the GNU General Public License.
////
+ifdef::neverdefined[---]
+
= scols-filter(5)
:doctype: manpage
:man manual: File formats and conventions
diff --git a/libuuid/man/uuid.3.adoc b/libuuid/man/uuid.3.adoc
index c8c6d66dd..df4b79277 100644
--- a/libuuid/man/uuid.3.adoc
+++ b/libuuid/man/uuid.3.adoc
@@ -30,6 +30,8 @@ DAMAGE.
Created Wed Mar 10 17:42:12 1999, Andreas Dilger
////
+ifdef::neverdefined[---]
+
= uuid(3)
:doctype: manpage
:man manual: Programmer's Manual
diff --git a/libuuid/man/uuid_clear.3.adoc b/libuuid/man/uuid_clear.3.adoc
index 48c3a59b5..4975ca76f 100644
--- a/libuuid/man/uuid_clear.3.adoc
+++ b/libuuid/man/uuid_clear.3.adoc
@@ -30,6 +30,8 @@ DAMAGE.
Created Wed Mar 10 17:42:12 1999, Andreas Dilger
////
+ifdef::neverdefined[---]
+
= uuid_clear(3)
:doctype: manpage
:man manual: Programmer's Manual
diff --git a/libuuid/man/uuid_compare.3.adoc b/libuuid/man/uuid_compare.3.adoc
index 600116750..9802e2bf1 100644
--- a/libuuid/man/uuid_compare.3.adoc
+++ b/libuuid/man/uuid_compare.3.adoc
@@ -30,6 +30,8 @@ DAMAGE.
Created Wed Mar 10 17:42:12 1999, Andreas Dilger
////
+ifdef::neverdefined[---]
+
= uuid_compare(3)
:doctype: manpage
:man manual: Programmer's Manual
diff --git a/libuuid/man/uuid_copy.3.adoc b/libuuid/man/uuid_copy.3.adoc
index 31c963dec..5323e8472 100644
--- a/libuuid/man/uuid_copy.3.adoc
+++ b/libuuid/man/uuid_copy.3.adoc
@@ -30,6 +30,8 @@ DAMAGE.
Created Wed Mar 10 17:42:12 1999, Andreas Dilger
////
+ifdef::neverdefined[---]
+
= uuid_copy(3)
:doctype: manpage
:man manual: Programmer's Manual
diff --git a/libuuid/man/uuid_generate.3.adoc b/libuuid/man/uuid_generate.3.adoc
index 420634d51..f8916eace 100644
--- a/libuuid/man/uuid_generate.3.adoc
+++ b/libuuid/man/uuid_generate.3.adoc
@@ -32,6 +32,8 @@ DAMAGE.
Created Wed Mar 10 17:42:12 1999, Andreas Dilger
////
+ifdef::neverdefined[---]
+
= uuid_generate(3)
:doctype: manpage
:man manual: Programmer's Manual
diff --git a/libuuid/man/uuid_is_null.3.adoc b/libuuid/man/uuid_is_null.3.adoc
index 23f2bf85f..ba62e3315 100644
--- a/libuuid/man/uuid_is_null.3.adoc
+++ b/libuuid/man/uuid_is_null.3.adoc
@@ -30,6 +30,8 @@ DAMAGE.
Created Wed Mar 10 17:42:12 1999, Andreas Dilger
////
+ifdef::neverdefined[---]
+
= uuid_is_null(3)
:doctype: manpage
:man manual: Programmer's Manual
diff --git a/libuuid/man/uuid_parse.3.adoc b/libuuid/man/uuid_parse.3.adoc
index 230023fd5..cecabe4cf 100644
--- a/libuuid/man/uuid_parse.3.adoc
+++ b/libuuid/man/uuid_parse.3.adoc
@@ -30,6 +30,8 @@ DAMAGE.
Created Wed Mar 10 17:42:12 1999, Andreas Dilger
////
+ifdef::neverdefined[---]
+
= uuid_parse(3)
:doctype: manpage
:man manual: Programmer's Manual
diff --git a/libuuid/man/uuid_time.3.adoc b/libuuid/man/uuid_time.3.adoc
index 5e579e240..3d57e5f96 100644
--- a/libuuid/man/uuid_time.3.adoc
+++ b/libuuid/man/uuid_time.3.adoc
@@ -30,6 +30,8 @@ DAMAGE.
Created Wed Mar 10 17:42:12 1999, Andreas Dilger
////
+ifdef::neverdefined[---]
+
= uuid_time(3)
:doctype: manpage
:man manual: Programmer's Manual
diff --git a/libuuid/man/uuid_unparse.3.adoc b/libuuid/man/uuid_unparse.3.adoc
index 20e8cfbab..13a8bec27 100644
--- a/libuuid/man/uuid_unparse.3.adoc
+++ b/libuuid/man/uuid_unparse.3.adoc
@@ -30,6 +30,8 @@ DAMAGE.
Created Wed Mar 10 17:42:12 1999, Andreas Dilger
////
+ifdef::neverdefined[---]
+
= uuid_unparse(3)
:doctype: manpage
:man manual: Programmer's Manual
diff --git a/login-utils/chfn.1.adoc b/login-utils/chfn.1.adoc
index 527c6806c..94f95831b 100644
--- a/login-utils/chfn.1.adoc
+++ b/login-utils/chfn.1.adoc
@@ -7,6 +7,8 @@ This program is free software. You can redistribute it and
modify it under the terms of the GNU General Public License.
There is no warranty.
////
+ifdef::neverdefined[---]
+
= chfn(1)
:doctype: manpage
:man manual: User Commands
diff --git a/login-utils/chsh.1.adoc b/login-utils/chsh.1.adoc
index e259b593f..b28e1fbed 100644
--- a/login-utils/chsh.1.adoc
+++ b/login-utils/chsh.1.adoc
@@ -7,6 +7,8 @@ This program is free software. You can redistribute it and
modify it under the terms of the GNU General Public License.
There is no warranty.
////
+ifdef::neverdefined[---]
+
= chsh(1)
:doctype: manpage
:man manual: User Commands
diff --git a/login-utils/last.1.adoc b/login-utils/last.1.adoc
index adf82ae73..f3ee91c54 100644
--- a/login-utils/last.1.adoc
+++ b/login-utils/last.1.adoc
@@ -16,6 +16,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
////
+ifdef::neverdefined[---]
+
= last(1)
:doctype: manpage
:man manual: User Commands
diff --git a/login-utils/login.1.adoc b/login-utils/login.1.adoc
index 88c260688..2e49b7b8c 100644
--- a/login-utils/login.1.adoc
+++ b/login-utils/login.1.adoc
@@ -3,6 +3,8 @@
Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= login(1)
:doctype: manpage
:man manual: User Commands
diff --git a/login-utils/lslogins.1.adoc b/login-utils/lslogins.1.adoc
index 7a344a7f4..1fa984768 100644
--- a/login-utils/lslogins.1.adoc
+++ b/login-utils/lslogins.1.adoc
@@ -1,6 +1,8 @@
//po4a: entry man manual
// Copyright 2014 Ondrej Oprala (ondrej.oprala@gmail.com)
// May be distributed under the GNU General Public License
+ifdef::neverdefined[---]
+
= lslogins(1)
:doctype: manpage
:man manual: User Commands
diff --git a/login-utils/newgrp.1.adoc b/login-utils/newgrp.1.adoc
index 0df01a3f7..046bb6bec 100644
--- a/login-utils/newgrp.1.adoc
+++ b/login-utils/newgrp.1.adoc
@@ -5,6 +5,8 @@
//
// Original author unknown. This man page is in the public domain.
// Modified Sat Oct 9 17:46:48 1993 by faith@cs.unc.edu
+ifdef::neverdefined[---]
+
= newgrp(1)
:doctype: manpage
:man manual: User Commands
diff --git a/login-utils/sulogin.8.adoc b/login-utils/sulogin.8.adoc
index 3165d6195..db61ed4fb 100644
--- a/login-utils/sulogin.8.adoc
+++ b/login-utils/sulogin.8.adoc
@@ -17,6 +17,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
////
+ifdef::neverdefined[---]
+
= sulogin(8)
:doctype: manpage
:man manual: System Administration
diff --git a/login-utils/utmpdump.1.adoc b/login-utils/utmpdump.1.adoc
index a7672d3d4..8dd21f09c 100644
--- a/login-utils/utmpdump.1.adoc
+++ b/login-utils/utmpdump.1.adoc
@@ -16,6 +16,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
////
+ifdef::neverdefined[---]
+
= utmpdump(1)
:doctype: manpage
:man manual: User Commands
diff --git a/login-utils/vipw.8.adoc b/login-utils/vipw.8.adoc
index 58acb9c4f..515252e6f 100644
--- a/login-utils/vipw.8.adoc
+++ b/login-utils/vipw.8.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)vipw.8 6.7 (Berkeley) 3/16/91
////
+ifdef::neverdefined[---]
+
= vipw(8)
:doctype: manpage
:man manual: System Administration
diff --git a/lsfd-cmd/lsfd.1.adoc b/lsfd-cmd/lsfd.1.adoc
index 9c4b8a0b5..2fa13b916 100644
--- a/lsfd-cmd/lsfd.1.adoc
+++ b/lsfd-cmd/lsfd.1.adoc
@@ -4,6 +4,8 @@ Copyright 2021 Red Hat, Inc.
This file may be copied under the terms of the GNU General Public License.
////
+ifdef::neverdefined[---]
+
= lsfd(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/blkid.8.adoc b/misc-utils/blkid.8.adoc
index 310ed3532..8ea98f07b 100644
--- a/misc-utils/blkid.8.adoc
+++ b/misc-utils/blkid.8.adoc
@@ -1,6 +1,8 @@
//po4a: entry man manual
// Copyright 2000 Andreas Dilger (adilger@turbolinux.com)
// This file may be copied under the terms of the GNU General Public License.
+ifdef::neverdefined[---]
+
= blkid(8)
:doctype: manpage
:man manual: System Administration
diff --git a/misc-utils/cal.1.adoc b/misc-utils/cal.1.adoc
index 43a9a3902..b4096ed15 100644
--- a/misc-utils/cal.1.adoc
+++ b/misc-utils/cal.1.adoc
@@ -36,6 +36,8 @@ SUCH DAMAGE.
@(#)cal.1 8.1 (Berkeley) 6/6/93
////
+ifdef::neverdefined[---]
+
= cal(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/fincore.1.adoc b/misc-utils/fincore.1.adoc
index 8403482d9..2d0ab248a 100644
--- a/misc-utils/fincore.1.adoc
+++ b/misc-utils/fincore.1.adoc
@@ -4,6 +4,8 @@ Copyright 2017 Red Hat, Inc.
This file may be copied under the terms of the GNU General Public License.
////
+ifdef::neverdefined[---]
+
= fincore(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/findfs.8.adoc b/misc-utils/findfs.8.adoc
index 5cc200305..8783cdc25 100644
--- a/misc-utils/findfs.8.adoc
+++ b/misc-utils/findfs.8.adoc
@@ -1,6 +1,8 @@
//po4a: entry man manual
// Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
// This file may be copied under the terms of the GNU General Public License.
+ifdef::neverdefined[---]
+
= findfs(8)
:doctype: manpage
:man manual: System Administration
diff --git a/misc-utils/hardlink.1.adoc b/misc-utils/hardlink.1.adoc
index 5788014d2..613f7a1d4 100644
--- a/misc-utils/hardlink.1.adoc
+++ b/misc-utils/hardlink.1.adoc
@@ -5,6 +5,8 @@ SPDX-License-Identifier: MIT
Copyright (C) 2008 - 2012 Julian Andres Klode. See hardlink.c for license.
Copyright (C) 2021 Karel Zak <kzak@redhat.com>
////
+ifdef::neverdefined[---]
+
= hardlink(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/kill.1.adoc b/misc-utils/kill.1.adoc
index 76027fb52..169f25866 100644
--- a/misc-utils/kill.1.adoc
+++ b/misc-utils/kill.1.adoc
@@ -4,6 +4,8 @@ Copyright 1994 Salvatore Valente (svalente@mit.edu)
Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= kill(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/lastlog2.8.adoc b/misc-utils/lastlog2.8.adoc
index 4857cfdce..40602f247 100644
--- a/misc-utils/lastlog2.8.adoc
+++ b/misc-utils/lastlog2.8.adoc
@@ -3,6 +3,8 @@
Copyright 2023 Thorsten Kukuk (kukuk@suse.de)
This file may be copied under the terms of the GNU General Public License.
////
+ifdef::neverdefined[---]
+
= lastlog2(8)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/logger.1.adoc b/misc-utils/logger.1.adoc
index e63f5eff8..f39d8cc70 100644
--- a/misc-utils/logger.1.adoc
+++ b/misc-utils/logger.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)logger.1 8.1 (Berkeley) 6/6/93
////
+ifdef::neverdefined[---]
+
= logger(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/look.1.adoc b/misc-utils/look.1.adoc
index 0ef71ece3..bdc791929 100644
--- a/misc-utils/look.1.adoc
+++ b/misc-utils/look.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)look.1 8.1 (Berkeley) 6/14/93
////
+ifdef::neverdefined[---]
+
= look(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/lslocks.8.adoc b/misc-utils/lslocks.8.adoc
index 2395d86fb..743f275f3 100644
--- a/misc-utils/lslocks.8.adoc
+++ b/misc-utils/lslocks.8.adoc
@@ -9,6 +9,8 @@ Copyright 1994 Salvatore Valente (svalente@mit.edu)
Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= lslocks(8)
:doctype: manpage
:man manual: System Administration
diff --git a/misc-utils/mcookie.1.adoc b/misc-utils/mcookie.1.adoc
index 9a77e4266..79a534b73 100644
--- a/misc-utils/mcookie.1.adoc
+++ b/misc-utils/mcookie.1.adoc
@@ -1,6 +1,8 @@
//po4a: entry man manual
// mcookie.1 --
// Public Domain 1995 Rickard E. Faith (faith@cs.unc.edu)
+ifdef::neverdefined[---]
+
= mcookie(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/rename.1.adoc b/misc-utils/rename.1.adoc
index 39b1496d5..b8ea2bfdf 100644
--- a/misc-utils/rename.1.adoc
+++ b/misc-utils/rename.1.adoc
@@ -5,6 +5,8 @@
//
// Written by Andries E. Brouwer (aeb@cwi.nl)
// Placed in the public domain
+ifdef::neverdefined[---]
+
= rename(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/uuidd.8.adoc b/misc-utils/uuidd.8.adoc
index f15d7b631..9658f0f41 100644
--- a/misc-utils/uuidd.8.adoc
+++ b/misc-utils/uuidd.8.adoc
@@ -3,6 +3,8 @@
Copyright 2007 by Theodore Ts'o. All Rights Reserved.
This file may be copied under the terms of the GNU General Public License.
////
+ifdef::neverdefined[---]
+
= uuidd(8)
:doctype: manpage
:man manual: System Administration
diff --git a/misc-utils/uuidgen.1.adoc b/misc-utils/uuidgen.1.adoc
index ce1d9e1a4..ac2db71fb 100644
--- a/misc-utils/uuidgen.1.adoc
+++ b/misc-utils/uuidgen.1.adoc
@@ -3,6 +3,8 @@
Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca)
This file may be copied under the terms of the GNU General Public License.
////
+ifdef::neverdefined[---]
+
= uuidgen(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/uuidparse.1.adoc b/misc-utils/uuidparse.1.adoc
index d517c1923..92a8d341d 100644
--- a/misc-utils/uuidparse.1.adoc
+++ b/misc-utils/uuidparse.1.adoc
@@ -1,6 +1,8 @@
//po4a: entry man manual
// Copyright (c) 2017 Sami Kerola
// The 3-Clause BSD License
+ifdef::neverdefined[---]
+
= uuidparse(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/whereis.1.adoc b/misc-utils/whereis.1.adoc
index 6a85e6c4c..e7ef4f7ce 100644
--- a/misc-utils/whereis.1.adoc
+++ b/misc-utils/whereis.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)whereis.1 from UCB 4.2
////
+ifdef::neverdefined[---]
+
= whereis(1)
:doctype: manpage
:man manual: User Commands
diff --git a/misc-utils/wipefs.8.adoc b/misc-utils/wipefs.8.adoc
index 7e75c7bba..4cf17745c 100644
--- a/misc-utils/wipefs.8.adoc
+++ b/misc-utils/wipefs.8.adoc
@@ -1,6 +1,8 @@
//po4a: entry man manual
// Copyright 2009 by Karel Zak. All Rights Reserved.
// This file may be copied under the terms of the GNU General Public License.
+ifdef::neverdefined[---]
+
= wipefs(8)
:doctype: manpage
:man manual: System Administration
diff --git a/schedutils/chrt.1.adoc b/schedutils/chrt.1.adoc
index 4f610b839..3d3948050 100644
--- a/schedutils/chrt.1.adoc
+++ b/schedutils/chrt.1.adoc
@@ -23,6 +23,8 @@ You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
////
+ifdef::neverdefined[---]
+
= chrt(1)
:doctype: manpage
:man manual: User Commands
diff --git a/schedutils/coresched.1.adoc b/schedutils/coresched.1.adoc
index 0d4c211f8..997b6ab36 100644
--- a/schedutils/coresched.1.adoc
+++ b/schedutils/coresched.1.adoc
@@ -1,7 +1,5 @@
//po4a: entry man manual
-////
-coresched(1) manpage
-////
+
= coresched(1)
:doctype: manpage
:man manual: User Commands
diff --git a/schedutils/taskset.1.adoc b/schedutils/taskset.1.adoc
index 056b1ca30..8c4d84dcc 100644
--- a/schedutils/taskset.1.adoc
+++ b/schedutils/taskset.1.adoc
@@ -21,6 +21,8 @@ You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
////
+ifdef::neverdefined[---]
+
= taskset(1)
:doctype: manpage
:man manual: User Commands
diff --git a/schedutils/uclampset.1.adoc b/schedutils/uclampset.1.adoc
index b3cdb4e7f..fb48b2bf8 100644
--- a/schedutils/uclampset.1.adoc
+++ b/schedutils/uclampset.1.adoc
@@ -23,6 +23,8 @@ You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
////
+ifdef::neverdefined[---]
+
= uclampset(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/ctrlaltdel.8.adoc b/sys-utils/ctrlaltdel.8.adoc
index 57842400c..9548a329c 100644
--- a/sys-utils/ctrlaltdel.8.adoc
+++ b/sys-utils/ctrlaltdel.8.adoc
@@ -3,6 +3,8 @@
Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= ctrlaltdel(8)
:doctype: manpage
:man manual: System Administration
diff --git a/sys-utils/dmesg.1.adoc b/sys-utils/dmesg.1.adoc
index 364c4aca4..24e79aa66 100644
--- a/sys-utils/dmesg.1.adoc
+++ b/sys-utils/dmesg.1.adoc
@@ -3,6 +3,8 @@
Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= dmesg(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/eject.1.adoc b/sys-utils/eject.1.adoc
index 6db040729..8f6bafd56 100644
--- a/sys-utils/eject.1.adoc
+++ b/sys-utils/eject.1.adoc
@@ -7,6 +7,8 @@ It may be distributed under the GNU General Public License, version 2, or
any higher version. See section COPYING of the GNU General Public license
for conditions under which this file may be redistributed.
////
+ifdef::neverdefined[---]
+
= eject(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/flock.1.adoc b/sys-utils/flock.1.adoc
index 247ab385f..1790f3f19 100644
--- a/sys-utils/flock.1.adoc
+++ b/sys-utils/flock.1.adoc
@@ -23,6 +23,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
////
+ifdef::neverdefined[---]
+
= flock(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/fstab.5.adoc b/sys-utils/fstab.5.adoc
index fb649d5f2..f5b4d0dcb 100644
--- a/sys-utils/fstab.5.adoc
+++ b/sys-utils/fstab.5.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)fstab.5 6.5 (Berkeley) 5/10/91
////
+ifdef::neverdefined[---]
+
= fstab(5)
:doctype: manpage
:man manual: File formats
diff --git a/sys-utils/hwclock.8.adoc b/sys-utils/hwclock.8.adoc
index 3ad02054f..145bd27af 100644
--- a/sys-utils/hwclock.8.adoc
+++ b/sys-utils/hwclock.8.adoc
@@ -6,6 +6,8 @@ hwclock.8 -- man page for util-linux' hwclock
Authored new section: DATE-TIME CONFIGURATION.
Subsections: Keeping Time..., LOCAL vs UTC, POSIX vs 'RIGHT'.
////
+ifdef::neverdefined[---]
+
= hwclock(8)
:doctype: manpage
:man manual: System Administration
diff --git a/sys-utils/ipcmk.1.adoc b/sys-utils/ipcmk.1.adoc
index 11e333387..8e1ad2fe6 100644
--- a/sys-utils/ipcmk.1.adoc
+++ b/sys-utils/ipcmk.1.adoc
@@ -3,6 +3,8 @@
Copyright 2008 Hayden A. James (hayden.james@gmail.com)
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= ipcmk(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/ipcrm.1.adoc b/sys-utils/ipcrm.1.adoc
index f4a8b4546..1f2960445 100644
--- a/sys-utils/ipcrm.1.adoc
+++ b/sys-utils/ipcrm.1.adoc
@@ -3,6 +3,8 @@
Copyright 2002 Andre C. Mazzone (linuxdev@karagee.com)
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= ipcrm(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/ipcs.1.adoc b/sys-utils/ipcs.1.adoc
index 0234232b4..0853205f0 100644
--- a/sys-utils/ipcs.1.adoc
+++ b/sys-utils/ipcs.1.adoc
@@ -3,6 +3,8 @@
Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= ipcs(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/ldattach.8.adoc b/sys-utils/ldattach.8.adoc
index 07549fb5a..6a51d672b 100644
--- a/sys-utils/ldattach.8.adoc
+++ b/sys-utils/ldattach.8.adoc
@@ -3,6 +3,8 @@
Copyright 2008 Tilman Schmidt (tilman@imap.cc)
May be distributed under the GNU General Public License version 2 or later
////
+ifdef::neverdefined[---]
+
= ldattach(8)
:doctype: manpage
:man manual: System Administration
diff --git a/sys-utils/lsns.8.adoc b/sys-utils/lsns.8.adoc
index 3cbe3504e..49f0d5b95 100644
--- a/sys-utils/lsns.8.adoc
+++ b/sys-utils/lsns.8.adoc
@@ -4,6 +4,8 @@ Man page for the lsns command.
Copyright 2015 Karel Zak <kzak@redhat.com>
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= lsns(8)
:doctype: manpage
:man manual: System Administration
diff --git a/sys-utils/mount.8.adoc b/sys-utils/mount.8.adoc
index f4f8669de..0e431004b 100644
--- a/sys-utils/mount.8.adoc
+++ b/sys-utils/mount.8.adoc
@@ -29,6 +29,8 @@ You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
////
+ifdef::neverdefined[---]
+
= mount(8)
:doctype: manpage
:man manual: System Administration
diff --git a/sys-utils/prlimit.1.adoc b/sys-utils/prlimit.1.adoc
index 4e839016d..fbfbc9f0a 100644
--- a/sys-utils/prlimit.1.adoc
+++ b/sys-utils/prlimit.1.adoc
@@ -4,6 +4,8 @@ prlimit.1 --
Copyright 2011 Davidlohr Bueso <dave@gnu.org>
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= prlimit(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/renice.1.adoc b/sys-utils/renice.1.adoc
index 5f2e2a98d..6d24c3c1c 100644
--- a/sys-utils/renice.1.adoc
+++ b/sys-utils/renice.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)renice.8 8.1 (Berkeley) 6/9/93
////
+ifdef::neverdefined[---]
+
= renice(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/setpgid.1.adoc b/sys-utils/setpgid.1.adoc
index 493038d55..91cd9d00e 100644
--- a/sys-utils/setpgid.1.adoc
+++ b/sys-utils/setpgid.1.adoc
@@ -5,6 +5,8 @@
//
// Daan De Meyer <daan.j.demeyer@gmail.com>
// In the public domain.
+ifdef::neverdefined[---]
+
= setpgid(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/setsid.1.adoc b/sys-utils/setsid.1.adoc
index 5cf49a597..9f9f9081b 100644
--- a/sys-utils/setsid.1.adoc
+++ b/sys-utils/setsid.1.adoc
@@ -1,6 +1,8 @@
//po4a: entry man manual
// Rick Sladkey <jrs@world.std.com>
// In the public domain.
+ifdef::neverdefined[---]
+
= setsid(1)
:doctype: manpage
:man manual: User Commands
diff --git a/sys-utils/umount.8.adoc b/sys-utils/umount.8.adoc
index b9a3ff963..4f45dec7f 100644
--- a/sys-utils/umount.8.adoc
+++ b/sys-utils/umount.8.adoc
@@ -24,6 +24,8 @@ You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
////
+ifdef::neverdefined[---]
+
= umount(8)
:doctype: manpage
:man manual: System Administration
diff --git a/term-utils/mesg.1.adoc b/term-utils/mesg.1.adoc
index df9adfd38..38135a8db 100644
--- a/term-utils/mesg.1.adoc
+++ b/term-utils/mesg.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)mesg.1 8.1 (Berkeley) 6/6/93
////
+ifdef::neverdefined[---]
+
= mesg(1)
:doctype: manpage
:man manual: User Commands
diff --git a/term-utils/script.1.adoc b/term-utils/script.1.adoc
index 7d9fa0eac..894115c5b 100644
--- a/term-utils/script.1.adoc
+++ b/term-utils/script.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)script.1 6.5 (Berkeley) 7/27/91
////
+ifdef::neverdefined[---]
+
= script(1)
:doctype: manpage
:man manual: User Commands
diff --git a/term-utils/setterm.1.adoc b/term-utils/setterm.1.adoc
index 89e21532e..fa511bc46 100644
--- a/term-utils/setterm.1.adoc
+++ b/term-utils/setterm.1.adoc
@@ -6,6 +6,8 @@ Copyright 2000 Colin Watson (cjw44@cam.ac.uk)
Do not restrict distribution.
May be distributed under the GNU General Public License
////
+ifdef::neverdefined[---]
+
= setterm(1)
:doctype: manpage
:man manual: User Commands
diff --git a/term-utils/wall.1.adoc b/term-utils/wall.1.adoc
index 441871d41..7c7936099 100644
--- a/term-utils/wall.1.adoc
+++ b/term-utils/wall.1.adoc
@@ -34,6 +34,8 @@ SUCH DAMAGE.
@(#)wall.1 6.5 (Berkeley) 4/23/91
////
+ifdef::neverdefined[---]
+
= wall(1)
:doctype: manpage
:man manual: User Commands
diff --git a/term-utils/write.1.adoc b/term-utils/write.1.adoc
index 22b537f2c..0a6a4717b 100644
--- a/term-utils/write.1.adoc
+++ b/term-utils/write.1.adoc
@@ -36,6 +36,8 @@ SUCH DAMAGE.
@(#)write.1 8.1 (Berkeley) 6/6/93
////
+ifdef::neverdefined[---]
+
= write(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/bits.1.adoc b/text-utils/bits.1.adoc
index b444c087e..770ad363e 100644
--- a/text-utils/bits.1.adoc
+++ b/text-utils/bits.1.adoc
@@ -11,6 +11,8 @@ the Free Software Foundation; either version 2 of the License, or
Copyright (c) 2024 Robin Jarry
////
+ifdef::neverdefined[---]
+
= bits(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/col.1.adoc b/text-utils/col.1.adoc
index bc1913a91..050332d58 100644
--- a/text-utils/col.1.adoc
+++ b/text-utils/col.1.adoc
@@ -36,6 +36,8 @@ SUCH DAMAGE.
@(#)col.1 6.8 (Berkeley) 6/17/91
////
+ifdef::neverdefined[---]
+
= col(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/colcrt.1.adoc b/text-utils/colcrt.1.adoc
index dee315531..e3bab5f9a 100644
--- a/text-utils/colcrt.1.adoc
+++ b/text-utils/colcrt.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)colcrt.1 8.1 (Berkeley) 6/30/93
////
+ifdef::neverdefined[---]
+
= colcrt(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/colrm.1.adoc b/text-utils/colrm.1.adoc
index 529133961..aa6f757cb 100644
--- a/text-utils/colrm.1.adoc
+++ b/text-utils/colrm.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)colrm.1 6.6 (Berkeley) 3/14/91
////
+ifdef::neverdefined[---]
+
= colrm(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/column.1.adoc b/text-utils/column.1.adoc
index 97b7fec5b..73a8676d2 100644
--- a/text-utils/column.1.adoc
+++ b/text-utils/column.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)column.1 8.1 (Berkeley) 6/6/93
////
+ifdef::neverdefined[---]
+
= column(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/hexdump.1.adoc b/text-utils/hexdump.1.adoc
index 33f889258..77ab798cf 100644
--- a/text-utils/hexdump.1.adoc
+++ b/text-utils/hexdump.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)hexdump.1 8.2 (Berkeley) 4/18/94
////
+ifdef::neverdefined[---]
+
= hexdump(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/line.1.adoc b/text-utils/line.1.adoc
index ecbc08817..05613ce62 100644
--- a/text-utils/line.1.adoc
+++ b/text-utils/line.1.adoc
@@ -4,6 +4,8 @@
// it what you wish.
//
// This page is in the public domain
+ifdef::neverdefined[---]
+
= line(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/more.1.adoc b/text-utils/more.1.adoc
index aad95e008..d40b79bae 100644
--- a/text-utils/more.1.adoc
+++ b/text-utils/more.1.adoc
@@ -36,6 +36,8 @@ SUCH DAMAGE.
Copyright (c) 1992 Rik Faith (faith@cs.unc.edu)
////
+ifdef::neverdefined[---]
+
= more(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/pg.1.adoc b/text-utils/pg.1.adoc
index 62b456e9a..3f4058956 100644
--- a/text-utils/pg.1.adoc
+++ b/text-utils/pg.1.adoc
@@ -1,5 +1,7 @@
//po4a: entry man manual
// Copyright 2001 Gunnar Ritter
+ifdef::neverdefined[---]
+
= pg(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/rev.1.adoc b/text-utils/rev.1.adoc
index 1cf375c27..d7b2002df 100644
--- a/text-utils/rev.1.adoc
+++ b/text-utils/rev.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)rev.1 6.3 (Berkeley) 3/21/92
////
+ifdef::neverdefined[---]
+
= rev(1)
:doctype: manpage
:man manual: User Commands
diff --git a/text-utils/ul.1.adoc b/text-utils/ul.1.adoc
index bc19e61d7..626ced162 100644
--- a/text-utils/ul.1.adoc
+++ b/text-utils/ul.1.adoc
@@ -33,6 +33,8 @@ SUCH DAMAGE.
@(#)ul.1 8.1 (Berkeley) 6/6/93
////
+ifdef::neverdefined[---]
+
= ul(1)
:doctype: manpage
:man manual: User Commands
--
2.48.1
^ permalink raw reply related
* [PATCH 4/6] docs: make the "po4a:" line the first line, like in all other .adoc files
From: Benno Schulenberg @ 2025-06-02 14:14 UTC (permalink / raw)
To: util-linux
In-Reply-To: <20250602141436.11156-1-bensberg@telfort.nl>
Also, there should be no space before "po4a:" for the line to be valid.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
login-utils/newgrp.1.adoc | 2 +-
misc-utils/rename.1.adoc | 2 +-
sys-utils/setpgid.1.adoc | 2 +-
text-utils/line.1.adoc | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/login-utils/newgrp.1.adoc b/login-utils/newgrp.1.adoc
index 521b73559..0df01a3f7 100644
--- a/login-utils/newgrp.1.adoc
+++ b/login-utils/newgrp.1.adoc
@@ -1,8 +1,8 @@
+//po4a: entry man manual
//
// No copyright is claimed. This code is in the public domain; do with
// it what you wish.
//
-// po4a: entry man manual
// Original author unknown. This man page is in the public domain.
// Modified Sat Oct 9 17:46:48 1993 by faith@cs.unc.edu
= newgrp(1)
diff --git a/misc-utils/rename.1.adoc b/misc-utils/rename.1.adoc
index 692f4b54f..39b1496d5 100644
--- a/misc-utils/rename.1.adoc
+++ b/misc-utils/rename.1.adoc
@@ -1,8 +1,8 @@
+//po4a: entry man manual
//
// No copyright is claimed. This code is in the public domain; do with
// it what you wish.
//
-// po4a: entry man manual
// Written by Andries E. Brouwer (aeb@cwi.nl)
// Placed in the public domain
= rename(1)
diff --git a/sys-utils/setpgid.1.adoc b/sys-utils/setpgid.1.adoc
index 0d43723e4..493038d55 100644
--- a/sys-utils/setpgid.1.adoc
+++ b/sys-utils/setpgid.1.adoc
@@ -1,8 +1,8 @@
+//po4a: entry man manual
//
// No copyright is claimed. This code is in the public domain; do with
// it what you wish.
//
-//po4a: entry man manual
// Daan De Meyer <daan.j.demeyer@gmail.com>
// In the public domain.
= setpgid(1)
diff --git a/text-utils/line.1.adoc b/text-utils/line.1.adoc
index 5ad85812d..ecbc08817 100644
--- a/text-utils/line.1.adoc
+++ b/text-utils/line.1.adoc
@@ -1,8 +1,8 @@
+//po4a: entry man manual
//
// No copyright is claimed. This code is in the public domain; do with
// it what you wish.
//
-// po4a: entry man manual
// This page is in the public domain
= line(1)
:doctype: manpage
--
2.48.1
^ permalink raw reply related
* [PATCH 3/6] correct the full name of the GPL in various files
From: Benno Schulenberg @ 2025-06-02 14:14 UTC (permalink / raw)
To: util-linux
In-Reply-To: <20250602141436.11156-1-bensberg@telfort.nl>
Last year, commit f4cb44bd11 corrected the full name of the GPL in
a dozen files, but still left the mistaken name in eight places.
(Also, in the first file, just reshuffle the license line, to be
in the same position as in other files.)
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
disk-utils/swaplabel.c | 7 +++----
include/ismounted.h | 4 ++--
| 3 ++-
lib/ismounted.c | 4 ++--
| 4 ++--
misc-utils/findfs.c | 4 ++--
misc-utils/uuidd.c | 4 ++--
misc-utils/uuidgen.c | 4 ++--
sys-utils/eject.1.adoc | 2 +-
9 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/disk-utils/swaplabel.c b/disk-utils/swaplabel.c
index 2c56e1501..29484ffe5 100644
--- a/disk-utils/swaplabel.c
+++ b/disk-utils/swaplabel.c
@@ -1,16 +1,15 @@
/*
* SPDX-License-Identifier: GPL-2.0-or-later
*
+ * This file may be redistributed under the terms of the
+ * GNU General Public License version 2 or later.
+ *
* swaplabel.c - Print or change the label / UUID of a swap partition
*
* Copyright (C) 2010 Jason Borden <jborden@bluehost.com>
* Copyright (C) 2010 Karel Zak <kzak@redhat.com>
*
* Usage: swaplabel [-L label] [-U UUID] device
- *
- * This file may be redistributed under the terms of the GNU General Public License
- * version 2 or later.
- *
*/
#include <stdio.h>
#include <stddef.h>
diff --git a/include/ismounted.h b/include/ismounted.h
index 62b1d26b5..c95cbde84 100644
--- a/include/ismounted.h
+++ b/include/ismounted.h
@@ -1,8 +1,8 @@
/*
* SPDX-License-Identifier: GPL-2.0-or-later
*
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the
+ * GNU General Public License.
*/
#ifndef IS_MOUNTED_H
#define IS_MOUNTED_H
--git a/include/pager.h b/include/pager.h
index e5ba4d721..2172177ee 100644
--- a/include/pager.h
+++ b/include/pager.h
@@ -1,7 +1,8 @@
/*
* SPDX-License-Identifier: GPL-2.0-or-later
*
- * This file may be redistributed under the terms of the GNU General Public License.
+ * This file may be redistributed under the terms of the
+ * GNU General Public License.
*/
#ifndef UTIL_LINUX_PAGER
#define UTIL_LINUX_PAGER
diff --git a/lib/ismounted.c b/lib/ismounted.c
index 31be71a43..ae5327c90 100644
--- a/lib/ismounted.c
+++ b/lib/ismounted.c
@@ -3,8 +3,8 @@
*
* Copyright (C) 1995,1996,1997,1998,1999,2000,2008 Theodore Ts'o.
*
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the
+ * GNU General Public License.
*/
#include <stdio.h>
#include <unistd.h>
--git a/lib/pager.c b/lib/pager.c
index 20002acda..c3b42d19e 100644
--- a/lib/pager.c
+++ b/lib/pager.c
@@ -1,8 +1,8 @@
/*
* SPDX-License-Identifier: GPL-2.0-or-later
*
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the
+ * GNU General Public License.
*
* Based on linux-perf/git scm
*
diff --git a/misc-utils/findfs.c b/misc-utils/findfs.c
index 7b32dbda3..801a60c32 100644
--- a/misc-utils/findfs.c
+++ b/misc-utils/findfs.c
@@ -1,8 +1,8 @@
/*
* Copyright (C) 2009 Karel Zak <kzak@redhat.com>
*
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the
+ * GNU General Public License.
*/
#include <stdio.h>
#include <stdlib.h>
diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c
index 74e950307..95cf1a572 100644
--- a/misc-utils/uuidd.c
+++ b/misc-utils/uuidd.c
@@ -4,8 +4,8 @@
* Copyright (C) 2007 Theodore Ts'o
*
* %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the
+ * GNU General Public License.
* %End-Header%
*/
diff --git a/misc-utils/uuidgen.c b/misc-utils/uuidgen.c
index 56dea3c71..6133cb0eb 100644
--- a/misc-utils/uuidgen.c
+++ b/misc-utils/uuidgen.c
@@ -4,8 +4,8 @@
* Copyright (C) 1999, Andreas Dilger and Theodore Ts'o
*
* %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the
+ * GNU General Public License.
* %End-Header%
*/
diff --git a/sys-utils/eject.1.adoc b/sys-utils/eject.1.adoc
index 1ee3b2137..6db040729 100644
--- a/sys-utils/eject.1.adoc
+++ b/sys-utils/eject.1.adoc
@@ -4,7 +4,7 @@ Copyright (C) 1994-2005 Jeff Tranter (tranter@pobox.com)
Copyright (C) 2012 Karel Zak <kzak@redhat.com>.
It may be distributed under the GNU General Public License, version 2, or
-any higher version. See section COPYING of the GNU Public license
+any higher version. See section COPYING of the GNU General Public license
for conditions under which this file may be redistributed.
////
= eject(1)
--
2.48.1
^ permalink raw reply related
* [PATCH 2/6] remove "Copyright (C) ...." notes from files that claim no copyright
From: Benno Schulenberg @ 2025-06-02 14:14 UTC (permalink / raw)
To: util-linux
In-Reply-To: <20250602141436.11156-1-bensberg@telfort.nl>
Replace them with a "Written by" or "Authors:" label.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
include/color-names.h | 2 +-
include/procfs.h | 2 +-
include/sysfs.h | 2 +-
lib/color-names.c | 2 +-
lib/langinfo.c | 8 ++++----
lib/mangle.c | 2 +-
lib/path.c | 2 +-
lib/procfs.c | 2 +-
lib/strutils.c | 6 +++---
lib/sysfs.c | 2 +-
10 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/include/color-names.h b/include/color-names.h
index d6a5267b2..af8e075d5 100644
--- a/include/color-names.h
+++ b/include/color-names.h
@@ -2,7 +2,7 @@
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
- * Copyright (C) 2012-2015 Karel Zak <kzak@redhat.com>
+ * Written by Karel Zak <kzak@redhat.com> [2012]
*/
#ifndef UTIL_LINUX_COLOR_NAMES_H
#define UTIL_LINUX_COLOR_NAMES_H
diff --git a/include/procfs.h b/include/procfs.h
index fdfe1455b..d90146fc5 100644
--- a/include/procfs.h
+++ b/include/procfs.h
@@ -2,7 +2,7 @@
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
- * Copyright (C) 2021 Karel Zak <kzak@redhat.com>
+ * Written by Karel Zak <kzak@redhat.com> [2021]
*/
#ifndef UTIL_LINUX_PROCFS_H
#define UTIL_LINUX_PROCFS_H
diff --git a/include/sysfs.h b/include/sysfs.h
index 8d77f7579..758340702 100644
--- a/include/sysfs.h
+++ b/include/sysfs.h
@@ -2,7 +2,7 @@
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
- * Copyright (C) 2011 Karel Zak <kzak@redhat.com>
+ * Written by Karel Zak <kzak@redhat.com> [2011]
*/
#ifndef UTIL_LINUX_SYSFS_H
#define UTIL_LINUX_SYSFS_H
diff --git a/lib/color-names.c b/lib/color-names.c
index fa5453c6b..ec53e3d47 100644
--- a/lib/color-names.c
+++ b/lib/color-names.c
@@ -2,7 +2,7 @@
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
- * Copyright (C) 2012-2015 Karel Zak <kzak@redhat.com>
+ * Written by Karel Zak <kzak@redhat.com> [2012]
*/
#include "c.h"
#include "color-names.h"
diff --git a/lib/langinfo.c b/lib/langinfo.c
index a20008546..8a5af8e55 100644
--- a/lib/langinfo.c
+++ b/lib/langinfo.c
@@ -1,13 +1,13 @@
/*
- * This is callback solution for systems without nl_langinfo(), this function
- * returns hardcoded and on locale setting indepndent value.
+ * This is a fallback solution for systems without nl_langinfo(). This
+ * function returns a hardcoded value, independent from locale settings.
*
- * See langinfo.h man page for more details.
+ * See `man langinfo.h` for more details.
*
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
- * Copyright (C) 2010 Karel Zak <kzak@redhat.com>
+ * Written by Karel Zak <kzak@redhat.com> [2010]
*/
#include "nls.h"
diff --git a/lib/mangle.c b/lib/mangle.c
index 2d31943cb..4c505bce7 100644
--- a/lib/mangle.c
+++ b/lib/mangle.c
@@ -4,7 +4,7 @@
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
- * Copyright (C) 2010 Karel Zak <kzak@redhat.com>
+ * Written by Karel Zak <kzak@redhat.com> [2010]
*/
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/path.c b/lib/path.c
index 42a33ffc5..48324d6dc 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -2,7 +2,7 @@
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
- * Copyright (C) 2018 Karel Zak <kzak@redhat.com>
+ * Written by Karel Zak <kzak@redhat.com> [2018]
*
*
* Simple functions to access files. Paths can be globally prefixed to read
diff --git a/lib/procfs.c b/lib/procfs.c
index 136ec7c05..5dab11b88 100644
--- a/lib/procfs.c
+++ b/lib/procfs.c
@@ -2,7 +2,7 @@
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
- * Copyright (C) 2021 Karel Zak <kzak@redhat.com>
+ * Written by Karel Zak <kzak@redhat.com> [2021]
*/
#include <ctype.h>
#include <unistd.h>
diff --git a/lib/strutils.c b/lib/strutils.c
index 64fefa878..de0be7596 100644
--- a/lib/strutils.c
+++ b/lib/strutils.c
@@ -1,9 +1,9 @@
/*
- * Copyright (C) 2010 Karel Zak <kzak@redhat.com>
- * Copyright (C) 2010 Davidlohr Bueso <dave@gnu.org>
- *
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
+ *
+ * Authors: Karel Zak <kzak@redhat.com> [2010]
+ * Davidlohr Bueso <dave@gnu.org> [2010]
*/
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/sysfs.c b/lib/sysfs.c
index 0a016be97..951de6332 100644
--- a/lib/sysfs.c
+++ b/lib/sysfs.c
@@ -2,7 +2,7 @@
* No copyright is claimed. This code is in the public domain; do with
* it what you wish.
*
- * Copyright (C) 2011 Karel Zak <kzak@redhat.com>
+ * Written by Karel Zak <kzak@redhat.com> [2011]
*/
#include <ctype.h>
#include <libgen.h>
--
2.48.1
^ permalink raw reply related
* [PATCH 1/6] remove two leftover license lines from colors.{c,h}
From: Benno Schulenberg @ 2025-06-02 14:14 UTC (permalink / raw)
To: util-linux
Last March, commit 549a517857 replaced the SPDX line in three files
with a "No copyright is claimed" phrase, but forgot to remove from
two of those files the text lines that correspond to the SPDX.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
include/colors.h | 3 ---
lib/colors.c | 3 ---
2 files changed, 6 deletions(-)
diff --git a/include/colors.h b/include/colors.h
index c02f61a57..d77e0a3c2 100644
--- a/include/colors.h
+++ b/include/colors.h
@@ -4,9 +4,6 @@
*
* Authors: 2012 Ondrej Oprala <ooprala@redhat.com>
* 2012-2025 Karel Zak <kzak@redhat.com>
- *
- * This file may be distributed under the terms of the
- * GNU Lesser General Public License.
*/
#ifndef UTIL_LINUX_COLORS_H
#define UTIL_LINUX_COLORS_H
diff --git a/lib/colors.c b/lib/colors.c
index 47d69cabc..92afc9b96 100644
--- a/lib/colors.c
+++ b/lib/colors.c
@@ -4,9 +4,6 @@
*
* Authors: 2012 Ondrej Oprala <ooprala@redhat.com>
* 2012-2025 Karel Zak <kzak@redhat.com>
- *
- * This file may be distributed under the terms of the
- * GNU Lesser General Public License.
*/
#include <assert.h>
#include <sys/stat.h>
--
2.48.1
^ permalink raw reply related
* Re: [PATCH 1/4] lib/colors: call gettext() only when the argument of --color is invalid
From: Karel Zak @ 2025-06-02 12:05 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: util-linux
In-Reply-To: <20250528093704.8896-1-bensberg@telfort.nl>
On Wed, May 28, 2025 at 11:37:01AM +0200, Benno Schulenberg wrote:
> disk-utils/cfdisk.c | 3 +--
> disk-utils/fdisk.c | 3 +--
> disk-utils/sfdisk.c | 3 +--
> include/colors.h | 2 +-
> lib/colors.c | 7 ++++---
> misc-utils/cal.c | 3 +--
> sys-utils/dmesg.c | 3 +--
> text-utils/hexdump.c | 3 +--
> 8 files changed, 11 insertions(+), 16 deletions(-)
Applied (all in set), thanks!
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: util-linux-2.41 breaks static build of btrfs-progs
From: Stanislav Brabec @ 2025-05-29 15:43 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
In-Reply-To: <hu24dycwyxog44t6ttqidg5nkiczrufq3r3gy6slkgdubt55p4@7b6blpi2xciu>
Karel Zak wrote:
> On Sun, Apr 20, 2025 at 09:24:43PM +0200, Stanislav Brabec wrote:
>> The question is:
>> Should be this fixed by util-linux by prefixing of ul_ to all symbols that
>> are not declared as static?
> I have added the "ul_" prefix to some functions to make the names less
> generic: https://github.com/util-linux/util-linux/pull/3569
>
> I'm going to backport it to stable/v2.41 too.
Done:
https://github.com/util-linux/util-linux/pull/3603
btrfs-progs-v6.14 static build works again out of the box.
--
Best Regards / S pozdravem,
Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o. e-mail: sbrabec@suse.com
Křižíkova 148/34 (Corso IIa) tel: +420 284 084 060
186 00 Praha 8-Karlín fax: +420 284 084 001
Czech Republic http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76
^ permalink raw reply
* Re: [PATCH 1/4] hexdump: (man) put a list item on a single line, to avoid a warning
From: Karel Zak @ 2025-05-29 11:45 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: util-linux
In-Reply-To: <20250523120407.75188-1-bensberg@telfort.nl>
On Fri, May 23, 2025 at 02:04:04PM +0200, Benno Schulenberg wrote:
> text-utils/hexdump.1.adoc | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Applied (all set), thanks!
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* [PATCH 3/4] colrm: make two error messages actually say that something is wrong
From: Benno Schulenberg @ 2025-05-28 9:37 UTC (permalink / raw)
To: util-linux
In-Reply-To: <20250528093704.8896-1-bensberg@telfort.nl>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
text-utils/colrm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/text-utils/colrm.c b/text-utils/colrm.c
index b1370ac81..dd36d1827 100644
--- a/text-utils/colrm.c
+++ b/text-utils/colrm.c
@@ -180,9 +180,9 @@ int main(int argc, char **argv)
}
if (argc > 1)
- first = strtoul_or_err(*++argv, _("first argument"));
+ first = strtoul_or_err(*++argv, _("invalid first argument"));
if (argc > 2)
- last = strtoul_or_err(*++argv, _("second argument"));
+ last = strtoul_or_err(*++argv, _("invalid second argument"));
while (process_input(first, last))
;
--
2.48.1
^ permalink raw reply related
* [PATCH 4/4] textual: harmonize the wording of the error message for an invalid PID
From: Benno Schulenberg @ 2025-05-28 9:37 UTC (permalink / raw)
To: util-linux
In-Reply-To: <20250528093704.8896-1-bensberg@telfort.nl>
Having four different forms for the same basic message is unneeded.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
misc-utils/kill.c | 4 ++--
misc-utils/lsclocks.c | 2 +-
misc-utils/lslocks.c | 2 +-
misc-utils/waitpid.c | 2 +-
schedutils/coresched.c | 5 ++---
schedutils/taskset.c | 3 +--
sys-utils/setpriv.c | 2 +-
7 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/misc-utils/kill.c b/misc-utils/kill.c
index fefe0d891..81dd5f191 100644
--- a/misc-utils/kill.c
+++ b/misc-utils/kill.c
@@ -396,7 +396,7 @@ static char **parse_arguments(int argc, char **argv, struct kill_control *ctl)
if (2 < argc)
errx(EXIT_FAILURE, _("too many arguments"));
arg = argv[1];
- pid = strtopid_or_err(arg, _("invalid pid argument"));
+ pid = strtopid_or_err(arg, _("invalid PID argument"));
print_process_signal_state(pid);
exit(EXIT_SUCCESS);
}
@@ -404,7 +404,7 @@ static char **parse_arguments(int argc, char **argv, struct kill_control *ctl)
pid_t pid;
char *p = strchr(arg, '=') + 1;
- pid = strtopid_or_err(p, _("invalid pid argument"));
+ pid = strtopid_or_err(p, _("invalid PID argument"));
print_process_signal_state((pid_t)pid);
exit(EXIT_SUCCESS);
}
diff --git a/misc-utils/lsclocks.c b/misc-utils/lsclocks.c
index 376bc6e51..42a91fb94 100644
--- a/misc-utils/lsclocks.c
+++ b/misc-utils/lsclocks.c
@@ -593,7 +593,7 @@ int main(int argc, char **argv)
break;
case 'c':
cpu_clock = xmalloc(sizeof(*cpu_clock));
- cpu_clock->pid = strtopid_or_err(optarg, _("failed to parse pid"));
+ cpu_clock->pid = strtopid_or_err(optarg, _("invalid PID argument"));
snprintf(cpu_clock->name, sizeof(cpu_clock->name),
"%jd", (intmax_t) cpu_clock->pid);
list_add(&cpu_clock->head, &cpu_clocks);
diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c
index e58890207..4ed3a3716 100644
--- a/misc-utils/lslocks.c
+++ b/misc-utils/lslocks.c
@@ -383,7 +383,7 @@ static struct lock *get_lock(char *buf, struct override_info *oinfo, void *fallb
l->cmdname = xstrdup(oinfo->cmdname);
} else {
/* strtopid_or_err() is not suitable here; tok can be -1.*/
- l->pid = strtos32_or_err(tok, _("failed to parse pid"));
+ l->pid = strtos32_or_err(tok, _("invalid PID argument"));
if (l->pid > 0) {
l->cmdname = pid_get_cmdname(l->pid);
if (!l->cmdname)
diff --git a/misc-utils/waitpid.c b/misc-utils/waitpid.c
index 4d77e1df4..379246b26 100644
--- a/misc-utils/waitpid.c
+++ b/misc-utils/waitpid.c
@@ -51,7 +51,7 @@ static pid_t *parse_pids(size_t n_strings, char * const *strings)
pid_t *pids = xcalloc(n_strings, sizeof(*pids));
for (size_t i = 0; i < n_strings; i++)
- pids[i] = strtopid_or_err(strings[i], _("failed to parse pid"));
+ pids[i] = strtopid_or_err(strings[i], _("invalid PID argument"));
return pids;
}
diff --git a/schedutils/coresched.c b/schedutils/coresched.c
index 7634d988c..419745897 100644
--- a/schedutils/coresched.c
+++ b/schedutils/coresched.c
@@ -232,12 +232,11 @@ static void parse_and_verify_arguments(int argc, char **argv, struct args *args)
switch (c) {
case 's':
args->src = strtopid_or_err(
- optarg,
- _("Failed to parse PID for -s/--source"));
+ optarg, _("invalid PID for -s/--source"));
break;
case 'd':
args->dest = strtopid_or_err(
- optarg, _("Failed to parse PID for -d/--dest"));
+ optarg, _("invalid PID for -d/--dest"));
break;
case 't':
args->type = parse_core_sched_type(optarg);
diff --git a/schedutils/taskset.c b/schedutils/taskset.c
index 46fef5051..dedcdf602 100644
--- a/schedutils/taskset.c
+++ b/schedutils/taskset.c
@@ -187,8 +187,7 @@ int main(int argc, char **argv)
all_tasks = 1;
break;
case 'p':
- pid = strtopid_or_err(argv[argc - 1],
- _("invalid PID argument"));
+ pid = strtopid_or_err(argv[argc - 1], _("invalid PID argument"));
break;
case 'c':
ts.use_list = 1;
diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c
index 10274f5f6..d714650e8 100644
--- a/sys-utils/setpriv.c
+++ b/sys-utils/setpriv.c
@@ -473,7 +473,7 @@ static void parse_ptracer(struct privctx *opts, const char *str)
} else if (!strcmp(str, "none")) {
opts->ptracer = 0;
} else {
- opts->ptracer = strtopid_or_err(str, _("failed to parse ptracer pid"));
+ opts->ptracer = strtopid_or_err(str, _("invalid PID argument"));
}
}
--
2.48.1
^ permalink raw reply related
* [PATCH 2/4] lib/strutils: call gettext() only when argument of --hyperlink is invalid
From: Benno Schulenberg @ 2025-05-28 9:37 UTC (permalink / raw)
To: util-linux
In-Reply-To: <20250528093704.8896-1-bensberg@telfort.nl>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
include/strutils.h | 2 +-
lib/strutils.c | 4 ++--
lsfd-cmd/lsfd.c | 3 +--
misc-utils/findmnt.c | 3 +--
misc-utils/lsblk.c | 3 +--
5 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/include/strutils.h b/include/strutils.h
index a81fdea89..70f97f0c8 100644
--- a/include/strutils.h
+++ b/include/strutils.h
@@ -59,7 +59,7 @@ extern void strtotimespec_or_err(const char *str, struct timespec *ts,
const char *errmesg);
extern time_t strtotime_or_err(const char *str, const char *errmesg);
-extern bool hyperlinkwanted_or_err(const char *mode, const char *errmesg);
+extern bool hyperlinkwanted(const char *mode);
extern int isdigit_strend(const char *str, const char **end);
#define isdigit_string(_s) isdigit_strend(_s, NULL)
diff --git a/lib/strutils.c b/lib/strutils.c
index af538207a..64fefa878 100644
--- a/lib/strutils.c
+++ b/lib/strutils.c
@@ -524,7 +524,7 @@ time_t strtotime_or_err(const char *str, const char *errmesg)
return (time_t) user_input;
}
-bool hyperlinkwanted_or_err(const char *mode, const char *errmesg)
+bool hyperlinkwanted(const char *mode)
{
if (mode && strcmp(mode, "never") == 0)
return false;
@@ -535,7 +535,7 @@ bool hyperlinkwanted_or_err(const char *mode, const char *errmesg)
if (!mode || strcmp(mode, "auto") == 0)
return isatty(STDOUT_FILENO) ? true : false;
- errx(EXIT_FAILURE, "%s: '%s'", errmesg, mode);
+ errx(EXIT_FAILURE, _("invalid argument of --hyperlink: %s"), mode);
}
/*
diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c
index d05a09396..ffaca8c31 100644
--- a/lsfd-cmd/lsfd.c
+++ b/lsfd-cmd/lsfd.c
@@ -2648,8 +2648,7 @@ int main(int argc, char *argv[])
err(EXIT_FAILURE, _("failed to drop privilege"));
break;
case OPT_HYPERLINK:
- if (hyperlinkwanted_or_err(optarg,
- _("invalid hyperlink argument")))
+ if (hyperlinkwanted(optarg))
ctl.uri = xgethosturi(NULL);
break;
case 'V':
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index 130ac1b13..1211bfa07 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
@@ -2026,8 +2026,7 @@ int main(int argc, char *argv[])
findmnt.flags |= FL_SHADOWED;
break;
case FINDMNT_OPT_HYPERLINK:
- if (hyperlinkwanted_or_err(optarg,
- _("invalid hyperlink argument")))
+ if (hyperlinkwanted(optarg))
findmnt.uri = xgethosturi(NULL);
break;
case FINDMNT_OPT_ID:
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
index a65f5e4e6..da44bd631 100644
--- a/misc-utils/lsblk.c
+++ b/misc-utils/lsblk.c
@@ -2678,8 +2678,7 @@ int main(int argc, char *argv[])
errtryhelp(EXIT_FAILURE);
break;
case OPT_HYPERLINK:
- if (hyperlinkwanted_or_err(optarg,
- _("invalid hyperlink argument")))
+ if (hyperlinkwanted(optarg))
lsblk->uri = xgethosturi(NULL);
break;
case 'H':
--
2.48.1
^ permalink raw reply related
* [PATCH 1/4] lib/colors: call gettext() only when the argument of --color is invalid
From: Benno Schulenberg @ 2025-05-28 9:37 UTC (permalink / raw)
To: util-linux
Instead of calling gettext() before starting to interpret the argument
of option -L/--color, call it only when it's needed: when the argument
is not recognized.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
disk-utils/cfdisk.c | 3 +--
disk-utils/fdisk.c | 3 +--
disk-utils/sfdisk.c | 3 +--
include/colors.h | 2 +-
lib/colors.c | 7 ++++---
misc-utils/cal.c | 3 +--
sys-utils/dmesg.c | 3 +--
text-utils/hexdump.c | 3 +--
8 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index fdd74fbf9..e4e16001e 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -2781,8 +2781,7 @@ int main(int argc, char *argv[])
case 'L':
colormode = UL_COLORMODE_AUTO;
if (optarg)
- colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ colormode = colormode_or_err(optarg);
break;
case 'r':
read_only = 1;
diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c
index 6493e2767..727178da4 100644
--- a/disk-utils/fdisk.c
+++ b/disk-utils/fdisk.c
@@ -1239,8 +1239,7 @@ int main(int argc, char **argv)
case 'L':
colormode = UL_COLORMODE_AUTO;
if (optarg)
- colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ colormode = colormode_or_err(optarg);
break;
case 'n':
noauto_pt = 1;
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index 41b5558ea..7f2f3deea 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -2437,8 +2437,7 @@ int main(int argc, char *argv[])
case OPT_COLOR:
colormode = UL_COLORMODE_AUTO;
if (optarg)
- colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ colormode = colormode_or_err(optarg);
break;
case OPT_MOVEDATA:
sf->movedata = 1;
diff --git a/include/colors.h b/include/colors.h
index 770161ae0..c02f61a57 100644
--- a/include/colors.h
+++ b/include/colors.h
@@ -33,7 +33,7 @@ enum colortmode {
#endif
extern int colormode_from_string(const char *str);
-extern int colormode_or_err(const char *str, const char *errmsg);
+extern int colormode_or_err(const char *str);
/* Initialize the global variable UL_COLOR_TERM_OK */
extern int colors_init(int mode, const char *util_name);
diff --git a/lib/colors.c b/lib/colors.c
index 4852a87cc..47d69cabc 100644
--- a/lib/colors.c
+++ b/lib/colors.c
@@ -34,6 +34,7 @@
#include "c.h"
#include "cctype.h"
#include "colors.h"
+#include "nls.h"
#include "pathnames.h"
#include "strutils.h"
@@ -755,14 +756,14 @@ int colormode_from_string(const char *str)
/*
* Parses @str and exit(EXIT_FAILURE) on error
*/
-int colormode_or_err(const char *str, const char *errmsg)
+int colormode_or_err(const char *str)
{
const char *p = str && *str == '=' ? str + 1 : str;
int colormode;
colormode = colormode_from_string(p);
if (colormode < 0)
- errx(EXIT_FAILURE, "%s: '%s'", errmsg, p);
+ errx(EXIT_FAILURE, _("unsupported color mode: %s"), p);
return colormode;
}
@@ -791,7 +792,7 @@ int main(int argc, char *argv[])
color_scheme = optarg;
break;
case 'm':
- mode = colormode_or_err(optarg, "unsupported color mode");
+ mode = colormode_or_err(optarg);
break;
case 'n':
name = optarg;
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 8c0eb3638..09622165a 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -421,8 +421,7 @@ int main(int argc, char **argv)
case OPT_COLOR:
ctl.colormode = UL_COLORMODE_AUTO;
if (optarg)
- ctl.colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ ctl.colormode = colormode_or_err(optarg);
break;
case OPT_REFORM:
ctl.reform_year = parse_reform_year(optarg);
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index 8dcf67c94..6584613c7 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -1756,8 +1756,7 @@ int main(int argc, char *argv[])
case 'L':
colormode = UL_COLORMODE_AUTO;
if (optarg)
- colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ colormode = colormode_or_err(optarg);
break;
case 'l':
ctl.fltr_lev= 1;
diff --git a/text-utils/hexdump.c b/text-utils/hexdump.c
index 36744554e..60bf6f94b 100644
--- a/text-utils/hexdump.c
+++ b/text-utils/hexdump.c
@@ -115,8 +115,7 @@ parse_args(int argc, char **argv, struct hexdump *hex)
case 'L':
colormode = UL_COLORMODE_AUTO;
if (optarg)
- colormode = colormode_or_err(optarg,
- _("unsupported color mode"));
+ colormode = colormode_or_err(optarg);
break;
case 'n':
hex->length = strtosize_or_err(optarg, _("failed to parse length"));
--
2.48.1
^ permalink raw reply related
* Re: [PATCH 3/4] hardlink: (usage) improve the descriptions of three options
From: Karel Zak @ 2025-05-26 17:30 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: util-linux
In-Reply-To: <20250523120407.75188-3-bensberg@telfort.nl>
On Fri, May 23, 2025 at 02:04:06PM +0200, Benno Schulenberg wrote:
> (Note: the choice for -m for --maximize and -M for --minimize is
> unfortunate, as most people would guess the opposite, especially
> since -s is used for --minimum-size and -S for --maximum-size.)
Long history: it originates from the Debian hardlink implementation
(13 years ago), and it seems that the origin is from a previous version
implemented in Python (the original patch is missing).
https://salsa.debian.org/jak/hardlink/-/commit/bc0a8d544e3866a6ba62ea5f1bf7b8da6e616c11
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* Re: [PATCH] AUTHORS: update Zhenwei Pi email
From: Karel Zak @ 2025-05-26 17:08 UTC (permalink / raw)
To: zhenwei pi; +Cc: util-linux
In-Reply-To: <20250526093817.951024-1-pizhenwei@bytedance.com>
On Mon, May 26, 2025 at 05:37:57PM +0800, zhenwei pi wrote:
> I will be leaving ByteDance so updating my email in AUTHORS to my
> personal email.
Applied!
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply
* [PATCH] AUTHORS: update Zhenwei Pi email
From: zhenwei pi @ 2025-05-26 9:37 UTC (permalink / raw)
To: util-linux; +Cc: kzak, zhenwei pi
I will be leaving ByteDance so updating my email in AUTHORS to my
personal email.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
AUTHORS | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index ad9ae703b..df9a88567 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,7 +15,7 @@ PAST MAINTAINERS:
AUTHORS (merged projects & commands):
blkdiscard: Lukas Czerner <lczerner@redhat.com>
- blkpr: zhenwei pi <pizhenwei@bytedance.com>
+ blkpr: zhenwei pi <zhenwei.pi@linux.dev>
blkzone: Shaun Tancheff <shaun@tancheff.com>
Damien Le Moal <damien.lemoal@wdc.com>
enosys: Thomas Weißschuh <thomas@t-8ch.de>
@@ -33,7 +33,7 @@ AUTHORS (merged projects & commands):
hardlink: Jakub Jelinek <jakub@redhat.com>
hwclock: Bryan Henderson <bryanh@giraffe-data.com>
ipcmk: Hayden James <hayden.james@gmail.com>
- irqtop/lsirq: Zhenwei Pi <pizhenwei@bytedance.com>
+ irqtop/lsirq: Zhenwei Pi <zhenwei.pi@linux.dev>
Sami Kerola <kerolasa@iki.fi>
last/lastb: [merged from sysvinit]
Miquel van Smoorenburg <miquels@cistron.nl>
--
2.43.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox