Commit Graph

59 Commits

Author SHA1 Message Date
Mateusz Tabaka 02f202ff83 Use BufWriter (instead of LineWriter) for FILEs other than stdout and stderr
BufWriter has more capacity (8k vs 1k) and doesn't flush the stream after '\n'.
That change helps to reduce the number of syscalls, especially when dealing with text files.

Since BufWriter has a different way of getting number of pending elements than LineWriter -
Pending trait was introduced to deal with that.
2021-01-14 18:45:14 +01:00
Mateusz Tabaka 6332828725 Call DSO destructors during exit() 2021-01-05 20:39:36 +01:00
Jeremy Soller bddd69d0c1 Print when abort is called 2020-12-23 11:20:07 -07:00
Jeremy Soller 7ea5cd5133 Merge branch 'rename-lcg48-rand48' into 'master'
Rename lcg48 module as rand48

See merge request redox-os/relibc!287
2020-06-24 16:55:27 +00:00
Peter Limkilde Svendsen 5c8393d5aa Don't assume u32 alignment of random() state buffer 2020-06-24 16:46:59 +00:00
Peter Limkilde Svendsen 59b040258a Rename lcg48 as rand48 2020-06-23 18:34:44 +02:00
Peter Limkilde Svendsen cc33874363 Implement random() and friends 2020-06-22 21:56:39 +00: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
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
Peter Limkilde Svendsen 7fdd450e16 lcg48 refactor 2019-09-15 19:34:12 +00:00
Peter Limkilde Svendsen a80ec357e3 Refactor of a64l and l64a 2019-09-15 19:33:29 +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
Peter Limkilde Svendsen 02e26006e7 Alloc functions cleanup 2019-07-01 11:02:10 +00:00
Peter Limkilde Svendsen 6cc5216c9c Implement l64a() 2019-07-01 10:59:37 +00:00
jD91mZM2 d9ed51b9f1 Merge branch 'lcg48_arr' into 'master'
Implement remaining LCG functions

See merge request redox-os/relibc!219
2019-06-12 09:31:18 +00:00
Peter Limkilde Svendsen 626c713021 Formatting 2019-05-30 18:35:16 +02:00
Peter Limkilde Svendsen 02d1a7fe6f Implement posix_memalign 2019-05-30 18:28:15 +02:00
Peter Limkilde Svendsen 7a48107080 Run fmt 2019-05-23 21:48:43 +02:00
Peter Limkilde Svendsen dcff3fd836 Use y_from_x naming for functions 2019-05-23 21:40:06 +02:00
Peter Limkilde Svendsen fe4a3ae2b4 Refactor for consistency 2019-05-23 21:33:20 +02:00
Peter Limkilde Svendsen b2a9cdf930 Implement lcong48() and seed48() 2019-05-23 20:36:13 +02:00
Peter Limkilde Svendsen 13108776ae Implement erand48(), jrand48() and nrand48() 2019-05-22 18:48:19 +02:00
jD91mZM2 dab6530fb4 Merge branch 'valloc_pagesize' into 'master'
Make valloc() get page size through sysconf(), add tests

See merge request redox-os/relibc!216
2019-05-12 14:52:56 +00:00
Peter Limkilde Svendsen 45860e9256 Implement LCG pseudorandom number functions 2019-05-12 14:50:18 +00:00
Mateusz Mikuła 7597c082e7 Fix Clippy warnings 2019-05-11 22:34:13 +02:00
Peter Limkilde Svendsen f8cf25d76c Fix inaccurate comment 2019-05-11 11:44:36 +02:00
Peter Limkilde Svendsen 54c5423f35 Avoid call to memalign() 2019-05-09 23:40:12 +02:00
Peter Limkilde Svendsen 8beb10b1bd Get page size through sysconf() 2019-05-08 23:20:30 +02:00
Alex Lyon 68d3c5f1b1 Format code 2019-04-26 20:40:22 -07:00
Alex Lyon 67af78d0eb stdlib: make rand()/rand_r() generate from [0, RAND_MAX] 2019-04-26 13:13:25 -07:00
Alex Lyon 13a10ce7af stdlib: implement rand_r() using XorShiftRng 2019-04-25 19:35:32 -07:00
Peter Limkilde Svendsen 912385b501 Set errno in alloc functions and add further tests 2019-04-22 11:16:13 +00: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
Peter Limkilde Svendsen c54db6f008 Add integer overflow check to calloc 2019-02-02 15:52:39 +01:00
Jeremy Soller d2502056a8 Cleanup termios and ioctls and add tcflush 2019-01-27 19:19:50 -07:00
Jeremy Soller 0dd801da03 Implement ttyname by adding fpath function to Sys. Remove realpath function and use fpath internally 2019-01-27 17:10:55 -07:00
Jeremy Soller 0c5abf0361 Combine all libraries into libc.a, call pthread_init and pthread_terminate in libc 2019-01-07 19:11:30 -07:00
Jeremy Soller a8f3608f3c Fix stdlib div functions, add _Exit 2018-12-14 13:41:22 -07:00
Jeremy Soller 89832b3ac8 Add lldiv 2018-12-14 13:20:56 -07:00
Jeremy Soller 7dbd57f913 Fix putenv crash 2018-12-02 10:23:17 -07:00
Jeremy Soller 52fd4d7e83 Clippy fixes 2018-12-02 08:04:53 -07:00
Ian Douglas Scott fc0b7b9111 'strtoull' and 'strtoll' type signatures 2018-11-25 21:17:25 -08:00
Jeremy Soller 0ac16556bc Format 2018-11-25 10:34:42 -07:00
Jeremy Soller a5279b648f Fix warnings 2018-11-25 10:34:02 -07:00
Jeremy Soller 3c2121d4e0 Do not require prefix for hex 2018-10-16 18:03:21 -06:00
jD91mZM2 1f3154b45c Invoke constructors and destructors
Huge thanks to @xtibor for both discovering that this was still an issue, and also providing information with how to fix it
2018-10-11 16:59:49 +02:00
jD91mZM2 418a960f3b Implement realpath 2018-10-07 10:32:51 +02:00