| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
This patch adds the function "socket" from the header "sys/socket". It's
a simple syscall wrapper, and I plan on adding the related functions in
a followup patch.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149622
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Includes macros:
linux/SCHED_OTHER // posix req
linux/SCHED_FIFO // posix req
linux/SCHED_RR // posix req
linux/SCHED_BATCH
linux/SCHED_ISO
linux/SCHED_IDLE
linux/SCHED_DEADLINE
Includes types:
struct sched_param { int sched_priority; }
Includes functions:
sched_setparam
sched_getparam
sched_setscheduler
sched_getscheduler
sched_get_priority_max
sched_get_priority_min
sched_rr_get_interval
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D148069
|
|
|
|
|
|
|
|
| |
added getchar and getchar_unlocked which are just wrappers getc and getc_unlocked respectively.
Reviewed By: sivachandra, lntue, michaelrj
Differential Revision: https://reviews.llvm.org/D147919
|
|
|
|
|
|
|
|
|
|
|
| |
Implements: https://linux.die.net/man/2/sched_yield
Possibly we don't need the return value check / errno as according to
both the manpage (and current linux source) `sched_yield` cannot fail.
Reviewed By: sivachandra, michaelrj
Differential Revision: https://reviews.llvm.org/D147985
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D148052
|
|
|
|
|
|
|
|
|
|
| |
Introduce the `memmem` libc string function.
`memmem_implementation` performs shared logic for `strstr`,
`strcasestr`, and `memmem`; essentially reconfiguring what was the
`strstr_implementation` to support length parameters.
Differential Revision: https://reviews.llvm.org/D147822
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D147464
|
|
|
|
| |
This reverts commit a0a141fcbe1dfd35032fa5c052e6906180a37fb1.
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D147464
|
|
|
|
|
|
| |
Swab implementation is added to libc/src/unistd.
Differential Revision: https://reviews.llvm.org/D147970
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D147503
|
|
|
|
|
|
|
|
| |
Introduce strchrnul implementation and unit tests.
Submitting on behalf of Caslyn@
Differential Revision: https://reviews.llvm.org/D147346
|
|
|
|
|
|
|
| |
Somehow having MBState and StructTmType in the definition for wchar was
causing test failures. This should fix those.
Differential Revision: https://reviews.llvm.org/D146476
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the wchar header, as well as the functions to convert to
and from wide chars. The header also sets up the definitions for wint
and wchar.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D145995
|
|
|
|
|
|
|
|
| |
This adds sys/socket.h and some definitions on Linux.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D144415
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per spec:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ntohl.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ntohs.html
Co-authored-by: Jeff Bailey <jbailey@google.com>
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D144506
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per spec:
* https://pubs.opengroup.org/onlinepubs/9699919799/functions/htonl.html
* https://pubs.opengroup.org/onlinepubs/9699919799/functions/htons.html
Also adds UInt16Type and UInt32Type to spec.td
Co-authored-by: Jeff Bailey <jbailey@google.com>
Reviewed By: sivachandra, jeffbailey, rtenneti
Differential Revision: https://reviews.llvm.org/D143795
|
|
|
|
|
|
|
|
|
| |
Implement scalbn via `fptuil::ldexp` for `FLT_RADIX==2` case.
"unimplemented" otherwise.
Reviewed By: lntue, sivachandra
Differential Revision: https://reviews.llvm.org/D143116
|
|
|
|
|
|
|
|
| |
Implement acoshf function correctly rounded to all rounding modes.
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D142781
|
|
|
|
|
|
|
|
| |
Implement asinhf function correctly rounded for all rounding modes.
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D142681
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D142518
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D141236
|
|
|
|
|
|
| |
Traditionally these functions are exposed in string*s*.h not string.h
Differential Revision: https://reviews.llvm.org/D141237
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement double precision log10 function correctly rounded for all
rounding modes. This implementation currently needs FMA instructions for
correctness.
Use 2 passes:
Fast pass:
- 1 step range reduction with a lookup table of `2^7 = 128` elements to reduce the ranges to `[-2^-7, 2^-7]`.
- Use a degree-7 minimax polynomial generated by Sollya, evaluated using a mixed of double-double and double precisions.
- Apply Ziv's test for accuracy.
Accurate pass:
- Apply 5 more range reduction steps to reduce the ranges further to [-2^-27, 2^-27].
- Use a degree-4 minimax polynomial generated by Sollya, evaluated using 192-bit precisions.
- By the result of Lefevre (add quote), this is more than enough for correct rounding to all rounding modes.
In progress: Adding detail documentations about the algorithm.
Depend on: https://reviews.llvm.org/D136799
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D139846
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D138994
|
|
|
|
|
|
| |
Broke build bot
This reverts commit 186a15f7a9311a75f3c5e90243ea5d6d20878de1.
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D138994
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds scanf, sscanf, and fscanf entrypoints. It also adds unit
tests for sscanf and a basic test to fscanf. The scanf function is
basically impossible to test in an automated fashion due to it recieving
user input.
Reviewed By: sivachandra, lntue
Differential Revision: https://reviews.llvm.org/D138076
|
|
|
|
|
|
|
|
|
|
|
| |
+ Deleted duplicate definitions of StructTimeVal and StructTimeValPtr.
+ Caled syscall clock_gettime to get timespec data.
+ Added tests to test for sleeping 200 and 1000 microseconds.
+ Fixed comments from https://reviews.llvm.org/D137881
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D138064
|
|
|
|
|
|
|
|
|
| |
The assert functions were disabled while the signal functions were being
fixed. This patch re-enables them.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D138056
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement gettimeofday per
.../onlinepubs/9699919799/functions/gettimeofday.html.
This call clock_gettime to implement gettimeofday function.
Tested:
Limited unit test: This makes a call and checks that no error was
returned. Used nanosleep for 100 microseconds and verfified it
returns a value that elapses more than 100 microseconds and less
than 300 microseconds.
Co-authored-by: Jeff Bailey <jeffbailey@google.com>
Differential Revision: https://reviews.llvm.org/D137881
|
|
|
|
|
|
| |
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D137507
|
|
|
|
|
|
| |
Reviewed By: michaelrj, lntue
Differential Revision: https://reviews.llvm.org/D137395
|
|
|
|
|
|
| |
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D137356
|
|
|
|
|
|
|
|
|
| |
A bug in the file read logic has also been fixed along the way. Parts
of the ungetc tests will fail without that bug fixed.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D137286
|
| |
|
|
|
|
|
|
| |
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D137147
|
|
|
|
|
|
|
|
|
| |
Add place-holder implementation for pow function to unblock libc demo
examples.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D137109
|
|
|
|
|
|
|
|
|
| |
Add a place-holder implementation for asin to unblock libc demo
examples.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D137105
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D133487
|
|
|
|
|
|
|
|
| |
This adds the fgets function and its unit tests.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D136785
|
|
|
|
| |
This reverts commit a678f86351c30a7d57197ffefab4e6e44e61a857.
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D133487
|
|
|
|
|
|
| |
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D136666
|
|
|
|
|
|
| |
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D136642
|
|
|
|
|
|
|
|
| |
Build fix.
Reviewed By: rtenneti
Differential Revision: https://reviews.llvm.org/D136647
|
|
|
|
|
|
| |
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D136421
|
|
|
|
|
|
| |
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D136398
|
|
|
|
|
|
| |
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D136375
|