Commit Graph

2928 Commits

Author SHA1 Message Date
Josh Megnauth 9d2f5d95dc Implement confstr (unistd.h)
The implementation for confstr is straightforward. Most of the constants
return 1 on both musl and glibc. The only constant that doesn't is
required for Fish.

I also switched an #[unsafe(no_mangle)] from my last patch back
to a #[no_mangle] because we need to bump cbindgen. #[unsafe(no_mangle)]
is required for Rust 2024.
2025-08-22 22:13:51 -04:00
Jeremy Soller 4758685217 Merge branch 'netdb-openssh' into 'master'
Implement getnameinfo and getaddrinfo loopback

See merge request redox-os/relibc!693
2025-08-20 06:59:31 -06:00
Jeremy Soller d513ba003c Merge branch 'fix-linux-sysconf' into 'master'
Improve sysconf.h on Linux

Closes #218

See merge request redox-os/relibc!691
2025-08-20 06:58:27 -06:00
Jeremy Soller f046864f10 Merge branch 'ixany-openssh' into 'master'
Add termios IXANY

See merge request redox-os/relibc!692
2025-08-20 06:54:47 -06:00
Wildan M 14bb1c87c3 Fix fmt 2025-08-20 18:40:18 +07:00
Wildan M 5334455a20 Implement getnameinfo and getaddrinfo loopback 2025-08-20 18:26:27 +07:00
Wildan Mubarok c3437b70a9 Add termios IXANY 2025-08-20 07:39:15 +00:00
Josh Megnauth 70ae45ff85 Improve sysconf.h on Linux
I copied the constants and definitions from musl which we can presume is
correct. Relibc is missing some features which affects our sysconf as
well, such as constants in limits.h or a working resources.h.
2025-08-20 02:05:05 -04:00
Jeremy Soller 8f9614920d Merge branch 'rlimit_constants_i32' into 'master'
Switch resource.h enum to c_int instead of u64

See merge request redox-os/relibc!690
2025-08-17 08:17:02 -06:00
Josh Megnauth d14ae1c148 Switch resource.h enum to c_int instead of u64
Most platforms use a c_int though glibc uses a u32. GNU defines a type,
__rlimit_resource_t, for the RLIMIT enum that is a u32.

Using a c_int is nicer for a few reasons. The first is that our
(unimplemented) functions receive a c_int for the enum - using a u32 is
technically wrong but doesn't affect anything since the constants are
turned into macros by cbindgen.

The second reason is that a c_int is nicer for libc and nix (the crate)
too since we don't need to pollute the crates with guards for Redox.
2025-08-16 23:52:03 -04:00
Jeremy Soller 89ddc82d42 Merge branch 'add-vdisable' into 'master'
Add termios constant for VDISABLE

See merge request redox-os/relibc!689
2025-08-15 06:58:42 -06:00
Josh Megnauth c3c9e3f619 Add termios constant for VDISABLE
_POSIX_VDISABLE is an extension that disables terminal special
characters.

See:
* redox-os/termios!3
* redox-os/base!27
2025-08-14 01:57:24 -04:00
Jeremy Soller f170902a29 Add u_int types for compatibility 2025-08-13 09:36:26 -06:00
Jeremy Soller f5bc50f104 Merge branch 'paths-h' into 'master'
Add paths.h for Fish

See merge request redox-os/relibc!687
2025-08-11 14:14:58 -06:00
Jeremy Soller 09b71bdbe0 Merge branch 'fix-trace' into 'master'
Fix trace feature

See merge request redox-os/relibc!686
2025-08-11 14:11:49 -06:00
Jeremy Soller 551c79c526 Merge branch 'redoxer-test' into 'master'
Enable some tests in Redox

See merge request redox-os/relibc!685
2025-08-11 14:11:16 -06:00
Darley Barreto b0aac4e8f6 Enable some tests in Redox 2025-08-11 14:11:15 -06:00
Jeremy Soller a57dbfb13f Merge branch 'test-statvfs' into 'master'
Add basic test for statvfs

See merge request redox-os/relibc!683
2025-08-11 14:10:31 -06:00
Jeremy Soller 7e1940b941 Merge branch 'printf-m-modifier' into 'master'
Add %m to printf & fix CI

See merge request redox-os/relibc!682
2025-08-11 14:09:37 -06:00
Josh Megnauth cfe00d3316 Add paths.h for Fish
Fish only requires BSHELL. The constants are implementation specific so
this header will evolve as needed.

Cbindgen doesn't emit defines for strings (even CStrs) so I only
provided what's needed for Fish in a C header for now with the ideal
implementation, in Rust, unbuilt.
2025-08-09 01:16:12 -04:00
Wildan Mubarok c7a1966a67 Fix trace feature 2025-08-08 23:41:07 +00:00
Wildan M b3b806cafd Simplify test code 2025-08-07 08:46:54 +07:00
Wildan M c7405e09bd Add statvfs tests to Makefile 2025-08-07 07:35:40 +07:00
Wildan M 0248aab7d4 Add basic test for statvfs 2025-08-07 07:19:56 +07:00
Josh Megnauth 728fb55203 Add %m to printf & fix CI
%m is a format specifier that prints an error string for errno. The
specifier is technically only for syslog, but musl and glibc implement
it for printf itself. Parsing for a single specifier in a single
function is error prone, especially when syslog itself is variadic.
2025-08-06 02:38:47 -04:00
Jeremy Soller 710911febb Merge branch 'fix-syslog-tests' into 'master'
Move syslog tests to the correct location

See merge request redox-os/relibc!681
2025-08-04 20:35:27 -06:00
Josh Megnauth 292a4b18a9 Move syslog tests to correct location 2025-08-04 22:20:17 -04:00
Jeremy Soller 4a805ea97c Add some compatibility defines for libssh 2025-08-04 19:54:45 -06:00
Jeremy Soller 311d5621b8 Merge branch 'signals-stuff' into 'master'
Fixes to improve signals for openposixtestsuite

See merge request redox-os/relibc!680
2025-08-04 07:37:14 -06:00
Ron Williams b7589a63c5 Fixes to improve signals for openposixtestsuite 2025-08-04 07:37:14 -06:00
Jeremy Soller 1105a2092f Merge branch 'syslog-expand-features' into 'master'
Better priorities & LOG_UPTO for syslog.h

See merge request redox-os/relibc!679
2025-08-02 06:52:35 -06:00
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
Jeremy Soller 1694cd3a4d fix redox stat st_blocks 2025-08-01 12:44:10 -06:00
Jeremy Soller 6dd10a1f11 Fix connect on redox 2025-08-01 10:33:55 -06:00
Jeremy Soller 4f9267be59 Merge branch 'syslog-add-linux' into 'master'
Linux support for syslog.h

See merge request redox-os/relibc!675
2025-07-26 06:56:50 -06: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
Jeremy Soller 9e1ff3185e Merge branch 'backport-cstr-fns' into 'master'
Backport count_bytes and is_empty for CStr

See merge request redox-os/relibc!678
2025-07-22 06:42:12 -06:00
Josh Megnauth 57c46f4dd8 Backport count_bytes and is_empty for CStr 2025-07-21 23:47:50 -04:00
Jeremy Soller 6babec246d Merge branch 'fix-gocgo' into 'master'
Update pthread_attr_getstacksize to fix Go CGO

See merge request redox-os/relibc!676
2025-07-21 07:54:37 -06:00
Jeremy Soller 2e92f987a9 Merge branch 'grp-header' into 'master'
Fix grp.h headers for Go

See merge request redox-os/relibc!677
2025-07-21 07:53:33 -06:00
Wildan Mubarok 0af7d7fdb5 Revert gid_t/uid_t 2025-07-21 00:22:38 +00:00
Wildan Mubarok 2c4bd8d061 Fix grp.h and gid_t/uid_t for Go 2025-07-21 00:15:02 +00:00
Wildan Mubarok b23ac06a01 Update pthread_attr_getstacksize to fix Go CGO 2025-07-20 17:01:47 +00:00
Jeremy Soller 648d3be78e Merge branch 'get_socket_token' into 'master'
feat: Add redox_get_socket_token_v0 as a symbol for libredox.

See merge request redox-os/relibc!674
2025-07-19 07:36:21 -06:00
Ibuki.O b86f8a36fa feat: Add redox_get_socket_token_v0 as a symbol for libredox. 2025-07-19 13:31:44 +09:00
4lDO2 518798f64e Return EINVAL when killing with sig > 64. 2025-07-18 21:50:01 +02:00
4lDO2 40b8064eae Fix raise signal number being -32. 2025-07-18 20:35:33 +02:00
Jeremy Soller 2672e2aa43 Merge branch 'bind-connect-redoxfs' into 'master'
feat: Integrate UDS bind and connect operation with RedoxFS and switch get_proc_credentials to a capability-based approach.

See merge request redox-os/relibc!665
2025-07-18 08:57:49 -06:00
Ibuki Omatsu d44010170f feat: Integrate UDS bind and connect operation with RedoxFS and switch get_proc_credentials to a capability-based approach. 2025-07-18 08:57:49 -06:00
Jeremy Soller eb2d61fdff Merge branch 'impl_syslog' into 'master'
Implement syslog functionality

See merge request redox-os/relibc!626
2025-07-17 22:49:51 -06:00