From aa421ecfac7bdb343d8f3b3dde03ef1d1cb7db0c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 22 Feb 2026 14:08:34 +0100 Subject: misc fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 14 +++++------ libsyscalls.h | 64 +++++++++++++++++++++++------------------------ libsyscalls_get_syscall.c | 2 +- testutil/test-search.c | 8 +++--- 4 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Makefile b/Makefile index 7916431..bfe5c46 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ LIB_NAME = syscalls all: libsyscalls.a libsyscalls.$(LIBEXT) -#extended for each support operating system to download the operating system's source code +#extended for each supported operating system to download the operating system's source code download: @@ -79,24 +79,24 @@ include $(CONFIGFILE) # Reloading the user's config in case it limits supported architectures -#this not modify, this is a help variable to get the # symbol into sed scripts +# Do not modify: helper variable to get the # symbol into sed scripts h = '"$$(printf '\43\n')"' -#this not modify, this is a help variable to make [[:space:]] shorter +# Do not modify: helper variable to make [[:space:]] shorter s = [[:space:]] -#extended for each support operating system with the operating system's name as appropriate for filenames +#extended for each supported operating system with the operating system's name as appropriate for file names OPERATING_SYSTEMS = #extended with supported architectures for each operating system TEST_ENV = -#extended for each support operating system with the number of syscall parameters they use +#extended for each supported operating system with the number of syscall parameters it uses NPARAMS = -#extended for each support operating system with the maximum used number of fields in its structs and unions +#extended for each supported operating system with the maximum used number of fields in its structs and unions NFIELDS = -#extended for each support operating system +#extended for each supported operating system OBJ =\ libsyscalls_get_datatype_description.o\ libsyscalls_get_integer_alignment.o\ diff --git a/libsyscalls.h b/libsyscalls.h index df4de69..9d85ffb 100644 --- a/libsyscalls.h +++ b/libsyscalls.h @@ -360,7 +360,7 @@ enum libsyscalls_syscall_category { * is LIBSYSCALLS_NETWORK_ENABLED_IPC_SUBCAT_BIND may create index * nodes and LIBSYSCALLS_NETWORK_ENABLED_IPC_SUBCAT_CONNECT may * access the index nodes - * + * * May system calls used for this class of communication * objects used LIBSYSCALLS_CAT_FILE_DESCRIPTORS system calls */ @@ -547,8 +547,8 @@ enum libsyscalls_ipc_syscall_subcategory { * System calls that operate on the filesystem or can either * operate on a filesystem or a file descriptor that does * not involve the filesystem but is usually used with a - * filesystem; this category also include system calls that - * effect such systems but does not itself touch the filesystem + * filesystem; this category also includes system calls that + * affect such systems but do not themselves touch the filesystem * but rather the process * * System calls in this category may have timeouts that may @@ -564,7 +564,7 @@ enum libsyscalls_filesystem_syscall_subcategory { LIBSYSCALLS_FILESYSTEM_SUBCAT_STAT, /** - * System calls that motifies the metadata of file + * System calls that modify the metadata of a file * * chmod(2) and fchmodat(2) are examples of system calls * in this category; fchmod(2) however is not @@ -581,7 +581,7 @@ enum libsyscalls_filesystem_syscall_subcategory { LIBSYSCALLS_FILESYSTEM_SUBCAT_SYNC, /** - * System calls the create named index nodes (links) + * System calls that create named index nodes (links) * on a filesystem * * Note that LIBSYSCALLS_NETWORK_ENABLED_IPC_SUBCAT_BIND @@ -593,7 +593,7 @@ enum libsyscalls_filesystem_syscall_subcategory { LIBSYSCALLS_FILESYSTEM_SUBCAT_LINK, /** - * System calls the remove the path to an index node + * System calls that remove the path to an index node * (removes a link) on a filesystem * * unlink(2) and rmdir(2) are examples of system calls @@ -627,7 +627,7 @@ enum libsyscalls_filesystem_syscall_subcategory { /** * System calles that in some way operate on * mountpoints - * + * * Note that some system calls in the category takes * file descriptors as input or outputs * @@ -922,7 +922,7 @@ enum libsyscalls_file_syscall_descriptors_subcategory { /** * System calls that affect a process itself - * + * * Much of the information that can be queried * with system calls in this category may be * available through a virtual filesystem @@ -972,18 +972,18 @@ enum libsyscalls_processes_syscall_subcategory { /** * System calls that change the process's privileges - * + * * The system call may also retrieve information * about the process * - * setuid(2) in an example of a system call in this + * setuid(2) is an example of a system call in this * category */ LIBSYSCALLS_PROCESSES_SUBCAT_CHANGE_PERMISSIONS, /** - * System calls that forks the process, either - * the create a new process or a new thread + * System calls that fork the process, either + * to create a new process or a new thread * * fork(2) and clone(2) are examples of system * calls in this category @@ -991,7 +991,7 @@ enum libsyscalls_processes_syscall_subcategory { LIBSYSCALLS_PROCESSES_SUBCAT_CLONE, /** - * System calls that changes the program the + * System calls that change the program the * process is executing * * execve(2) and execveat(2) are examples of @@ -1003,7 +1003,7 @@ enum libsyscalls_processes_syscall_subcategory { * System calls that change the working directory * of the process or thread * - * chdir(2) in an example of a system call in + * chdir(2) is an example of a system call in * this category */ LIBSYSCALLS_PROCESSES_SUBCAT_CHDIR, @@ -1028,8 +1028,8 @@ enum libsyscalls_processes_syscall_subcategory { }; /** - * System calls that enables or disable system logging - * + * System calls that enable or disable system logging + * * For each system call in this category, the system call * may use the filesystem or a file descriptor */ @@ -1113,7 +1113,7 @@ enum libsyscalls_time_syscall_subcategory { * System calls that read the amount of time * remaining until a timer that uses relative * time is run over (is triggered) - * + * * These system calls may also retrieve a timer's * overrun interval * @@ -1287,7 +1287,7 @@ enum libsyscalls_memory_syscall_subcategory { LIBSYSCALLS_MEMORY_SUBCAT_WRITE_OR_ADVISE, /** - * System calls that prevent memory to be + * System calls that prevent memory from being * paged out into the swap area * * mlock(2) is an example of a system call in @@ -1296,7 +1296,7 @@ enum libsyscalls_memory_syscall_subcategory { LIBSYSCALLS_MEMORY_SUBCAT_LOCK, /** - * System calls that enables memory to be + * System calls that enable memory to be * paged out into the swap area * * munlock(2) is an example of a system call in @@ -1401,7 +1401,7 @@ enum libsyscalls_system_syscall_subcategory { * System calls that are generally harmless and * required for a process to perform important * actions - * + * * On Linux the following system calls have this * classification: * - getpagesize(2) @@ -1566,7 +1566,7 @@ struct libsyscalls_syscall_abi { * If 1, the system call invocation must be parsed * especially as it is not does follow what is * proscribed for the used data types - * + * * The library may use this temporarily until it * in a later version provides a convension that * can be followed @@ -1630,7 +1630,7 @@ struct libsyscalls_syscall { /** * Like .actual_syscall except this is used for example when * a 32-bit process is running on a 64-bit operating system - * + * * If `NULL` use .actual_syscall */ struct libsyscalls_syscall_abi *actual_compat_syscall; @@ -1643,7 +1643,7 @@ struct libsyscalls_named_number { /** * The value if the number, it is up to the * application select signess - * + * * It is usually safe to use unsigned (.u) * as the numbers are usually positive but * not so large that the sign bit would be @@ -1742,7 +1742,7 @@ struct libsyscalls_syscall_type_info { /** * The data type used for the parameter or return value * in the specific invocation of the system call - * + * * If set to LIBSYSCALLS_TYPE_VOID for an optional * parameter, that parameter was not used */ @@ -1784,7 +1784,7 @@ struct libsyscalls_syscall_display_info { /** * Information about each system call parameter - * + * * All positive integer within [0, .max_argument_count] * for the `struct libsyscalls_syscall_abi` are valid, * but no index beyond `.max_argument_count` is valid @@ -2254,7 +2254,7 @@ struct libsyscalls_datatype_description { /** * Only used if .is_signed is 1 - * + * * How signed numbers are represented */ enum libsyscalls_datatype_sign_representation sign_representation : 8; @@ -2273,7 +2273,7 @@ struct libsyscalls_datatype_description { * This is a ~0 terminated array — but, it can also * be terminated by the end of the array — describing * the order of the bytes the the data type - * + * * The lowest non-zero values contains the width of * a byte (in bytes), however no such value exists * in this array if the data type is just one byte @@ -2283,11 +2283,11 @@ struct libsyscalls_datatype_description { * I from 0, it shall be shifted left .byteorder[i] * bits; the bitwise OR of the results is the * unsigned value used in the instance of the data type - * + * * Data types for register-splits/struct field-splits * ARE NOT shifted, there is always a value in * .byteorder that is 0, unless .byteorder[0] is ~0 - * + * * To avoid problems checking for ~0, use the * LIBSYSCALLS_IS_BYTEORDER_END macro; please also be * aware that both the type and length can change in @@ -2431,7 +2431,7 @@ struct libsyscalls_structure_field { * Note that there are types that fundamentally are * pointers (such as strings), for these, this bit * is not set unless it is a pointer to a string - * + * * This field may always 0 when .input_field is 0 */ unsigned short int input_pointer : 1; @@ -2711,7 +2711,7 @@ libsyscalls_get_syscall(enum libsyscalls_os os, enum libsyscalls_arch arch, * the selected architecture (`arch`) on the * selected operating system (`os`) * LIBSYSCALLS_E_NOERRORS - The operating system does not use named error numbers - * + * * This function will always fail if the operating system (`os`) * is not supported, however it may be successful even if the * architecture (`arch`) not supported @@ -2751,7 +2751,7 @@ libsyscalls_get_syscall_errors(enum libsyscalls_os os, enum libsyscalls_arch arc * the selected architecture (`arch`) on the * selected operating system (`os`) * LIBSYSCALLS_E_NOSIGNALS - The operating system does not use named signal numbers - * + * * This function will always fail if the operating system (`os`) * is not supported, however it may be successful even if the * architecture (`arch`) not supported diff --git a/libsyscalls_get_syscall.c b/libsyscalls_get_syscall.c index e025e18..fb54956 100644 --- a/libsyscalls_get_syscall.c +++ b/libsyscalls_get_syscall.c @@ -7,7 +7,7 @@ libsyscalls_get_syscall(enum libsyscalls_os os, enum libsyscalls_arch arch, long const struct libsyscalls_syscall **syscall_out) { const struct libsyscalls_syscall *syscalldesc; - static enum libsyscalls_error error; + enum libsyscalls_error error; long long int min, max; error = libsyscalls_get_syscall_range(os, arch, &min, &max); diff --git a/testutil/test-search.c b/testutil/test-search.c index 93d6d03..5b8c613 100644 --- a/testutil/test-search.c +++ b/testutil/test-search.c @@ -45,7 +45,7 @@ check(unsigned long long int key, const struct libsyscalls_named_number *base, s int main(int argc, char **argv_) { - int os, arch, search_singals, is_signed; + int os, arch, search_signals, is_signed; enum libsyscalls_error err; const struct libsyscalls_named_number *base, *min, *max; unsigned long long int ukey; @@ -61,15 +61,15 @@ main(int argc, char **argv_) } if (!strcmp(argv[1], "signals")) - search_singals = 1; + search_signals = 1; else if (!strcmp(argv[1], "errors")) - search_singals = 0; + search_signals = 0; else goto usage; os = atoi(argv[2]); arch = atoi(argv[3]); - if (search_singals) + if (search_signals) err = libsyscalls_get_signals((enum libsyscalls_os)os, (enum libsyscalls_arch)arch, &base, &n, &is_signed); else err = libsyscalls_get_syscall_errors((enum libsyscalls_os)os, (enum libsyscalls_arch)arch, &base, &n, &is_signed); -- cgit v1.2.3-70-g09d2