Siva Chandra Reddy
75d70b7306
[libc] Make close function of the internal File class cleanup the file object.
...
Before this change, a separate static method named cleanup was used to
cleanup the file. Instead, now the close method cleans up the full file
object using the platform's close function.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D153377
2023-06-21 05:05:04 +00:00
Siva Chandra Reddy
21e1651c0c
[libc] Remove the requirement of a platform-flush operation in File abstraction.
...
The libc flush operation is not supposed to trigger a platform level
flush operation. See "Notes" on this Linux man page:
https://man7.org/linux/man-pages/man3/fflush.3.html
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D153182
2023-06-19 18:38:29 +00:00
Michael Jones
04a9c62554
[libc] move stdlib and stdio to new errno pattern
...
Fixes https://github.com/llvm/llvm-project/issues/61071
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D145191
2023-03-03 11:15:36 -08:00
Siva Chandra Reddy
f9868aa729
[libc][NFC] Use operator delete to cleanup a File object.
...
The File API has been refactored to allow cleanup using operator delete.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D140574
2022-12-22 22:31:06 +00:00
Siva Chandra Reddy
d06308df8b
[libc] Handle allocation failures gracefully in FILE related API.
...
Few uses of free have not yet been replaced by the custom operator
delete yet. They will be done in a follow up patch.
Reviewed By: lntue, michaelrj
Differential Revision: https://reviews.llvm.org/D140526
2022-12-22 19:30:16 +00:00
Michael Jones
9beb8d1109
[libc] move errno out of file internals
...
Now errno is only set by the terminal entrypoints, and not the internal
implementations. This patch is part of the larger effort to not set
errno in libc internal code: https://github.com/llvm/llvm-project/issues/59278
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D139576
2022-12-12 13:11:45 -08:00
Siva Chandra Reddy
43e52ad553
[libc] Add implementations of ftell.
...
Reviewed By: michaelrj, lntue
Differential Revision: https://reviews.llvm.org/D137395
2022-11-07 21:38:53 +00:00
Siva Chandra Reddy
2e4ef9b6ef
[libc][NFC] Add a few compiler warning flags.
...
A bunch of cleanup to supress the new warnings is also done.
Reviewed By: abrachet
Differential Revision: https://reviews.llvm.org/D130723
2022-08-04 23:46:38 +00:00
Siva Chandra Reddy
19a6dd33ee
[libc] Add the implementation of the GNU extension function fopencookie.
...
Reviewed By: lntue, michaelrj
Differential Revision: https://reviews.llvm.org/D124141
2022-04-22 08:02:25 +00:00