Skip to content

Commit e8081be

Browse files
committed
New C functions pidfd_spawn(3) & friends
Not yet fully implemented, but I want to push this since I've also fixed various instances of `const char` to the more preferred `char const`.
1 parent b282dfd commit e8081be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+956
-643
lines changed

kos/include/bsd/libutil.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* HASH CRC-32:0xd9b4b15a */
1+
/* HASH CRC-32:0x4540d3f6 */
22
/* Copyright (c) 2019-2025 Griefer@Work *
33
* *
44
* This software is provided 'as-is', without any express or implied *
@@ -74,30 +74,30 @@ __SYSDECL_BEGIN
7474
__CDECLARE(,int,__NOTHROW_NCX,humanize_number,(char *__buf, __SIZE_TYPE__ __len, __INT64_TYPE__ __bytes, char const *__suffix, int __scale, int __flags),(__buf,__len,__bytes,__suffix,__scale,__flags))
7575
#endif /* !__humanize_number_defined && __CRT_HAVE_humanize_number */
7676
#ifdef __CRT_HAVE_flopen
77-
__LIBC __fd_t __NOTHROW_RPC(__VLIBCCALL flopen)(const char *__path, __oflag_t __flags, ...) __CASMNAME_SAME("flopen");
77+
__LIBC __fd_t __NOTHROW_RPC(__VLIBCCALL flopen)(char const *__path, __oflag_t __flags, ...) __CASMNAME_SAME("flopen");
7878
#else /* __CRT_HAVE_flopen */
7979
#include <asm/os/fcntl.h>
8080
#include <asm/os/oflags.h>
8181
#include <bits/os/stat.h>
8282
#if (defined(__AT_FDCWD) && (defined(__CRT_HAVE_flopenat) || (defined(__LOCK_EX) && (defined(__LOCK_NB) || !defined(__O_NONBLOCK)) && (defined(__CRT_HAVE_openat64) || defined(__CRT_HAVE_openat)) && (defined(__CRT_HAVE_flock) || defined(__CRT_HAVE___flock)) && ((defined(__CRT_HAVE_kfstat) && defined(__CRT_KOS_PRIMARY)) || (defined(__CRT_HAVE_kfstat64) && defined(__CRT_KOS_PRIMARY)) || defined(__CRT_HAVE_fstat) || defined(__CRT_HAVE_fstat64) || defined(__CRT_HAVE___fstat64_time64) || defined(__CRT_HAVE__fstat) || defined(__CRT_HAVE__fstat32) || defined(__CRT_HAVE__fstati64) || defined(__CRT_HAVE__fstat32i64) || defined(__CRT_HAVE__fstat64) || defined(__CRT_HAVE__fstat64i32)) && ((defined(__CRT_HAVE_kfstatat) && defined(__CRT_KOS_PRIMARY)) || (defined(__CRT_HAVE_kfstatat64) && defined(__CRT_KOS_PRIMARY)) || defined(__CRT_HAVE_fstatat) || defined(__CRT_HAVE_fstatat64) || defined(__CRT_HAVE___fstatat64_time64)) && (defined(__CRT_HAVE_ftruncate64) || defined(__CRT_HAVE__chsize_s) || defined(__CRT_HAVE_ftruncate) || defined(__CRT_HAVE___ftruncate) || defined(__CRT_HAVE___libc_ftruncate) || defined(__CRT_HAVE__chsize) || defined(__CRT_HAVE_chsize) || !defined(__O_TRUNC))))) || (defined(__LOCK_EX) && (defined(__LOCK_NB) || !defined(__O_NONBLOCK)) && (defined(__CRT_HAVE_openat64) || defined(__CRT_HAVE_openat)) && (defined(__CRT_HAVE_flock) || defined(__CRT_HAVE___flock)) && ((defined(__CRT_HAVE_kfstat) && defined(__CRT_KOS_PRIMARY)) || (defined(__CRT_HAVE_kfstat64) && defined(__CRT_KOS_PRIMARY)) || defined(__CRT_HAVE_fstat) || defined(__CRT_HAVE_fstat64) || defined(__CRT_HAVE___fstat64_time64) || defined(__CRT_HAVE__fstat) || defined(__CRT_HAVE__fstat32) || defined(__CRT_HAVE__fstati64) || defined(__CRT_HAVE__fstat32i64) || defined(__CRT_HAVE__fstat64) || defined(__CRT_HAVE__fstat64i32)) && ((defined(__AT_FDCWD) && ((defined(__CRT_HAVE_kfstatat) && defined(__CRT_KOS_PRIMARY)) || (defined(__CRT_HAVE_kfstatat64) && defined(__CRT_KOS_PRIMARY)) || defined(__CRT_HAVE_fstatat) || defined(__CRT_HAVE_fstatat64) || defined(__CRT_HAVE___fstatat64_time64))) || (defined(__CRT_HAVE_kstat) && defined(__CRT_KOS_PRIMARY)) || (defined(__CRT_HAVE_kstat64) && defined(__CRT_KOS_PRIMARY)) || defined(__CRT_HAVE_stat) || defined(__CRT_HAVE_stat64) || defined(__CRT_HAVE___stat64_time64) || defined(__CRT_HAVE__stat) || defined(__CRT_HAVE__stat32) || defined(__CRT_HAVE__stati64) || defined(__CRT_HAVE__stat32i64) || defined(__CRT_HAVE__stat64) || defined(__CRT_HAVE__stat64i32)) && (defined(__CRT_HAVE_ftruncate64) || defined(__CRT_HAVE__chsize_s) || defined(__CRT_HAVE_ftruncate) || defined(__CRT_HAVE___ftruncate) || defined(__CRT_HAVE___libc_ftruncate) || defined(__CRT_HAVE__chsize) || defined(__CRT_HAVE_chsize) || !defined(__O_TRUNC)))
8383
#include <libc/local/bsd.libutil/flopen.h>
8484
#if defined(__cplusplus) && __has_builtin(__builtin_va_arg_pack)
85-
__NAMESPACE_LOCAL_USING_OR_IMPL(flopen, __FORCELOCAL __ATTR_ARTIFICIAL __fd_t __NOTHROW_RPC(__VLIBCCALL flopen)(const char *__path, __oflag_t __flags, ...) { return (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(flopen))(__path, __flags, __builtin_va_arg_pack()); })
85+
__NAMESPACE_LOCAL_USING_OR_IMPL(flopen, __FORCELOCAL __ATTR_ARTIFICIAL __fd_t __NOTHROW_RPC(__VLIBCCALL flopen)(char const *__path, __oflag_t __flags, ...) { return (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(flopen))(__path, __flags, __builtin_va_arg_pack()); })
8686
#else /* __cplusplus && __has_builtin(__builtin_va_arg_pack) */
8787
#define flopen(...) (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(flopen))(__VA_ARGS__)
8888
#endif /* !__cplusplus || !__has_builtin(__builtin_va_arg_pack) */
8989
#endif /* (__AT_FDCWD && (__CRT_HAVE_flopenat || (__LOCK_EX && (__LOCK_NB || !__O_NONBLOCK) && (__CRT_HAVE_openat64 || __CRT_HAVE_openat) && (__CRT_HAVE_flock || __CRT_HAVE___flock) && ((__CRT_HAVE_kfstat && __CRT_KOS_PRIMARY) || (__CRT_HAVE_kfstat64 && __CRT_KOS_PRIMARY) || __CRT_HAVE_fstat || __CRT_HAVE_fstat64 || __CRT_HAVE___fstat64_time64 || __CRT_HAVE__fstat || __CRT_HAVE__fstat32 || __CRT_HAVE__fstati64 || __CRT_HAVE__fstat32i64 || __CRT_HAVE__fstat64 || __CRT_HAVE__fstat64i32) && ((__CRT_HAVE_kfstatat && __CRT_KOS_PRIMARY) || (__CRT_HAVE_kfstatat64 && __CRT_KOS_PRIMARY) || __CRT_HAVE_fstatat || __CRT_HAVE_fstatat64 || __CRT_HAVE___fstatat64_time64) && (__CRT_HAVE_ftruncate64 || __CRT_HAVE__chsize_s || __CRT_HAVE_ftruncate || __CRT_HAVE___ftruncate || __CRT_HAVE___libc_ftruncate || __CRT_HAVE__chsize || __CRT_HAVE_chsize || !__O_TRUNC)))) || (__LOCK_EX && (__LOCK_NB || !__O_NONBLOCK) && (__CRT_HAVE_openat64 || __CRT_HAVE_openat) && (__CRT_HAVE_flock || __CRT_HAVE___flock) && ((__CRT_HAVE_kfstat && __CRT_KOS_PRIMARY) || (__CRT_HAVE_kfstat64 && __CRT_KOS_PRIMARY) || __CRT_HAVE_fstat || __CRT_HAVE_fstat64 || __CRT_HAVE___fstat64_time64 || __CRT_HAVE__fstat || __CRT_HAVE__fstat32 || __CRT_HAVE__fstati64 || __CRT_HAVE__fstat32i64 || __CRT_HAVE__fstat64 || __CRT_HAVE__fstat64i32) && ((__AT_FDCWD && ((__CRT_HAVE_kfstatat && __CRT_KOS_PRIMARY) || (__CRT_HAVE_kfstatat64 && __CRT_KOS_PRIMARY) || __CRT_HAVE_fstatat || __CRT_HAVE_fstatat64 || __CRT_HAVE___fstatat64_time64)) || (__CRT_HAVE_kstat && __CRT_KOS_PRIMARY) || (__CRT_HAVE_kstat64 && __CRT_KOS_PRIMARY) || __CRT_HAVE_stat || __CRT_HAVE_stat64 || __CRT_HAVE___stat64_time64 || __CRT_HAVE__stat || __CRT_HAVE__stat32 || __CRT_HAVE__stati64 || __CRT_HAVE__stat32i64 || __CRT_HAVE__stat64 || __CRT_HAVE__stat64i32) && (__CRT_HAVE_ftruncate64 || __CRT_HAVE__chsize_s || __CRT_HAVE_ftruncate || __CRT_HAVE___ftruncate || __CRT_HAVE___libc_ftruncate || __CRT_HAVE__chsize || __CRT_HAVE_chsize || !__O_TRUNC)) */
9090
#endif /* !__CRT_HAVE_flopen */
9191
#ifdef __CRT_HAVE_flopenat
92-
__LIBC __fd_t __NOTHROW_RPC(__VLIBCCALL flopenat)(__fd_t __dirfd, const char *__path, __oflag_t __flags, ...) __CASMNAME_SAME("flopenat");
92+
__LIBC __fd_t __NOTHROW_RPC(__VLIBCCALL flopenat)(__fd_t __dirfd, char const *__path, __oflag_t __flags, ...) __CASMNAME_SAME("flopenat");
9393
#else /* __CRT_HAVE_flopenat */
9494
#include <asm/os/fcntl.h>
9595
#include <asm/os/oflags.h>
9696
#include <bits/os/stat.h>
9797
#if defined(__LOCK_EX) && (defined(__LOCK_NB) || !defined(__O_NONBLOCK)) && (defined(__CRT_HAVE_openat64) || defined(__CRT_HAVE_openat)) && (defined(__CRT_HAVE_flock) || defined(__CRT_HAVE___flock)) && ((defined(__CRT_HAVE_kfstat) && defined(__CRT_KOS_PRIMARY)) || (defined(__CRT_HAVE_kfstat64) && defined(__CRT_KOS_PRIMARY)) || defined(__CRT_HAVE_fstat) || defined(__CRT_HAVE_fstat64) || defined(__CRT_HAVE___fstat64_time64) || defined(__CRT_HAVE__fstat) || defined(__CRT_HAVE__fstat32) || defined(__CRT_HAVE__fstati64) || defined(__CRT_HAVE__fstat32i64) || defined(__CRT_HAVE__fstat64) || defined(__CRT_HAVE__fstat64i32)) && ((defined(__CRT_HAVE_kfstatat) && defined(__CRT_KOS_PRIMARY)) || (defined(__CRT_HAVE_kfstatat64) && defined(__CRT_KOS_PRIMARY)) || defined(__CRT_HAVE_fstatat) || defined(__CRT_HAVE_fstatat64) || defined(__CRT_HAVE___fstatat64_time64)) && (defined(__CRT_HAVE_ftruncate64) || defined(__CRT_HAVE__chsize_s) || defined(__CRT_HAVE_ftruncate) || defined(__CRT_HAVE___ftruncate) || defined(__CRT_HAVE___libc_ftruncate) || defined(__CRT_HAVE__chsize) || defined(__CRT_HAVE_chsize) || !defined(__O_TRUNC))
9898
#include <libc/local/bsd.libutil/flopenat.h>
9999
#if defined(__cplusplus) && __has_builtin(__builtin_va_arg_pack)
100-
__NAMESPACE_LOCAL_USING_OR_IMPL(flopenat, __FORCELOCAL __ATTR_ARTIFICIAL __fd_t __NOTHROW_RPC(__VLIBCCALL flopenat)(__fd_t __dirfd, const char *__path, __oflag_t __flags, ...) { return (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(flopenat))(__dirfd, __path, __flags, __builtin_va_arg_pack()); })
100+
__NAMESPACE_LOCAL_USING_OR_IMPL(flopenat, __FORCELOCAL __ATTR_ARTIFICIAL __fd_t __NOTHROW_RPC(__VLIBCCALL flopenat)(__fd_t __dirfd, char const *__path, __oflag_t __flags, ...) { return (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(flopenat))(__dirfd, __path, __flags, __builtin_va_arg_pack()); })
101101
#else /* __cplusplus && __has_builtin(__builtin_va_arg_pack) */
102102
#define flopenat(...) (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(flopenat))(__VA_ARGS__)
103103
#endif /* !__cplusplus || !__has_builtin(__builtin_va_arg_pack) */

kos/include/conio.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* HASH CRC-32:0x90622937 */
1+
/* HASH CRC-32:0xf740266a */
22
/* Copyright (c) 2019-2025 Griefer@Work *
33
* *
44
* This software is provided 'as-is', without any express or implied *
@@ -759,14 +759,14 @@ __NAMESPACE_LOCAL_USING_OR_IMPL(clearkeybuf, __FORCELOCAL __ATTR_ARTIFICIAL void
759759
#ifdef __CRT_HAVE__conio_getpass
760760
/* >> _conio_getpass(3)
761761
* CONIO version of getpass(3). But note the slightly different variant from `<unistd.h>' */
762-
__CREDIRECT(__ATTR_IN(1) __ATTR_INOUT(2),char *,__NOTHROW_RPC,getpass,(const char *__prompt, char *__str),_conio_getpass,(__prompt,__str))
762+
__CREDIRECT(__ATTR_IN(1) __ATTR_INOUT(2),char *,__NOTHROW_RPC,getpass,(char const *__prompt, char *__str),_conio_getpass,(__prompt,__str))
763763
#else /* __CRT_HAVE__conio_getpass */
764764
#include <asm/os/stdio.h>
765765
#if defined(__CRT_HAVE_getpass_r) || defined(__CRT_HAVE_getpassfd) || defined(__CRT_HAVE_read) || defined(__CRT_HAVE__read) || defined(__CRT_HAVE___read) || defined(__CRT_HAVE___libc_read) || defined(__CRT_HAVE_readpassphrase)
766766
#include <libc/local/conio/_conio_getpass.h>
767767
/* >> _conio_getpass(3)
768768
* CONIO version of getpass(3). But note the slightly different variant from `<unistd.h>' */
769-
__FORCELOCAL __ATTR_ARTIFICIAL __ATTR_IN(1) __ATTR_INOUT(2) char *__NOTHROW_RPC(__LIBCCALL getpass)(const char *__prompt, char *__str) { return (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(_conio_getpass))(__prompt, __str); }
769+
__FORCELOCAL __ATTR_ARTIFICIAL __ATTR_IN(1) __ATTR_INOUT(2) char *__NOTHROW_RPC(__LIBCCALL getpass)(char const *__prompt, char *__str) { return (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(_conio_getpass))(__prompt, __str); }
770770
#else /* __CRT_HAVE_getpass_r || __CRT_HAVE_getpassfd || __CRT_HAVE_read || __CRT_HAVE__read || __CRT_HAVE___read || __CRT_HAVE___libc_read || __CRT_HAVE_readpassphrase */
771771
#undef __getpass_defined
772772
#endif /* !__CRT_HAVE_getpass_r && !__CRT_HAVE_getpassfd && !__CRT_HAVE_read && !__CRT_HAVE__read && !__CRT_HAVE___read && !__CRT_HAVE___libc_read && !__CRT_HAVE_readpassphrase */

kos/include/corecrt_wstring.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* HASH CRC-32:0x27874d4d */
1+
/* HASH CRC-32:0x7ac8f3b9 */
22
/* Copyright (c) 2019-2025 Griefer@Work *
33
* *
44
* This software is provided 'as-is', without any express or implied *
@@ -969,11 +969,11 @@ __NAMESPACE_LOCAL_END
969969
__LOCAL __ATTR_PURE __ATTR_WUNUSED __ATTR_INS(1, 2) __SIZE_TYPE__ __NOTHROW_NCX(__LIBCCALL wcsnlen_s)(wchar_t const *__str, __SIZE_TYPE__ __maxlen) { return __str ? (__NAMESPACE_LOCAL_SYM __localdep_wcsnlen)(__str, __maxlen) : 0; }
970970
#ifdef __CRT_HAVE_wcsncat_s
971971
/* >> wcsncat_s(3) */
972-
__CDECLARE(__ATTR_INOUT_OPT(1) __ATTR_IN_OPT(3),__errno_t,__NOTHROW_NCX,wcsncat_s,(wchar_t *__dst, rsize_t __dstsize, const wchar_t *__src, rsize_t __maxlen),(__dst,__dstsize,__src,__maxlen))
972+
__CDECLARE(__ATTR_INOUT_OPT(1) __ATTR_IN_OPT(3),__errno_t,__NOTHROW_NCX,wcsncat_s,(wchar_t *__dst, rsize_t __dstsize, wchar_t const *__src, rsize_t __maxlen),(__dst,__dstsize,__src,__maxlen))
973973
#else /* __CRT_HAVE_wcsncat_s */
974974
#include <libc/local/corecrt_wstring/wcsncat_s.h>
975975
/* >> wcsncat_s(3) */
976-
__NAMESPACE_LOCAL_USING_OR_IMPL(wcsncat_s, __FORCELOCAL __ATTR_ARTIFICIAL __ATTR_INOUT_OPT(1) __ATTR_IN_OPT(3) __errno_t __NOTHROW_NCX(__LIBCCALL wcsncat_s)(wchar_t *__dst, rsize_t __dstsize, const wchar_t *__src, rsize_t __maxlen) { return (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(wcsncat_s))(__dst, __dstsize, __src, __maxlen); })
976+
__NAMESPACE_LOCAL_USING_OR_IMPL(wcsncat_s, __FORCELOCAL __ATTR_ARTIFICIAL __ATTR_INOUT_OPT(1) __ATTR_IN_OPT(3) __errno_t __NOTHROW_NCX(__LIBCCALL wcsncat_s)(wchar_t *__dst, rsize_t __dstsize, wchar_t const *__src, rsize_t __maxlen) { return (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(wcsncat_s))(__dst, __dstsize, __src, __maxlen); })
977977
#endif /* !__CRT_HAVE_wcsncat_s */
978978
#ifdef __CRT_HAVE_wcsncpy_s
979979
/* >> wcsncpy_s(3) */

kos/include/cthreads.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* HASH CRC-32:0xc41ced9f */
1+
/* HASH CRC-32:0x4878fcb3 */
22
/* Copyright (c) 2019-2025 Griefer@Work *
33
* *
44
* This software is provided 'as-is', without any express or implied *
@@ -140,10 +140,10 @@ typedef struct mutex *mutex_t;
140140
struct mutex {
141141
spin_lock_t held; /* Underlying lock */
142142
spin_lock_t lock; /* Unused */
143-
const char *name; /* [0..1] Name (for debugging) */
143+
char const *name; /* [0..1] Name (for debugging) */
144144
struct cthread_queue queue; /* Unused */
145145
#ifdef WAIT_FUNC_DEBUG
146-
const char *fname; /* Debugging? */
146+
char const *fname; /* Debugging? */
147147
#else /* WAIT_FUNC_DEBUG */
148148
struct cthread *holder; /* Debugging? */
149149
#endif /* WAIT_FUNC_DEBUG */

kos/include/error.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* HASH CRC-32:0x755cd883 */
1+
/* HASH CRC-32:0xb5fe52b2 */
22
/* Copyright (c) 2019-2025 Griefer@Work *
33
* *
44
* This software is provided 'as-is', without any express or implied *
@@ -52,7 +52,7 @@ __SYSDECL_BEGIN
5252
* Also note that `stdout' is flushed before the message is printed.
5353
* If `status' is non-zero, follow up with a call to `exit(status)' */
5454
#if __has_builtin(__builtin_va_arg_pack)
55-
__NAMESPACE_FAST_USING_OR_IMPL(error, __FORCELOCAL __ATTR_ARTIFICIAL __ATTR_LIBC_PRINTF(3, 4) void __NOTHROW_CB_NCX(__VLIBCCALL error)(int __status, __errno_t __errnum, const char *__format, ...) { (__NAMESPACE_FAST_SYM __LIBC_FAST_NAME(error))(__status, __errnum, __format, __builtin_va_arg_pack()); })
55+
__NAMESPACE_FAST_USING_OR_IMPL(error, __FORCELOCAL __ATTR_ARTIFICIAL __ATTR_LIBC_PRINTF(3, 4) void __NOTHROW_CB_NCX(__VLIBCCALL error)(int __status, __errno_t __errnum, char const *__format, ...) { (__NAMESPACE_FAST_SYM __LIBC_FAST_NAME(error))(__status, __errnum, __format, __builtin_va_arg_pack()); })
5656
#else /* __has_builtin(__builtin_va_arg_pack) */
5757
#define error(...) (__NAMESPACE_FAST_SYM __LIBC_FAST_NAME(error))(__VA_ARGS__)
5858
#endif /* !__has_builtin(__builtin_va_arg_pack) */
@@ -62,7 +62,7 @@ __NAMESPACE_FAST_USING_OR_IMPL(error, __FORCELOCAL __ATTR_ARTIFICIAL __ATTR_LIBC
6262
* The message is printed as: `<program_invocation_short_name>: <format...>[: <strerror(errnum)>]\n'
6363
* Also note that `stdout' is flushed before the message is printed.
6464
* If `status' is non-zero, follow up with a call to `exit(status)' */
65-
__LIBC __ATTR_LIBC_PRINTF(3, 4) void __NOTHROW_CB_NCX(__VLIBCCALL error)(int __status, __errno_t __errnum, const char *__format, ...) __CASMNAME_SAME("error");
65+
__LIBC __ATTR_LIBC_PRINTF(3, 4) void __NOTHROW_CB_NCX(__VLIBCCALL error)(int __status, __errno_t __errnum, char const *__format, ...) __CASMNAME_SAME("error");
6666
#else /* ... */
6767
#include <libc/template/stdstreams.h>
6868
#include <libc/template/program_invocation_name.h>
@@ -75,7 +75,7 @@ __LIBC __ATTR_LIBC_PRINTF(3, 4) void __NOTHROW_CB_NCX(__VLIBCCALL error)(int __s
7575
* Also note that `stdout' is flushed before the message is printed.
7676
* If `status' is non-zero, follow up with a call to `exit(status)' */
7777
#if defined(__cplusplus) && __has_builtin(__builtin_va_arg_pack)
78-
__NAMESPACE_LOCAL_USING_OR_IMPL(error, __FORCELOCAL __ATTR_ARTIFICIAL __ATTR_LIBC_PRINTF(3, 4) void __NOTHROW_CB_NCX(__VLIBCCALL error)(int __status, __errno_t __errnum, const char *__format, ...) { (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(error))(__status, __errnum, __format, __builtin_va_arg_pack()); })
78+
__NAMESPACE_LOCAL_USING_OR_IMPL(error, __FORCELOCAL __ATTR_ARTIFICIAL __ATTR_LIBC_PRINTF(3, 4) void __NOTHROW_CB_NCX(__VLIBCCALL error)(int __status, __errno_t __errnum, char const *__format, ...) { (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(error))(__status, __errnum, __format, __builtin_va_arg_pack()); })
7979
#else /* __cplusplus && __has_builtin(__builtin_va_arg_pack) */
8080
#define error(...) (__NAMESPACE_LOCAL_SYM __LIBC_LOCAL_NAME(error))(__VA_ARGS__)
8181
#endif /* !__cplusplus || !__has_builtin(__builtin_va_arg_pack) */

kos/include/fmtmsg.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* HASH CRC-32:0x3a1f51c8 */
1+
/* HASH CRC-32:0xc41505c0 */
22
/* Copyright (c) 2019-2025 Griefer@Work *
33
* *
44
* This software is provided 'as-is', without any express or implied *
@@ -134,7 +134,7 @@ __SYSDECL_BEGIN
134134
* @return: MM_NOTOK: Arguments are bad
135135
* @return: MM_OK: Success
136136
* @return: MM_NOMSG: Failed to print message to `stderr(3)' */
137-
__CDECLARE_OPT(,int,__NOTHROW_NCX,fmtmsg,(long __classification, const char *__label, __STDC_INT_AS_UINT_T __severity, char const *__text, char const *__action, char const *__tag),(__classification,__label,__severity,__text,__action,__tag))
137+
__CDECLARE_OPT(,int,__NOTHROW_NCX,fmtmsg,(long __classification, char const *__label, __STDC_INT_AS_UINT_T __severity, char const *__text, char const *__action, char const *__tag),(__classification,__label,__severity,__text,__action,__tag))
138138

139139
#ifdef __USE_MISC
140140
/* >> addseverity(3)
@@ -159,7 +159,7 @@ __CDECLARE_OPT(,int,__NOTHROW_NCX,fmtmsg,(long __classification, const char *__l
159159
* @return: MM_NOTOK: The given `severity' is `< 5' (errno was not modified)
160160
* @return: MM_NOTOK: Out of memory (errno was set to `ENOMEM')
161161
* @return: MM_NOTOK: No such `severity' and `s == NULL' (errno was not modified) */
162-
__CDECLARE_OPT(,int,__NOTHROW_NCX,addseverity,(__STDC_INT_AS_UINT_T __severity, const char *__s),(__severity,__s))
162+
__CDECLARE_OPT(,int,__NOTHROW_NCX,addseverity,(__STDC_INT_AS_UINT_T __severity, char const *__s),(__severity,__s))
163163
#endif /* __USE_MISC */
164164

165165
__SYSDECL_END

0 commit comments

Comments
 (0)