Commit Graph

70 Commits

Author SHA1 Message Date
Jeremy Soller ced734c162 Add RawCell::unsafe_set 2025-10-04 07:50:16 -06:00
Jeremy Soller 82084440ad Support nightly-2025-10-03 2025-10-03 21:51:10 -06:00
Jacob Lorentzon 9c5f11fbc8 Add Out<T> wrapper 2025-09-21 14:36:12 +02:00
Wildan M 726a0fb1a8 Implement getaddrinfo NULL nodename, AI_PASSIVE, AI_NUMERICHOST 2025-09-15 15:10:50 +07: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
Josh Megnauth f85b33c3ed Handle unwraps in get_dns_server() 2025-05-02 23:01:12 -04: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 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 8650ac293e Fix building on targets with unsigned c_char 2025-03-30 16:35:29 +02:00
Josh Megnauth 51c04d2470 Use C string literals & deprecate c_str! 2025-03-14 21:17:53 -04:00
Anhad Singh c286ad2868 fix(ld.so): do not depend on TLS at all
In the next big refactor (next PR), all of the platform functionality
used by both relibc and ld.so will be moved into a `platform`/`sysdeps`
crate and then ld.so would be moved out of relibc and not link with it.

I think doing it in a seperate PR would make it more managable, as when
I did half of it, the diff was pretty huge and that way it would be
easier to review too :)

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-05 23:11:59 +11:00
Josh Megnauth fc1e220a99 fix(netdb): Buffer overrun when parsing DNS 2024-11-18 13:43:22 +00:00
Jeremy Soller ce7b85b0df Merge branch 'dont-overallocate-cstrings' into 'master'
Avoid over allocations & reallocations

See merge request redox-os/relibc!558
2024-11-17 16:17:22 +00:00
Josh Megnauth 5348273ccc Emit C attributes via cbindgen 2024-11-17 16:15:07 +00:00
Josh Megnauth d6ac5f8947 Avoid over allocations & reallocations
As we know, vectors amortize the cost of adding new elements by reserving
space for multiple elements when full. This is useful but may lead to
allocating more memory than necessary.

`relibc` generally avoids over allocations by reserving the exact amount
of space when possible. I fixed a few areas that still over allocated or
reallocated unnecessarily by leveraging iterators that are more likely
to know sizes.
2024-11-14 22:53:12 -05:00
Josh Megnauth bf1ea4e799 Set h_errno for gethostbyname/addr 2024-11-02 12:21:47 +00:00
Josh Megnauth 701e57197a fix(netdb): Out of bounds in gethostbyaddr and less transmutes 2024-10-29 12:26:46 +00:00
4lDO2 6e5959b3fa Convert a bunch of c_int to Result<(), Errno>. 2024-09-26 16:21:34 +02:00
4lDO2 198caa3bc5 Rustify Sys::open and some fs:: error handling. 2024-09-11 23:22:32 +02:00
Peter Limkilde Svendsen a7137512fa Use standard casing and mangling for internal errno 2024-03-01 00:25:42 +00:00
Peter Limkilde Svendsen 9093f6bc47 Use Cell representation for errno 2024-02-29 14:07:40 +00:00
4lDO2 75d1c67ca2 Switch to a lightweight CStr wrapper 2023-11-04 18:29:38 +00:00
Noa df6f4678e8 Fix warnings 2023-05-30 13:46:17 -05:00
4lDO2 b9f19f4326 Get pcid to work using this pthread impl. 2023-05-06 17:02:51 +02:00
Jeremy Soller 9e0c53f222 Make long 32-bits on 32-bit systems 2022-12-01 18:33:00 -07:00
Jeremy Soller 4b90afeb2a Merge branch 'hstrerror' into 'master'
Implement hstrerror

See merge request redox-os/relibc!341
2022-08-12 12:18:08 +00:00
Jeremy Soller 6b46704ac3 Fix netdb stack overuse 2021-11-30 10:30:31 -07:00
Noa f06af86ac6 Implement hstrerror 2021-08-13 17:27:10 -05:00
oddcoder 37a462de5d Apply cargo fmt to the whole repo 2020-07-19 21:27:38 +02:00
jD91mZM2 593925ceb4 Unambiguate all include guards
GNU binutils also uses _FNMATCH_H for a guard, maybe along others!
2020-06-29 11:34:51 +02:00
Giuseppe Longo 12beb13987 netdb: implement getnetbynane and getnetent
This patch implements getnetbyname and getnetent functions.
2020-06-07 14:02:41 +02:00
AdminXVII 884ec85838 Replace occurences of uninitialized with MaybeUninit
mem::uninitialized is deprecated, so move over the not-UB MaybeUninit.
2020-01-20 16:54:22 +00:00
jD91mZM2 b8c50c7c64 Format 2019-08-04 19:05:45 +02:00
jD91mZM2 c7d499d4f2 Upgrade to the 2018 edition
I didn't think it'd be this useful first, but thank god for `cargo fix --edition`!
2019-08-04 19:05:45 +02:00
Mateusz Mikuła 63a1319e50 Cbindgen update 2019-07-10 10:08:39 +00:00
Mateusz Mikuła 7597c082e7 Fix Clippy warnings 2019-05-11 22:34:13 +02:00
Jeremy Soller 7bde036031 Remove va_list submodule, format 2019-04-21 15:45:55 -06:00
jD91mZM2 6d4ac9dba8 Finally, get rid of all rust warnings
Just a small step along the way to reduce the massive wall of spam
every time you compile.

This was done partly automagically with `cargo fix`. The rest was me
deleting or commenting out a bunch of variables. Hope nothing was
important...
2019-04-21 21:12:16 +02:00
Jeremy Soller f4c036c3aa Fix returning incorrect ai_socktype from getaddrinfo 2019-04-01 20:34:53 -06:00
Jeremy Soller 38da5552e8 getaddrinfo: support for setting port from service argument (numeric only) 2019-02-02 14:20:26 -07:00
Jeremy Soller c59f268fcd Implement getaddrinfo (somewhat) 2019-01-21 20:36:56 -07:00
Jeremy Soller f25c494a73 Show hint information 2019-01-20 20:12:58 -07:00
Jeremy Soller 047deceed0 Move hostent functions to separate file 2019-01-17 20:45:25 -07:00
Jeremy Soller d0261ebb35 Move db to crate root 2019-01-17 19:56:51 -07:00
Jeremy Soller c71088e768 Cleanup and format 2019-01-14 21:07:24 -07:00
Jeremy Soller 8dabff129a Begin work on getnameinfo 2019-01-14 19:26:35 -07:00
Jeremy Soller 594e53c6f1 addrinfo stub 2019-01-13 14:37:20 -07:00
Jeremy Soller 6c0c6dd71b Fix missing negative flags in netdb.h, add NI_MAXHOST and NI_MAXSERV 2019-01-13 10:34:17 -07:00
Jeremy Soller 018ff409f1 Add gai_strerror 2019-01-13 10:24:30 -07:00