aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2025-10-29Allow specifying several filesAlejandro Colomar2-8/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Don't use pcre2grep(1)'s --labelAlejandro Colomar1-3/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_search())Alejandro Colomar1-9/+5
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Compact codeAlejandro Colomar1-10/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: OptimizeAlejandro Colomar2-236/+57
Call pcre2grep(1) only once, which allows removing named pipes. This is an important optimization, and will also allow accepting several file names in the command line (in a future commit). The source code is also significantly simplified. It has a caveat: this single call to pcre2grep(1) will consume more resources, and will crash on certain input files. The workaround is to restrict the search to just one or a few types of code. Document this in the manual page. This caveat only applies to very specific files, which so far I've only found in the Linux kernel source tree.
2025-10-29Don't find files recursivelyAlejandro Colomar2-56/+64
grep only one file (or stdin). The current implementation doesn't allow filterin standard input, which I miss some times. I'm removing this feature now, to be able to rewrite most of the program in a way that allows filtering stdin, and then will consider adding back a recursive mode if necessary. Also, don't remove the two blanks at the start of the output, for consistency when calling this program via xargs(1), which will become more common now that it only handles single files. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29Remove '-g' optionAlejandro Colomar2-14/+2
This program shouldn't know about file names. If that is wanted, use something like `find ... | grep ... | xargs grepc ...`. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29Remove '-x' optionAlejandro Colomar2-19/+1
This program shouldn't know about file extensions. If that is wanted, use something like `find ... | grep ... | xargs grepc ...`. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc, grepc.1: -tmf, -tmo: Add options to find only function-like ↵Alejandro Colomar2-10/+24
macros, or other macros Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Shorten function namesAlejandro Colomar1-43/+43
Also, use names consistent with the command-line option arguments. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Shorten variable namesAlejandro Colomar1-117/+96
Also, use names consistent with the command-line option arguments. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_use_func())Alejandro Colomar1-13/+11
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_use_type())Alejandro Colomar1-16/+18
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_type())Alejandro Colomar1-18/+24
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_type_typedef())Alejandro Colomar1-8/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_macro())Alejandro Colomar1-12/+10
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Compact one-liner definitionsAlejandro Colomar1-26/+5
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_glibc_func_def())Alejandro Colomar1-14/+14
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Improve error messagesAlejandro Colomar1-11/+7
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Transform some if's to simpler test&&Alejandro Colomar1-39/+26
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_use())Alejandro Colomar1-26/+15
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_glibc_func())Alejandro Colomar1-20/+11
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_linux_func())Alejandro Colomar1-20/+11
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_func())Alejandro Colomar1-36/+28
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29bin/grepc: Simplify (remove grepc_search_default())Alejandro Colomar1-56/+50
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29Use pcre2grep(1) instead of pcregrep(1)Alejandro Colomar2-3/+3
PCRE are EOL. Long live PCRE2. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29Use recursion to improve matching of function parameter listsAlejandro Colomar1-4/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29Support parenthesized function namesAlejandro Colomar1-2/+2
This creates some false positives, but with appropriate flags, those can be removed. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29grepc, grepc.1: -tg, -tgp, -tgd: Add more support for glibc internal names ↵Alejandro Colomar2-2/+62
of libc functions Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: -tm: Fix finding macros defined as emptyAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: -c: Add flag to color usesAlejandro Colomar2-11/+45
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Remove constraints in the file prefilteringAlejandro Colomar1-1/+1
To make -tu work correctly, which doesn't have the word-boundary constraint. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: -tut: Fix regex for braces in the same line as 'struct'Alejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Read in the helperAlejandro Colomar1-35/+19
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Don't search underlying structure of a typedefAlejandro Colomar1-14/+0
In some cases it might be nice, but in some other cases, it might cause a lot of code to be printed. Let the user explicitly search for it or not in a separate run. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Fix glitch with incorrectly indented codeAlejandro Colomar1-4/+4
Avoid this glich from glibc: ./sysdeps/unix/sysv/linux/x86/sys/ucontext.h:133: typedef struct { gregset_t __ctx(gregs); /* Note that fpregs is a pointer. */ fpregset_t __ctx(fpregs); __extension__ unsigned long long __reserved1 [8]; } mcontext_t; /* Userlevel context. */ typedef struct ucontext_t { unsigned long int __ctx(uc_flags); struct ucontext_t *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; __extension__ unsigned long long int __ssp[4]; } ucontext_t; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Fix some typedef corner casesAlejandro Colomar1-3/+3
- Typedefs to arrays of structures. - Typedefs to structures of the same name. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Improve regexesAlejandro Colomar1-16/+16
- Use the same ammount of spaces for the closing brace as for the opening brace. - Fix position of attributes. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: bugfixAlejandro Colomar1-2/+2
SC2068: Double quote array expansions to avoid re-splitting elements. Reported-by: shellcheck(1) Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: srcfixAlejandro Colomar1-1/+1
SC2124: Use $* instead of $@ to concatenate. Reported-by: shellcheck(1) Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: srcfixAlejandro Colomar1-1/+1
SC2004: $/${} is unnecessary on arithmetic variables. Reported-by: shellcheck(1) Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: Add -i flag as in grep(1)Alejandro Colomar2-8/+16
Also, add some symmetry between ${iflag} and ${lflag}. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: Remove -tu from the defaultsAlejandro Colomar2-3/+2
Normally, one either wants to see a declaration/definition, or its uses, but not both at the same time. Also, there are usually many more use sites than than definitions, and therefore definitions are shadowed between all the noise. Restrict the default to declarations and definitions, which in my experience seems to be the most common use case. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: -tu: Allow searching special charactersAlejandro Colomar2-14/+22
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Fix grepc_type_typedef_underlying_struct_union_enumAlejandro Colomar1-26/+43
When it calls grepc_type_struct_union_enum(), it needs to use a different file list, since it's searching for an identifier different from the one passed in the command line. Also, while at it, improve the quoting of the pattern passed to pcregrep(1). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: -tt: Find typedefs to function pointersAlejandro Colomar1-0/+10
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: tfixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: srcfixAlejandro Colomar1-1/+1
Sort alphabetically the optstring. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Allow a pattern to start with '-'Alejandro Colomar1-5/+5
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: -t...: Allow more granularityAlejandro Colomar2-2/+105
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc.1: wfixAlejandro Colomar1-2/+2
2025-10-29grepc, grepc.1: wfixAlejandro Colomar2-12/+12
Rename functions to have different starting letters. Also rename the macro functions to more closely match ISO C nomenclature. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: -tu: Search also within enum and type definitionsAlejandro Colomar2-2/+51
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_enum_constant: Fix edge casesAlejandro Colomar1-3/+3
Most importantly, typedef enum. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: Add -l flag as in grep(1)Alejandro Colomar2-3/+19
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_use_macro: tfixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc.1: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: Add -tu to search for usesAlejandro Colomar2-1/+63
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_macro_*: Remove a few false positivesAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: srcfixAlejandro Colomar1-13/+13
Use alphabetic order. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: Add -k option for a more compact outputAlejandro Colomar2-3/+16
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: Add -t option to restrict the search to a type of code.Alejandro Colomar2-3/+78
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: srcfixAlejandro Colomar1-43/+43
Improve grouping so that adding flags for running the different functions is simple. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: Don't print leading blank lines.Alejandro Colomar2-12/+13
Also, update the manual page EXAMPLES regarding blank lines. Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc.1: SYNOPSIS: ffixAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: Add optional FILE trailing argumentsAlejandro Colomar2-6/+30
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: -g: Add option to restrict search to files tracked by gitAlejandro Colomar2-2/+14
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: -x: Add option to edit file extensionAlejandro Colomar2-4/+18
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc, grepc.1: -h: Add option to print the usage message.Alejandro Colomar2-12/+43
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Usage: ffixAlejandro Colomar1-1/+1
Using caps instead of <> will be nicer when we add options and optional arguments for the files/directories: Usage: grepc [OPTION]... IDENTIFIER [FILE]... vs Usage: grepc [<option>]... IDENTIFIER [<file>]... Also, it's what pcregrep(1) and GNU grep(1) use, so it's good to use the same syntax here. Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc.1: wfixAlejandro Colomar1-2/+1
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Simplify escaping \Alejandro Colomar1-2/+2
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Use -r option to read(1)Alejandro Colomar1-1/+1
Let's fall on the safe side. Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Make it portable to sh(1)Alejandro Colomar1-23/+23
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Use a portable shebangAlejandro Colomar1-1/+1
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Remove spurious blank linesAlejandro Colomar1-7/+7
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Remove blank line between header and codeAlejandro Colomar1-1/+1
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_linux_syscall_def: Improve readability of regexAlejandro Colomar1-1/+1
This improves the readability of the regex, and also the robustness, at the cost of just a few ms. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_find_files: Get a reduced list of files onceAlejandro Colomar1-18/+27
Instead of running find and grep -l for every function, store the result in a temporary file for reuse in all functions. This is a considerable speedup, between 3x and 10x in some tests within the Linux kernel source code. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Fix some corner casesAlejandro Colomar1-2/+2
Those two spaces are for handling some insane GNU style. Those are always spaces, so let's use ' ' instead of '\s\s' to make sure we don't match two tabs, or things like that. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc.1: ffixAlejandro Colomar1-4/+4
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc.1: Add break points in URIAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc.1: EXAMPLES: Add example with nxt_sprintfAlejandro Colomar1-0/+26
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc.1: Add manual pageAlejandro Colomar1-0/+29
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Use '' when possibleAlejandro Colomar1-10/+10
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Fix some corner casesAlejandro Colomar1-4/+4
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_type_*: Fix some typedef corner casesAlejandro Colomar1-8/+8
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_macro_simple: Fix regex for empty macroAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: OptimizeAlejandro Colomar1-7/+18
Use 2 grep(1) filters instead of 1, to be able to filter better before the multiline pcregrep(1) filter, which is considerably slower. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_enum_constant, grepc_type_typedef_simple: Remove a few false ↵Alejandro Colomar1-3/+3
positives Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_linux*, grepc_syscall*: Rename functions to clearly refer to linuxAlejandro Colomar1-6/+6
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_type_struct_union_enum: Don't duplicate outputAlejandro Colomar1-1/+1
In definitions of the form typedef struct foo {...} foo; grepc_type_typedef_struct_union_enum() is already finding it. Remove the duplicate here. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_glibc_math: Support glibc math functionsAlejandro Colomar1-0/+13
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_helper: Add helper function to remove repeated codeAlejandro Colomar1-63/+39
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_func_decl: OptimizeAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_enum_constant: Fix patternAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_type_struct_union_enum: OptimizeAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_type_struct_union_enum: Allow attributes before ↵Alejandro Colomar1-1/+1
struct|union|enum keyword Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_type_typedef_underlying_struct_union_enum: Don't duplicate outputAlejandro Colomar1-1/+2
In typedefs of the form 'typedef struct foo foo;', don't print the structure twice. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Allow tabsAlejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_type*: Simplify finding typedefsAlejandro Colomar1-13/+7
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Consistently use Perl regexAlejandro Colomar1-15/+15
If we use different regex types within the program, then users can't use regex patterns in the identifier due to incompatibilities. Let's use Perl regex everywhere we can, so that users can consistently use Perl regex patterns in the identifier. Example: $ grepc (vf|as)printf; Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_enum_constant: Find enumeration constant definitionsAlejandro Colomar1-0/+13
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_syscall_decl: OptimizeAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grep_macro_*: Allow tabsAlejandro Colomar1-4/+4
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_func_def: Find kernel function definitionsAlejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_syscall: Find kernel syscalls (both declaration and definition)Alejandro Colomar1-0/+31
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_func_def: Increase robustness of regexAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_type_struct_union_enum: Increase robustness of regexAlejandro Colomar1-2/+4
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_type_typedef_underlying_struct_union_enum: Fix corner casesAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: Fix parsing of argumentsAlejandro Colomar1-18/+19
Allow one single argument only. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grepc_type_struct_union_enum: Support glibcAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29grepc: grep_func_decl: Support glibcAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29bin/grepc: Add programAlejandro Colomar1-0/+141
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-10-29SPONSORS: Two sponsors didn't renew this yearAlejandro Colomar1-2/+0
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29Start of man-pages-NEXT: Move Changes to Changes.oldAlejandro Colomar2-135/+172
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29lsm: Released 6.16Alejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29Changes: Ready for 6.16man-pages-6.16Alejandro Colomar1-9/+135
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29RELEASE: Sort tags using sort(1) -VAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29Changes[.old]: Move Changes to Changes.oldAlejandro Colomar2-100/+137
I forgot to do it right after releasing man-pages-6.15. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man7/bpf-helpers.7: Refresh page from Linux v6.17Alejandro Colomar1-7/+18
Scripted change: $ ~/src/linux/linux/v6.17/scripts/bpf_doc.py \ | rst2man \ >man7/bpf-helpers.7; Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/: Update some APIs for POSIX.1-2024posix24Alejandro Colomar156-354/+367
This work is incomplete, but waiting until all pages have been updated would unnecessarily delay publishing these changes, which are already useful. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man3/ftime.3: SYNOPSIS: Declare ftime with [[deprecated]]Collin Funk1-1/+1
This function was marked as legacy in POSIX.1-2001 and has been removed from many systems, including glibc. Signed-off-by: Collin Funk <collin.funk1@gmail.com> Message-ID: <5924c3b09d8e373be6ac1b5ca663b8ad7d106d93.1750306917.git.collin.funk1@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man2/gettimeofday.2: Declare functions with [[deprecated]]Collin Funk1-0/+6
As documented in the STANDARDS section, gettimeofday(2) was deprecated in POSIX.1-2008 and removed in POSIX.1-2024. Mark it and settimeofday(2) with [[deprecated]], and mention clock_settime(2) as a modern and standardized alternative to settimeofday(2). Signed-off-by: Collin Funk <collin.funk1@gmail.com> Message-ID: <2d37d5a9251af3c1d25cf8e73e3585a9955d5772.1750373011.git.collin.funk1@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man3/ptsname.3: VERSIONS: Document ptsname_r(3) incompatibility on FreeBSDCollin Funk1-1/+1
The FreeBSD implementation of ptsname_r(2) returns -1 on error and sets errno, instead of just returning the errno. Document this issue for programs written with portability in mind. Signed-off-by: Collin Funk <collin.funk1@gmail.com> Message-ID: <37f138bc5c5e6604f0a0afcc531694387d2cc424.1749792527.git.collin.funk1@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man3*/: STANDARDS: Update APIs for POSIX.1-2024Alejandro Colomar40-42/+44
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man3type/time_t.3type: STANDARDS, HISTORY: POSIX.1-2008 removed useconds_tAlejandro Colomar1-10/+10
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man3type/time_t.3type: STANDARDS, HISTORY: Update time_t for POSIX.1-2024Alejandro Colomar1-7/+15
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man3/getenv.3: Mention secure_getenv() was standardized in POSIX-1.2024Collin Funk1-3/+3
Signed-off-by: Collin Funk <collin.funk1@gmail.com> Message-ID: <2d55b75480ae862a622ac46e7e6c7628f6efc45d.1747519811.git.collin.funk1@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man7/signal.7: Mention SIGWINCH was standardized in POSIX-1.2024Collin Funk1-1/+3
Signed-off-by: Collin Funk <collin.funk1@gmail.com> Message-ID: <bae6bc16f9ab6bd3e5c30dc8e11bd83566b06a6f.1747519811.git.collin.funk1@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man3/ptsname.3: Mention ptsname_r() was standardized in POSIX-1.2024Collin Funk1-7/+6
Signed-off-by: Collin Funk <collin.funk1@gmail.com> Message-ID: <883d4a9b8cfb757a080710cf0133be5d0e12adce.1747515178.git.collin.funk1@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man2/: STANDARDS: Update system calls for POSIX.1-2024Alejandro Colomar106-218/+201
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man2/open.2: Simplify STANDARDS, and move part of it to HISTORYAlejandro Colomar1-26/+16
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/: Update fork(2) for POSIX.1-2024, and add references to _Fork(3)Alejandro Colomar3-14/+8
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man3/_Fork.3: Document _Fork()Alejandro Colomar1-0/+29
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man7/pathname.7: VERSIONS: Linux doesn't disallow new-line charactersAlejandro Colomar1-0/+5
POSIX.1-2024 encourages implementations to disallow new-line characters, but Linux doesn't follow that. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man2/close.2: CAVEATS: Document divergence from POSIX.1-2024Alejandro Colomar1-15/+6
POSIX.1-2024 now mandates a behavior different from what Linux (and many other implementations) does. It requires that we report EINPROGRESS for what now is EINTR. There are no plans to conform to POSIX.1-2024 within the Linux kernel, so document this divergence. Keep POSIX.1-2008 as the standard to which we conform in STANDARDS. Link: <https://sourceware.org/bugzilla/show_bug.cgi?id=14627> Link: <https://pubs.opengroup.org/onlinepubs/9799919799/functions/close.html> Cc: Jan Kara <jack@suse.cz> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Christian Brauner <brauner@kernel.org> Cc: Rich Felker <dalias@libc.org> Cc: <linux-fsdevel@vger.kernel.org> Cc: <linux-api@vger.kernel.org> Cc: <libc-alpha@sourceware.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man2/close.2: Move part of NOTES into a new CAVEATS sectionAlejandro Colomar1-8/+8
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man2/socket.2: VERSIONS: POSIX.1-2024 specifies SOCK_CLOFORK, but Linux ↵Alejandro Colomar1-0/+4
doesn't support it Fixes: 265b9898dfe2 (2025-05-09; "man/man2/: VERSIONS: POSIX.1-2024 specifies *_CLOFORK, but Linux doesn't support it") Link: <https://lore.kernel.org/all/20200515160342.GE23230@ZenIV.linux.org.uk/> Cc: Mateusz Guzik <mjguzik@gmail.com> Cc: Jeff Layton <jlayton@kernel.org> Cc: Chuck Lever <chuck.lever@oracle.com> Cc: <linux-fsdevel@vger.kernel.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man2/: Fix STANDARDS and HISTORYAlejandro Colomar3-3/+3
Fixes: 4131356cdab8 (2023-03-30; "man*/, man-pages.7: VERSIONS, STANDARDS, HISTORY: Reorganize sections") Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man3/alloca.3: wfixAlejandro Colomar1-4/+7
Reported-by: Alejandro Colomar <alx@kernel.org> Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Suggested-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Co-authored-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man2/pidfd_send_signal.2: Describe flagsKir Kolyshkin1-3/+60
Those flags were added in Linux 6.9 (see [1]), and are documented in [2]. The text added is a modified version of [3], removing some repetition and adapting from markdown to mandoc. [1]: <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e1fb1dc08e73> [2]: <https://github.com/brauner/man-pages-md/blob/main/pidfd_send_signal.md> [3]: <https://github.com/brauner/man-pages-md/pull/2> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Message-ID: <20251008020031.1215030-4-kolyshkin@gmail.com> Cc: Christian Brauner <brauner@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> [alx: ffix] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man2/pidfd_open.2: Document PIDFD_THREADKir Kolyshkin1-6/+36
PIDFD_THREAD flag for pidfd_open(2) was added in Linux 6.9 (see [1]). Add a TODO to describe the nuances of using poll/epoll/select with a pidfd referring to a process vs a thread. [1]: <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=64bef697d33b> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Message-ID: <20251013191049.193375-2-kolyshkin@gmail.com> Cc: Christian Brauner <brauner@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> [alx: ffix] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man7/tcp.7: Add TCP_SAVE_SYN and TCP_SAVED_SYNValdikSS1-4/+17
Document TCP_SAVE_SYN and TCP_SAVED_SYN options based on git commit linux.git cd8ae85299d5 (2015-05-05; "tcp: provide SYN headers for passive connections") which introduced it. Link: <https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cd8ae85299d54155702a56811b2e035e63064d3d> Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: ValdikSS <iam@valdikss.org.ru> Message-ID: <20251015214826.70750-1-iam@valdikss.org.ru> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-29man/man3/opendir.3: ERRORS: Document that long file names result in ENAMETOOLONGCollin Funk1-0/+4
This behavior can be seen with the following example program: $ cat main.c #include <dirent.h> #include <err.h> #include <string.h> #include <stdlib.h> #include <sys/types.h> int main(int argc, char *argv[argc+1]) { DIR *d; if (argc < 2) errx(EXIT_FAILURE, "argc < 2"); d = opendir(argv[1]); if (d == NULL) err(EXIT_FAILURE, "opendir"); closedir(d); exit(EXIT_SUCCESS); } $ cc -Wall -Wextra main.c $ ./a.out $(printf '%0999d') a.out: opendir: File name too long Signed-off-by: Collin Funk <collin.funk1@gmail.com> Message-ID: <4266061219d7406c0aa737f8d52108fea7e0f7fb.1760689006.git.collin.funk1@gmail.com> [jwilk: simpler reproducer] Cc: Jakub Wilk <jwilk@jwilk.net> [alx: Fix style in the reproducer program] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-28man/man3/[umax]abs.3: Document umaxabs(3)Alejandro Colomar2-6/+9
Rename uimaxabs(3) => umaxabs(3). And add a link page. Keep a link with the old name, so that programmers looking for the old name are redirected to the new name, so they find what they need. I've removed documentation for uimaxabs(3), instead of keeping information in HISTORY, as it has only existed for one glibc version, to avoid programmers being confused by the old name. Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3577.txt> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-16man/man3/pthread_cond_init.3: CAVEATS: Add a note regarding real-time usageSebastian Andrzej Siewior1-0/+24
The "old" implementation led to priority inversion and was more or less easy to trigger. It seems that after the rewrite the issue disappeared especially since the old workaround does not apply anymore. Add a note mentioning the old problem and why the issue is not gone since the rewrite in glibc 2.25 but harder to trigger. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: André Almeida <andrealmeid@igalia.com> Cc: Darren Hart <dvhart@infradead.org> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Ingo Molnar <mingo@redhat.com> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Valentin Schneider <vschneid@redhat.com> Cc: Waiman Long <longman@redhat.com> Message-ID: <20250915141305.906440-6-bigeasy@linutronix.de> [alx: wfix, srcfix] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-15man/man2/futex.2: Update the link reference again.Sebastian Andrzej Siewior1-1/+1
Carlos O'Donell says based on the context, it should be the former link from that day. Update the link accordingly. Cc: Carlos O'Donell <carlos@redhat.com> Link: <https://lore.kernel.org/all/710e8f05-b0b3-489a-9e89-8967cf6a9e70@redhat.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Message-ID: <20250915141305.906440-5-bigeasy@linutronix.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-15man/man7/sched.7: SEE ALSO: Update the documentation referencesSebastian Andrzej Siewior1-6/+3
The section refers to .txt files but they have been moved/ renamed to .rst some time ago. The mentioned sched-rt-group is inconvenient as people always complained about CONFIG_RT_GROUP_SCHED. Everything that describes CFS is not wrong but the kernel the kernel switched to the Earliest Virtual Deadline First (EEVDF) scheduler. Instead of updating the file links below (and adding new ones), replace them with a link to the automatically created scheduler documetation from that folder. This also has some EEVDF bits. :) Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: André Almeida <andrealmeid@igalia.com> Cc: Darren Hart <dvhart@infradead.org> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Ingo Molnar <mingo@redhat.com> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Valentin Schneider <vschneid@redhat.com> Cc: Waiman Long <longman@redhat.com> Message-ID: <20250915141305.906440-4-bigeasy@linutronix.de> [alx: ffix] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-15man/man7/sched.7: Update the real-time sectionSebastian Andrzej Siewior1-16/+40
Update the outdated information: - The PREEMPT_RT patch is merged. The patch continues to exist (as of now) but is not mandatory. - The patch can be still downloaded but most people use the git tree these days. Add a reference to it. - CONFIG_PREEMPT_DESKTOP was never thing as far as I remember. It was always CONFIG_PREEMPT and its description referred to "low latency desktop". - Within the PREEMPT-RT patch there was a brief window which introduced PREEMPT_RT_BASE and PREEMPT_RT_FULL. I am going to ignore this. - The introduction of PREEMPT_LAZY in 6.13 moved PREEMPT_RT from a preemption model to an option. - The mentioned wiki is deprecated. Update the URL to the new one. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: André Almeida <andrealmeid@igalia.com> Cc: Darren Hart <dvhart@infradead.org> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Ingo Molnar <mingo@redhat.com> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Valentin Schneider <vschneid@redhat.com> Cc: Waiman Long <longman@redhat.com> Message-ID: <20250915141305.906440-3-bigeasy@linutronix.de> [alx: minor tweaks] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-15man/man2const/PR_FUTEX_HASH_SET_SLOTS.2const: Document PR_FUTEX_HASH_SET_SLOTSSebastian Andrzej Siewior1-0/+67
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: André Almeida <andrealmeid@igalia.com> Cc: Darren Hart <dvhart@infradead.org> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Ingo Molnar <mingo@redhat.com> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Valentin Schneider <vschneid@redhat.com> Cc: Waiman Long <longman@redhat.com> Message-ID: <20250915141305.906440-2-bigeasy@linutronix.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-12man/man2/clone.2: Document CLONE_PIDFD | CLONE_THREADKir Kolyshkin1-5/+11
Available since Linux 6.9 [1]. Documented in [2] (added by [3]). [1]: <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=83b290c9e3b5d95891f> [2]: <https://github.com/brauner/man-pages-md/blob/main/clone.md> [3]: <https://github.com/brauner/man-pages-md/pull/4> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Message-ID: <20251008020031.1215030-2-kolyshkin@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-12man/man7/rtnetlink.7: Document metrics attributes (RTAX_*).Guillaume Nault1-1/+82
Add a brief explanation of the RTAX_* attributes that can be used in RTA_METRICS. Signed-off-by: Guillaume Nault <gnault@redhat.com> Message-ID: <67e7f52aad3d777ef1075eca902d0d235e0d3753.1759950455.git.gnault@redhat.com> [alx: ffix] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-10man/man3/[f]getc.3: Document that getc(3) should not be usedAlejandro Colomar2-14/+50
Move getc(3) to a separate manual page, documenting the bugs of this API, and recommending fgetc(3) instead. While the relevant standards (ISO C and POSIX) don't deprecate this API, let's deprecate it here. Cc: <onf@disroot.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-10man/man4/console_codes.4: ffixG. Branden Robinson1-6/+0
Stop meddling with adjustment. A lengthy comment in groff's man(7) package explains why attempts to meddle with text alignment and adjustment with the `ad` and `na` requests--outside of tbl(1) text blocks--exhibits contempt for reader preferences and often comes to grief anyway. .\" Resetting the adjustment mode is a complicated dance. .\" 1. Man pages sometimes disable adjustment--when they do, they .\" often forget to put it back the way it was. .\" 2. When they do remember to put it back, they often fail to do .\" so correctly because of the `ad` request's quirky semantics .\" starting from Seventh Edition Unix troff/nroff. Briefly, the .\" `ad` request without arguments turns adjustment back on after .\" an `na` even if the previous adjustment mode was `l` (align to .\" the left with NO adjustment). .\" 3. The default adjustment mode historically has not been .\" predictable; it can depend on nroff vs. troff mode and on the .\" vendor of the *roff system in use. .\" 4. It's possible (and portable) to obtain the previous adjustment .\" mode via the `.j` register so that it can be saved prior to .\" meddling and restored later, but in practice man page authors .\" neglect to do so. .\" 5. groff man(7)'s `AD` string isn't supported everywhere. .\" 6. We want user preferences, if expressed, to override the page .\" author's. .\" 7. Even if we didn't want (6), one page author's can override .\" another's when formatting multiple man(7) documents in .\" sequence[.] Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Message-ID: <20251009215811.3a6ughmxcskgae3s@illithid> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-10man/man4/console_codes.4: ffixG. Branden Robinson1-1/+1
Add missing `x` column modifier to the descriptive column of the "VT100 console sequences not implemented on the Linux console" table, making it format like all the other tables in this man page. Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Message-ID: <20251009215801.yt57b4zbpsvctl5h@illithid> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-10man/man4/console_codes.4: wfixG. Branden Robinson1-1/+1
Spell out column heading as "parmeter"; "param" is a false economy given that one of the entries in the same column is "100..107" (only one en shorter). Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Message-ID: <20251009215752.upezzr4gubzveiwe@illithid> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-10man/man4/console_codes.4: ffixG. Branden Robinson1-3/+7
Use a more idiomatic means (than numeral-width horizontal motion escape sequences `\0`) of setting table entries that are indented with respect to other entries in the same column. Use table region continuation (`.T&`) and the `A` column classifier. See tbl(1). Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Message-ID: <20251009215742.w44sai53jje46m6h@illithid> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-10man/man4/console_codes.4: ffixG. Branden Robinson1-4/+10
Put lengthy table entries into tbl(1) text blocks, so that they don't cause output lines to overset. Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Message-ID: <20251009215733.k3dgj5mafiysxa7z@illithid> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-10man/man4/console_codes.4: ffixG. Branden Robinson1-0/+9
Consistently put inter-paragraph space before tables. Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Message-ID: <20251009215724.7gms7w7zosrlg44n@illithid> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-10man/man4/console_codes.4: Document the names of the "ESC s" and "ESC u" ↵G. Branden Robinson1-2/+2
extension controls. Link: <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_> Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Message-ID: <20251009215712.zhmxvmbtx72tk4yg@illithid> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-06man/man2/fanotify_mark.2: grfixKele Huang1-1/+1
Message-ID: <20250925135215.1648059-1-kele@cs.columbia.edu> Acked-by: "G. Branden Robinson" <branden@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-05man/man7/capabilities.7: Expand CAP_SYS_PTRACE to include /procJonathon Reinhart1-1/+15
CAP_SYS_PTRACE is required (via ptrace_may_access) for accessing various things in /proc, so include it in the CAP_SYS_PTRACE bullet list. Also, add a hint that other things throughout the kernel may check this via ptrace_may_access(). Signed-off-by: Jonathon Reinhart <jrreinhart@google.com> Message-ID: <20250924152313.1902586-1-jrreinhart@google.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-05man/man7/ascii.7: srcfixAlejandro Colomar1-1/+1
Use the dummy character to avoid a table entry consisting only of '=', which would be interpreted as a table delimiter. We previously had a white space, but that was worse: it is not visible in the input, and produces non-ignorable output. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-05man/: ffixAlejandro Colomar11-47/+47
Remove spaces before a tab (except in a few cases). Reported-by: "G. Branden Robinson" <branden@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-05man/man4/console_codes.4: ffixAlejandro Colomar2-2/+3
Also remove it from "share/mk/build/catman/troff.xfail", as it doesn't fail anymore. Suggested-by: "G. Branden Robinson" <branden@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-05man/man5/proc_pid_smaps.5: Remove useless column in tableAlejandro Colomar1-33/+33
It was forcing some entries to go past the right margin. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-04man/man7/vdso.7: ffixAlejandro Colomar1-128/+48
Reported-by: Bjarni Ingi Gislason <bjarniig@simnet.is> Suggested-by: "G. Branden Robinson" <branden@debian.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/: Document new mount API setAleksa Sarai8-0/+3095
Back in 2019, the new mount API was merged[1]. David Howells then set about writing man pages for these new APIs, and sent some patches back in 2020[2]. Unfortunately, these patches were never merged, which meant that these APIs were practically undocumented for many years -- arguably this has been a contributing factor to the relatively slow adoption of these new (far better) APIs. For instance, I have often discovered that many folks are unaware of the read(2)-based message retrieval interface provided by filesystem context file descriptors. In 2024, Christian Brauner adapted David Howell's original man pages into the easier-to-edit Markdown format and published them on GitHub[3]. These have been maintained since, including updated information on new features added since David Howells's 2020 draft pages (such as MOVE_MOUNT_BENEATH). While this was a welcome improvement to the previous status quo (that had lasted over 6 years), speaking personally my experience is that not having access to these man pages from the terminal has been a fairly common painpoint. So, this is a modern version of the man pages for these APIs, in the hopes that we can finally (6 years later) get proper documentation for these APIs in the man-pages project. One important thing to note is that most of these were re-written by me, with very minimal copying from the versions available from Christian[2]. The reasons for this are two-fold: - Both Howells's original version and Christian's maintained versions contain crucial mistakes that I have been bitten by in the past (the most obvious being that all of these APIs were merged in Linux 5.2, but the man pages all claim they were merged in different versions.) - As the man pages appear to have been written from Howells's perspective while implementing them, some of the wording is a little too tied to the implementation (or appears to describe features that don't really exist in the merged versions of these APIs). - The original versions of the man-pages lacked bigger-picture explanations of the reasoning behind the API, which would make it easier for readers to understand what operations are doing. I decided that the best way to resolve these issues is to rewrite them from the perspective of an actual user of these APIs (me), and check that we do not repeat the mistakes I found in the originals. I have also done my best to resolve the issues raised by Michael Kerrisk on the original patchset sent by Howells[1]. In addition, I have also included a man page for open_tree_attr(2) (as a subsection of the new open_tree(2) man page), which was merged in Linux 6.15. [1]: <https://lore.kernel.org/all/20190507204921.GL23075@ZenIV.linux.org.uk/> [2]: <https://lore.kernel.org/linux-man/159680892602.29015.6551860260436544999.stgit@warthog.procyon.org.uk/> [3]: <https://github.com/brauner/man-pages-md> Co-authored-by: David Howells <dhowells@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Co-authored-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-Id: <20250925-new-mount-api-v5-0-028fb88023f2@cyphar.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/{fsconfig,mount_setattr}.2: NOTES: Add note about ↵Aleksa Sarai2-0/+51
attribute-parameter distinction This was not particularly well documented in mount(8) nor mount(2), and since this is a fairly notable aspect of the new mount API, we should probably add some words about it. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-ID: <20250925-new-mount-api-v5-8-028fb88023f2@cyphar.com> Reviewed-by: Askar Safin <safinaskar@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/open_tree{,_attr}.2: Document open_tree_attr(), and add link pageAleksa Sarai2-0/+192
This is a new API added in Linux 6.15, and is effectively just a minor expansion of open_tree(2) in order to allow for MOUNT_ATTR_IDMAP to be changed for an existing ID-mapped mount. glibc does not yet have a wrapper for this. While working on this man-page, I discovered a bug in open_tree_attr(2) that accidentally permitted changing MOUNT_ATTR_IDMAP for extant detached ID-mapped mount objects. This is definitely a bug, but there is no need to add this to BUGS because the patch to fix this has already been accepted (slated for 6.18, and will be backported to 6.15+). Cc: Christian Brauner <brauner@kernel.org> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-ID: <20250925-new-mount-api-v5-7-028fb88023f2@cyphar.com> Reviewed-by: Askar Safin <safinaskar@gmail.com> [alx: amend some examples: s/open_tree/&_attr/] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/open_tree.2: Add pageAleksa Sarai1-0/+518
This is loosely based on the original documentation written by David Howells and later maintained by Christian Brauner, but has been rewritten to be more from a user perspective (as well as fixing a few critical mistakes). Co-authored-by: David Howells <dhowells@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Co-authored-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-ID: <20250925-new-mount-api-v5-6-028fb88023f2@cyphar.com> Reviewed-by: Askar Safin <safinaskar@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/move_mount.2: Add pageAleksa Sarai1-0/+646
This is loosely based on the original documentation written by David Howells and later maintained by Christian Brauner, but has been rewritten to be more from a user perspective (as well as fixing a few critical mistakes). Co-authored-by: David Howells <dhowells@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Co-authored-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-ID: <20250925-new-mount-api-v5-5-028fb88023f2@cyphar.com> Reviewed-by: Askar Safin <safinaskar@gmail.com> [alx: ffix] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/fsmount.2: Add pageAleksa Sarai1-0/+231
This is loosely based on the original documentation written by David Howells and later maintained by Christian Brauner, but has been rewritten to be more from a user perspective (as well as fixing a few critical mistakes). Co-authored-by: David Howells <dhowells@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Co-authored-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-ID: <20250925-new-mount-api-v5-4-028fb88023f2@cyphar.com> Reviewed-by: Askar Safin <safinaskar@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/fsconfig.2: Add pageAleksa Sarai1-0/+729
This is loosely based on the original documentation written by David Howells and later maintained by Christian Brauner, but has been rewritten to be more from a user perspective (as well as fixing a few critical mistakes). Co-authored-by: David Howells <dhowells@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Co-authored-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-ID: <20250925-new-mount-api-v5-3-028fb88023f2@cyphar.com> Reviewed-by: Askar Safin <safinaskar@gmail.com> [alx: s/name/key/; ffix] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/fspick.2: Add pageAleksa Sarai1-0/+343
This is loosely based on the original documentation written by David Howells and later maintained by Christian Brauner, but has been rewritten to be more from a user perspective (as well as fixing a few critical mistakes). Co-authored-by: David Howells <dhowells@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Co-authored-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-ID: <20250925-new-mount-api-v5-2-028fb88023f2@cyphar.com> Reviewed-by: Askar Safin <safinaskar@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/fsopen.2: Add pageAleksa Sarai1-0/+385
This is loosely based on the original documentation written by David Howells and later maintained by Christian Brauner, but has been rewritten to be more from a user perspective (as well as fixing a few critical mistakes). Co-authored-by: David Howells <dhowells@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Co-authored-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-ID: <20250925-new-mount-api-v5-1-028fb88023f2@cyphar.com> Reviewed-by: Askar Safin <safinaskar@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/getsockopt.2: tfixCody Harris1-1/+1
Message-ID: <3589b9717dacf9e21bea9317da0840ad9095d7f1.1758570745.git.git@hypodyne.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/msgop.2: grfixKele Huang1-1/+1
Signed-off-by: Kele Huang <kele@cs.columbia.edu> Message-ID: <20250922035934.446271-6-kele@cs.columbia.edu> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/rt_sigqueueinfo.2: grfixKele Huang1-1/+1
Signed-off-by: Kele Huang <kele@cs.columbia.edu> Message-ID: <20250922035934.446271-5-kele@cs.columbia.edu> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/unshare.2: grfixKele Huang1-1/+1
Signed-off-by: Kele Huang <kele@cs.columbia.edu> Message-ID: <20250922035934.446271-4-kele@cs.columbia.edu> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/setns.2: grfixKele Huang1-1/+1
Signed-off-by: Kele Huang <kele@cs.columbia.edu> Message-ID: <20250922035934.446271-3-kele@cs.columbia.edu> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-10-01man/man2/getitimer.2: grfixKele Huang1-1/+1
Signed-off-by: Kele Huang <kele@cs.columbia.edu> Message-ID: <20250922035934.446271-2-kele@cs.columbia.edu> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-25man/: ffix (escape dashes)Alejandro Colomar7-14/+14
Most of these have been reported by 'make lint-man-dash'. A couple of them were found manually. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-25share/mk/: lint-man-dash: Diagnose unescaped dashesAlejandro Colomar3-0/+54
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-25share/mk/: build-catman-troff: Ignore adjustment warningAlejandro Colomar1-0/+1
This is too common, and I don't see a solution in many cases. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-21man-pages.7: STYLE GUIDE: Mention UNIX for BeginnersAlejandro Colomar1-0/+6
Reported-by: Peter Xu <peterx@redhat.com> [gbr: style fixes] Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
2025-09-21man/: Use semantic newlinesAlejandro Colomar482-3333/+4989
And fix related issues while at it. Silence false positives with \&. Reported-by: `make lint-man-semnl` Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-21share/mk/: lint-man-poems: Align outputAlejandro Colomar1-1/+8
pcre2grep(1) doesn't have a -T flag, so we need to script a bit to do something similar. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-21share/mk/: $AWK: Add dependencyAlejandro Colomar1-0/+14
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-21share/mk/: lint-man-poems: Diagnose (lack of) semantic newlinesAlejandro Colomar4-0/+54
Write poems, not prose. This only catches the most obvious issues, but at least that's something. We need pcre2grep(3) because it allows multiple patterns, whereas grep(1) in -P mode only accepts one. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-21share/mk/: $PCRE2GREP: Add dependencyAlejandro Colomar1-0/+14
This will be used for adding diagnostics about semantic newlines. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-21man/man2/mount_setattr.2: Mirror opening sentence from fsopen(2)Aleksa Sarai1-1/+5
All of the other new mount API docs have this lead-in sentence in order to make this set of APIs feel a little bit more cohesive. Despite being a bit of a latecomer, mount_setattr(2) is definitely part of this family of APIs and so deserves the same treatment. Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Message-ID: <20250919-new-mount-api-v4-8-1261201ab562@cyphar.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-20share/mk/: $CLANG_CFLAGS: Add -Wno-unknown-attributesAlejandro Colomar1-0/+1
Clang doesn't know [[gnu::nonnull]]. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-20man/man2/splice.2: EXAMPLES: Use [[gnu::nonstring]]Alejandro Colomar1-1/+2
This silences -Wunterminated-string-initialization. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-20share/mk/, etc/clang-tidy: Silence diagnostics about unnamed parametersAlejandro Colomar2-0/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-20man/man2/clock_getres.2: EXAMPLES: Don't name unused parametersAlejandro Colomar1-1/+1
This silences -Wunused-parameter. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-20man/: EXAMPLES: Use NITEMS() consistentlyAlejandro Colomar9-22/+24
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-20man/man3/streq.3: Add pageAlejandro Colomar1-0/+52
Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3611.txt> Link: <https://gitweb.git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=60b0949c939013bd8275fd9e6227014096d7c264> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-20man/man3/memeq.3: Add pageAlejandro Colomar1-0/+56
Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3617.txt> Link: <https://gitweb.git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=60b0949c939013bd8275fd9e6227014096d7c264> Signed-off-by: Alejandro Colomar <alx@kernel.org>