Our strptime implementation uses subformatting to handle specifiers that
expand to other specifiers. For example, '%T' expands to "%H:%M%:%S".
Relibc calls strptime again to handle '%T' by expanding it.
However, our strptime zeroes out struct tm which clobbers old values. If
strptime is called with a format string like "%D%t%T", the set values
for '%D' are clobbered.
Zeroing out the struct is extra, unneeded work as well. The user may
want to preserve old values. We don't read from struct tm so we don't
have to worry about invalid values. Finally, `musl` and `glibc` don't
clear the values either so we can default to their behavior.
Even though it might seem like it, it is not necessary that write(2) is
the only system call performed. It could be that the libc has to
allocate memory (via MMAP) or makes use of a futex. To produce
consistant results, only log on SYS_write and when the syscall number
has been patched.
Signed-off-by: Anhad Singh <andypython@protonmail.com>
Fix CI break.
man pthread_barrier_wait(3)
> ...the constant PTHREAD_BARRIER_SERIAL_THREAD shall be returned to
> one *unspecified* thread and zero shall be returned to each of the remaining
> threads.
Signed-off-by: Anhad Singh <andypython@protonmail.com>
Memory chunk is allocated with `malloc` and used as the `dest` buffer
for `strncat`. The `dest` argument in `strncat` has to be NUL terminated,
however it was not.
This commit fixes this issue in mk{fifo,nod,noat}.c.
Almost all dynamic tests pass now.
Signed-off-by: Anhad Singh <andypython@protonmail.com>
From man dlopen(3)
> According to the ISO C standard, casting between function
> pointers and 'void *', as done above, produces undefined results.
> POSIX.1-2001 and POSIX.1-2008 accepted this state of affairs and
> proposed the following workaround:
>
> *(void **) (&cosine) = dlsym(handle, "cos");
>
> This (clumsy) cast conforms with the ISO C standard and will
> avoid any compiler warnings.
>
> The 2013 Technical Corrigendum 1 to POSIX.1-2008 improved matters
> by requiring that conforming implementations support casting
> 'void *' to a function pointer. Nevertheless, some compilers
> (e.g., gcc with the '-pedantic' option) may complain about the
> cast used in this program.
Signed-off-by: Anhad Singh <andypython@protonmail.com>