Commit Graph

918 Commits

Author SHA1 Message Date
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
Jeremy Soller 4a805ea97c Add some compatibility defines for libssh 2025-08-04 19:54:45 -06:00
Ron Williams b7589a63c5 Fixes to improve signals for openposixtestsuite 2025-08-04 07:37:14 -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
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 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
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 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
Bendeguz Pisch 4fc80ea7b0 Implement syslog functionality 2025-07-17 22:49:51 -06:00
Jeremy Soller 46c2f99919 Merge branch 'unix-domain-socket' into 'master'
feat: Implement Unix Domain Socket and related features.

See merge request redox-os/relibc!662
2025-07-17 22:48:37 -06:00
Ibuki Omatsu 206239f9a2 feat: Implement Unix Domain Socket and related features. 2025-07-17 22:48:37 -06: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
Jeremy Soller 5673575354 Revert "Merge branch 'rustifying' into 'master'"
This reverts merge request !663
2025-07-06 12:54:39 -06:00
Jeremy Soller 84bbf90ce1 Fix ___tls_get_addr on x86 2025-07-03 10:52:46 -06:00
David DA SILVA 7fd3a8d698 Rustify some functions (following TODO) 2025-06-25 08:39:01 -06:00
Jeremy Soller be49c1936a Make x86_64 mcontext not opaque 2025-05-13 10:05:32 -06:00
Jeremy Soller ac3eb38c0d Include bits/sys/ioctl.h in sys/ioctl.h 2025-05-13 08:13:49 -06:00
Jeremy Soller b2a6f00429 Use u64 for relibc internal fd set definition, does not affect C definition 2025-05-07 09:25:15 -06:00
Jeremy Soller a31584cdef Fix dangling pointer with empty scandir 2025-05-06 21:28:05 -06:00
Jeremy Soller d194554fdc Temporarily use insertion sort for qsort 2025-05-06 13:52:35 -06:00
Jeremy Soller 38cca8acc0 Fix select macros 2025-05-06 11:34:48 -06:00
Jeremy Soller 70d6a11606 openpty: terminate path with NUL 2025-05-06 09:28:58 -06:00
Jeremy Soller 1e48b13948 Debug recvmsg on redox 2025-05-04 09:32:10 -06:00
Jeremy Soller bb105d41ad scanf: fix parsing 0 when using %i 2025-05-03 21:15:58 -06:00
Jeremy Soller f8da7399d8 Use crates.io posix-regex and support extended regex 2025-05-03 16:31:04 -06:00
Jeremy Soller bce8eac3c7 Move CMSG functions to C macros 2025-05-03 11:21:27 -06:00
Josh Megnauth f85b33c3ed Handle unwraps in get_dns_server() 2025-05-02 23:01:12 -04:00
Jeremy Soller cafdcd35d1 Expose setegid and seteuid 2025-05-02 11:36:51 -06:00
Jeremy Soller 863171105d Move htonl, htons, ntohl, ntohs to netinet/in.h to support more packages 2025-05-02 09:49:37 -06:00
Jeremy Soller 58572ceefc Define _SC_NPROCESSORS_CONF 2025-05-01 14:54:04 -06:00
Ron Williams c779c1d941 Mark setitimer as unimplemented, obsolete 2025-04-21 23:29:35 -07:00
4lDO2 32c5e89c82 Return ID of new session in setsid. 2025-04-20 17:10:51 +02:00
4lDO2 e6c06a7cf7 Fix signals for spawned threads, and async signal waiting. 2025-04-19 19:27:03 +02:00
4lDO2 26c92af7ba Fix SigSet length. 2025-04-19 19:27:01 +02:00
4lDO2 a4dc232a33 Impl getres[ug]id C function. 2025-04-19 19:26:59 +02:00
Josh Megnauth a4826bd48c Implement BSD's err.h 2025-04-18 12:34:45 +00:00
4lDO2 d68f5d8d3d Make redox itimer relibc stub rather than kernel stub. 2025-04-13 18:18:05 +02:00
bjorn3 ea4c41686c Rustfmt 2025-04-12 22:15:05 +02:00
Jeremy Soller ed575e9259 Implement sigsetjmp on all archs 2025-04-11 20:18:27 -06:00
Jeremy Soller 72d2b1137c Implement quick_exit and at_quick_exit 2025-04-11 18:09:44 -06:00
Jeremy Soller d9a28156ce Disable at_quick_exit 2025-04-11 16:25:12 -06:00
Jeremy Soller 27f3924126 Fix msg_controllen and cmsg_len types 2025-04-10 14:52:26 -06:00
Jeremy Soller 5b5be9aae8 Add IPV6_JOIN/LEAVE_GROUP 2025-04-10 14:43:35 -06:00
Jeremy Soller b0be913956 Implement preadv and pwritev 2025-04-10 08:56:06 -06: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
Jeremy Soller 121e733990 Merge branch 'fix_arm64' into 'master'
Fix building for arm64

See merge request redox-os/relibc!636
2025-03-30 16:26:41 +00:00
bjorn3 50766b0469 Fix building on newer nighlies 2025-03-30 16:37:13 +02:00
bjorn3 8650ac293e Fix building on targets with unsigned c_char 2025-03-30 16:35:29 +02:00