Commit Graph

529 Commits

Author SHA1 Message Date
Josh Megnauth e677ad55d5 Better priorities & LOG_UPTO for syslog.h
* Fix PERROR to match musl/glibc better
* More unit tests + enabled on Linux
* Pack priority and facility into one i32 and check the bits with
  bitflags
* Add LOG_UPTO (logic is straight from musl)

Not done:
* "%m" - this could just be added to printf
* LOG_CONS
2025-08-01 23:45:26 -04:00
Josh Megnauth 64d9847e37 Linux support for syslog.h
Linux's syslog is a local socket, so this uses the recent UDS work.

* Most of redox.rs is refactored into mod.rs now which has all of the C
  facing functions and consts.
* I wrapped the global logger in a Mutex instead of a RwLock. The logger
  is almost always locked for writing so a Mutex is simpler as RwLock
  provides no benefits.
* I implemented LOG_PERROR which also prints errors to stderr as well as
  the log.
* Syslog should be sys/syslog.h with syslog.h as an alias (the
  original code only had syslog.h).
2025-07-24 21:46:49 -04:00
Bendeguz Pisch 4fc80ea7b0 Implement syslog functionality 2025-07-17 22:49:51 -06:00
Josh Megnauth c7da3c2c6b Add disabled test for rename symlink bug
This test should rename disabled until redox-os/relibc#212 is fixed. The
test works on Linux so it should work on Redox eventually too.

The issue is non-trivial because it involves a syscall, frename, that
may need to be redesigned. frename requires a file descriptor, but
opening a file resolves links which in turn fails with broken symlinks.
2025-07-12 21:33:33 -04:00
Ron Williams 770dc71816 Fix CI, Add signal.h constants 2025-07-11 20:28:45 -06:00
Josh Megnauth 1d5179eb71 Const calculate buffer size for strerror
The current buffer size is hard set to 256. Using const evaluation, the
maximum buf size can be calculated at compile time.
2025-07-10 03:18:17 +00:00
zinzaguras 7b877b713f Adjust shell scripts to properly get bash from environment 2025-05-11 03:02:40 +03:00
Jeremy Soller a2e040ce4d Merge branch 'strto-detect-endptr' into 'master'
Fix strtol/ul endptr with detected base

See merge request redox-os/relibc!656
2025-05-02 10:36:05 -06:00
Arne de Bruijn de3dd54266 Fix strtol/ul endptr with detected base
The "0" or "0x" characters with base 0 were not accounted for in the
returned endptr value.
2025-05-02 12:18:34 +02:00
4lDO2 8863a8967f Fix sigpause-suspend. 2025-04-20 21:17:40 +02:00
4lDO2 3947cda43a Fix sigpause-revert test. 2025-04-20 21:17:40 +02:00
4lDO2 95d2b59120 Improvements to sigpause and sigrelse tests. 2025-04-20 21:17:40 +02:00
4lDO2 799a9ef8d5 Misc improvements. 2025-04-20 21:17:40 +02:00
4lDO2 d1081b278c Fix sigset-5 and sigset-10. 2025-04-20 21:17:39 +02:00
4lDO2 cb23a518c0 Improve sigprocmask-9 test. 2025-04-20 21:17:39 +02:00
4lDO2 df228ddd79 Add remaining tests. 2025-04-20 21:17:39 +02:00
4lDO2 240a41861c Rebase, misc fixes for test suite. 2025-04-20 21:17:39 +02:00
Josh Williams 77cf9fc2a1 added tests to makefile and run_tests 2025-04-20 21:17:39 +02:00
Josh Williams 38e3320fb0 fixed sigprocmask-10 on linux 2025-04-20 21:17:39 +02:00
Josh Williams 493839baf5 fixed killpg-child on linux 2025-04-20 21:17:39 +02:00
Josh Williams a017dd1909 most recent updates to sigset-5 and 10 2025-04-20 21:17:39 +02:00
Josh Williams 70b997b249 switched to master makefile, run_tests and test_helpers 2025-04-20 21:17:39 +02:00
Josh Williams 2d3374f176 add tests to makefile and run_tests 2025-04-20 21:17:38 +02:00
Josh Williams 2bc44dba9d modify makefile and run_tests
fix compiler warnings
2025-04-20 21:17:38 +02:00
Josh Williams a2e19224a4 add signals-tests to makefile and run_tests 2025-04-20 21:17:38 +02:00
Josh Williams a7e9135bc9 clean up more tests 2025-04-20 21:17:38 +02:00
Josh Williams 6f787d20e5 clean up some tests 2025-04-20 21:17:38 +02:00
Josh Williams 9116eaa66d clean up a bunch of tests 2025-04-20 21:17:38 +02:00
Josh Williams 901b8099a2 add stdint.h to test_helpers
add tests for signals
2025-04-20 21:17:35 +02:00
4lDO2 c25b4c67e1 Add kill-waitpid test. 2025-04-19 19:27:02 +02:00
4lDO2 37b60b67e0 Add and fix test for kill&waitpid. 2025-04-19 19:27:02 +02:00
4lDO2 0083043736 Write and fix waitpid_multiple test. 2025-04-19 19:27:02 +02:00
4lDO2 134914c580 Expand waitpid test. 2025-04-19 19:27:00 +02:00
4lDO2 c99e9c7db3 Add waitpid test back. 2025-04-19 19:27:00 +02:00
4lDO2 2fb247266b Fix typo in pthread_exit test. 2025-04-19 19:27:00 +02:00
4lDO2 9e769fcb57 Add pthread_exit test.
This caught a bug in the kernel where it would return Ok(24) when
passing zero extra-munmap length.
2025-04-19 19:27:00 +02:00
Josh Megnauth a4826bd48c Implement BSD's err.h 2025-04-18 12:34:45 +00:00
Josh Megnauth 090391d94f fix(strptime): Don't clobber struct tm
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.
2025-04-01 23:35:29 -04:00
Darley Barreto 26573d02d1 Time improvements 2025-03-29 19:29:20 +00:00
Josh Megnauth e827b4f61f Add strptime tests 2025-03-29 14:01:29 +00:00
GrayJack c7d94ae4d7 feat(c23): Implement %b and %B format 2025-03-22 20:15:56 -03:00
Josh Megnauth ccc1b7f560 strftime: ISO-8601 leap weeks 2025-03-20 02:34:26 -04:00
Darley Barreto dda7142385 Few improvements to time.h 2025-02-26 23:58:57 +00:00
Jeremy Soller 56a1d9c3e9 Merge branch 'pvalloc2' into 'master'
Add pvalloc()

See merge request redox-os/relibc!614
2025-02-12 17:58:25 +00:00
Peter Limkilde Svendsen b3f36faf87 Add pvalloc() 2025-02-11 21:13:51 +01:00
Ron Williams 6ea993bf46 Fix sigqueue test 2025-02-07 22:04:01 +00:00
Jeremy Soller e7a24b3f7f Merge branch 'sleep-intr' into 'master'
Make nanosleep and sleep handle interrupts correctly, plus fix alarm

See merge request redox-os/relibc!605
2025-01-31 21:10:15 +00:00
Ron Williams c528c0885f Make nanosleep and sleep handle interrupts correctly, plus fix alarm 2025-01-31 21:10:14 +00:00
Peter Limkilde Svendsen 38d22bd735 Suppress warnings about deprecated declarations in C 2025-01-30 21:41:52 +01:00
Jeremy Soller 25b0da4876 Merge branch 'sigsetjmp_x64_implementation' into 'master'
Implement sigsetjmp and siglongjmp for X64

See merge request redox-os/relibc!478
2025-01-04 00:29:19 +00:00