Replaced todo_skip stub with proper wcsxfrm() implementation.
The wide-char string transformation uses the current locale's
collation. Red Bear has no locale support, so the transformation
is the identity (same as C/POSIX locale). Cross-referenced with
Linux 7.1 time/wcsxfrm.c.
Behavior:
- n=0: count length of ws2 (excluding null terminator)
- n>0: copy ws2 to ws1 with null terminator, cap at n-1 chars
- Returns number of wide chars written (excluding null terminator)
Implemented wcsftime() as wide-char variant of strftime.
Cross-referenced from Linux 7.1 time/wcsftime.c.
Algorithm: convert wchar format to UTF-8 byte string (non-ASCII
chars replaced with '?'), call strftime::strftime with byte format
to format into a byte buffer, then convert each output byte to
a wchar_t in the output buffer (maxsize-1 chars + null terminator).
Also exposed time::strftime module as pub for cross-module access.
Replaced ENOSYS stub with proper POSIX madvise() implementation
cross-referenced from Linux 7.1 mm/madvise.c.
Flag validation: MADV_NORMAL, RANDOM, SEQUENTIAL, WILLNEED, DONTNEED.
Address must be page-aligned. Unknown flags → EINVAL.
Red Bear has no page cache, swap, or lazy allocation. All MADV_*
flags are no-ops: the hints are advisory and the kernel is free to
ignore them. MADV_DONTNEED would need page table teardown support
which is not implemented.
Replaced ENOSYS stub with proper POSIX msync() implementation
cross-referenced from Linux 7.1 mm/msync.c:42-55.
Flag validation: MS_ASYNC|MS_INVALIDATE|MS_SYNC, rejects unknown
flags and MS_ASYNC|MS_SYNC combination. Address page-aligned check.
Length rounded to page boundary with overflow check.
Red Bear filesystem I/O is synchronous (no writeback cache).
MS_SYNC/MS_ASYNC are no-ops. MS_INVALIDATE not implemented (needs
kernel cache invalidation), but stale cache is not a concern
with direct filesystem reads.
Adds a submodules convenience target to main makefile. Submodules must
be initialized before other targets can run successfully.
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
* load TLS segment for executable - while we can skip PT_LOAD for executable,
we still have to load TLS segment.
* set TCB address based on if elf is position independent
Typically it's the other way around, but we can't have shared library named libc.so.6 in target/release directory.
cargo includes 'target/release' in LD_LIBRARY_PATH for build script, so even if clean build runs fine,
every subsquent run will make build script link with relibc.