Commit Graph

1427 Commits

Author SHA1 Message Date
Jeremy Soller 73e1d6307b Merge branch 'socket-fix' into 'master'
Socket fix

See merge request redox-os/relibc!281
2020-06-19 11:58:24 +00:00
jD91mZM2 cdc9aa06e3 Fix getpeername
Rust's TcpListener fails because of the address format being wrong. The format
comes from `accept`, but there we internally use this function.
2020-06-19 13:56:06 +02:00
Jeremy Soller ca8b848b48 Merge branch 'headers' into 'master'
Headers

See merge request redox-os/relibc!280
2020-06-14 20:38:04 +00:00
oddcoder f4d95ce43f Add sys/select.h to sys/types.h
This was triggered by gcc for some reason It included sys/types.h and
assumed sys/select.h to be there. And that seams to be the case in musl.

The problem with relibc here is that sys/types.h is are part of relibc
"include/*.h" files, while sys/select.h is generated by cbindgen. That
makes it impossible to #include select.h in types.h epsecially that
there are files like fcntl.c that uses types.h. They would complain
about missing headers. I fixed this by renaming sys/types.h to
sys/types_internal.h and then generating types.h using cbindgen as well
except for that. however fcntl and dlmalloc can include types_internal
instead of types.h
2020-06-14 22:00:16 +02:00
oddcoder a125b8be15 Make stdbool.h C++ compatiable
The problem here is that _Bool type is not defined in C++ yet this file
is using it. That leads to issues when compiling gcc. I borrowed the
same techniques used in other stdbool.h
2020-06-14 22:00:10 +02:00
Jeremy Soller 68679e41f0 Add redoxer.sh script to simplify running tests on redox 2020-06-09 20:55:55 -06:00
Jeremy Soller b771313ffd Merge branch 'master' of https://gitlab.redox-os.org/redox-os/relibc 2020-06-07 14:01:00 -06:00
Jeremy Soller b0dde81c75 Handle missing paths in load_library search without using access 2020-06-07 14:00:48 -06:00
Jeremy Soller 7bc11dc6c2 Merge branch 'relibc-netdb-v1' into 'master'
netdb: implement getnetbynane and getnetent

See merge request redox-os/relibc!278
2020-06-07 12:27:54 +00:00
Giuseppe Longo 12beb13987 netdb: implement getnetbynane and getnetent
This patch implements getnetbyname and getnetent functions.
2020-06-07 14:02:41 +02:00
Jeremy Soller d9bacaec04 Fix compilation on Redox by removing use of access in ld_so 2020-06-06 21:00:57 -06:00
Jeremy Soller d0c1160299 Merge branch 'scanf' into 'master'
Scanf

See merge request redox-os/relibc!277
2020-06-06 19:32:54 +00:00
oddcoder 92d6735e3f Add more scanf tests 2020-06-03 23:20:53 +02:00
oddcoder 8973535fdc Make scanf write to string and increase match count only when a pattern is matched
This is the behavior of glibc which I assume to be right
2020-06-03 23:20:52 +02:00
oddcoder 018f7a3f38 Fix scanf.stdout as per glibc 2020-06-03 23:20:52 +02:00
oddcoder a49139ca2f use lookahead buffer in inner_scanf 2020-06-03 23:20:52 +02:00
oddcoder 14e011b72c Implemment lookaheadreader with lookahead and commit api
The LookAheadReader api works similar to read but it has 2 methods,
lookahead: it will read 1 byte (with internal ftell) without modifying
the file's own ftell() and commit() which saves the current file ftell

LookAheadReader can wrap both buffers and files
2020-06-03 23:20:52 +02:00
oddcoder f068673adc Separate the logic from locking in ftello and fseeko 2020-06-03 23:20:52 +02:00
oddcoder 164ef739b3 Apply Cargo fmt for src/ld_so 2020-06-03 23:20:52 +02:00
Jeremy Soller 12d3838f42 Merge branch 'fpermissive' into 'master'
FIX error: right operand of shift expression '(1 << BLA)' is greater than or...

See merge request redox-os/relibc!276
2020-06-02 21:52:17 +00:00
no name c02849dd73 FIX error: right operand of shift expression '(1 << BLA)' is greater than or equal to the precision BLA of the left operand [-fpermissive] 2020-06-02 23:27:15 +02:00
Jeremy Soller 5aa74fd2f3 Merge branch 'master' of https://gitlab.redox-os.org/redox-os/relibc 2020-06-02 08:35:41 -06:00
Jeremy Soller 604f1c11a2 Build xargo locally 2020-06-02 08:35:37 -06:00
Jeremy Soller b165eacffd Remove unnecessary compiler-builtins patch 2020-06-02 08:30:06 -06:00
Jeremy Soller e7f5e412a1 Merge branch 'LD_LIBRARY_PATH' into 'master'
Ld library path

See merge request redox-os/relibc!275
2020-06-01 12:23:46 +00:00
oddcoder 3aacc160a1 Remove dependency on errno in ld.so
During early parts of ld.so, errno and other thread local variables are
not yet initialized so we cannot use function (such as unistd::access)
that depends on such thread local variables (errno). For this reason
this patch creates small wrapper around the syscall that doesn't not
touch the errno
2020-06-01 11:49:38 +02:00
oddcoder 1b10c3d246 Prioterize search path instead of overwriting it.
Current LD_LIBRARY_PATH implementation overwrites the original search
path, which is not the best idea, instead this patch would check
LD_LIBRARY_PATH first and if it didn't find the libraries it is looking
for, then it will search the original search path
2020-06-01 11:41:19 +02:00
Jeremy Soller c7910a8754 Add __need_winit_t to wctype.h 2020-05-28 13:43:55 -06:00
Jeremy Soller ae34ade595 Use path to patch compiler-builtins 2020-05-27 20:24:59 -06:00
Jeremy Soller 8de10072b6 Add compiler-builtins patch 2020-05-27 20:18:52 -06:00
Jeremy Soller b2338968a2 Merge branch 'alignment-test-nullcheck' into 'master'
Don't accept null pointer in tests when requesting aligned memory

See merge request redox-os/relibc!272
2020-05-24 19:19:12 +00:00
Jeremy Soller 39346f5c05 Merge branch 'simplify-posix_memalign' into 'master'
Minor fixes to posix_memalign()

See merge request redox-os/relibc!271
2020-05-24 19:18:53 +00:00
Peter Limkilde Svendsen cf9c2ed0ba Don't accept null pointer when requesting aligned memory 2020-05-24 18:39:53 +02:00
Peter Limkilde Svendsen da8d2fa7aa Always set memptr in posix_memalign() 2020-05-24 18:29:57 +02:00
Peter Limkilde Svendsen 60b23003c7 Simplify alignment check in posix_memalign() 2020-05-24 18:17:27 +02:00
Jeremy Soller e4c26cfaa0 Merge branch 'gcc-regressions' into 'master'
Gcc regressions

See merge request redox-os/relibc!270
2020-05-23 15:16:36 +00:00
oddcoder 7eba6d88df Add test for negative pad stupport in printf 2020-05-23 16:20:20 +02:00
oddcoder ee5e2bad5a Support negative padding size in printf and friends
as it seams you can do something like
        printf ("A%*s%s/\n", -5, "B", "CC");
and it will print the padding to the left
2020-05-23 16:20:20 +02:00
oddcoder 1b131b8c60 Test off by one bug in vfscanf 2020-05-23 16:20:20 +02:00
oddcoder d7d3e00867 Fix off-by-1 error in vfscanf
Scanf function requires look ahead to function properly, In case of
scanning from a buffer that will not be an issue, but in our case we are
reading from file, so lookaheads needs to be undone (via lseek) in our
case. The only problem here is that if we opened a file that doesn't
support lseek such as many of the file /dev/*
2020-05-23 16:20:20 +02:00
oddcoder 6fba592fdb Implement regression test for ftell-ungetc bug 2020-05-23 16:20:20 +02:00
oddcoder 1733b3da6e Fix bug related to ungetc and ftell()
At least in relibc, each call to ungetc should decrement ftell() by one
also allowing negative ftell() this is not possible on relibc thus gcc
failing to compile (gcc compiles tools that is later used to compile gcc
itself and these tools are the ones that fail)
2020-05-23 16:20:20 +02:00
oddcoder 49dec86a5d Unit test arbitrarily long ungetc() 2020-05-23 16:20:20 +02:00
oddcoder 7a6f96373e Add support for multiple unget at the same time
According to the standards, only one ungetc may be guaranteed however
glibc allows more than one of those, and to be glibc compatiable, one
needs to be able to do the same, allowing only 1 ungetc may trigger bug
while compiling gcc as ungetc is used there alot
2020-05-23 16:20:20 +02:00
oddcoder 4c94dfac00 Add type definition for caddr_t
Normally one shouldn't be using this datatype ever, but then someone
have to tell that to gcc folks :(
2020-05-23 16:20:20 +02:00
Jeremy Soller 0cc0fbecdc Export getrandom function 2020-05-22 15:49:51 -06:00
Jeremy Soller a6fffd3fb5 Add getrandom and sys/random.h 2020-05-22 11:50:54 -06:00
Jeremy Soller 2cf3ccae72 Fix import of user_regs_struct 2020-05-21 20:01:47 -06:00
Jeremy Soller a1034b697d Merge branch 'master' of https://gitlab.redox-os.org/redox-os/relibc 2020-05-21 14:59:41 -06:00
Jeremy Soller 06429ccc4c Fix redox socket inner_get_name 2020-05-21 14:59:22 -06:00