<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/__support/File/linux/file.cpp, branch users/shawbyoung/spr/main.boltnfc-refactoring-callgraph</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[libc] Add the implementation of the fdopen function (#94186)</title>
<updated>2024-06-14T23:17:44+00:00</updated>
<author>
<name>Xu Zhang</name>
<email>simonzgx@gmail.com</email>
</author>
<published>2024-06-14T23:17:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0b24b4706982907799c838d80e06b3aa08420549'/>
<id>0b24b4706982907799c838d80e06b3aa08420549</id>
<content type='text'>
Fixes #93711 .
This patch implements the ``fdopen`` function. Given that ``fdopen`` 
internally calls ``fcntl``, the implementation of ``fcntl`` has been
moved to the ``__support/OSUtil``, where it serves as an internal public
function.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #93711 .
This patch implements the ``fdopen`` function. Given that ``fdopen`` 
internally calls ``fcntl``, the implementation of ``fcntl`` has been
moved to the ``__support/OSUtil``, where it serves as an internal public
function.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] fix -Wmacro-redefined (#75261)</title>
<updated>2023-12-13T16:39:39+00:00</updated>
<author>
<name>Nick Desaulniers</name>
<email>nickdesaulniers@users.noreply.github.com</email>
</author>
<published>2023-12-13T16:39:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=eaa11526c873b65a9dc0aaf0ebaf66de3db8ed21'/>
<id>eaa11526c873b65a9dc0aaf0ebaf66de3db8ed21</id>
<content type='text'>
When building with compiler-rt enabled, warnings such as the following
are
observed:


llvm-project/llvm/build/projects/compiler-rt/../libc/include/llvm-libc-macros/linux/sys-stat-macros.h:46:9:
    warning: 'S_IXOTH' macro redefined [-Wmacro-redefined]
    #define S_IXOTH 00001
            ^

llvm-project/llvm/build/projects/compiler-rt/../libc/include/llvm-libc-macros/linux/fcntl-macros.h:61:9:
    note: previous definition is here
    #define S_IXOTH 01
            ^
It looks like we have these multiply defined. Deduplicate these flags;
users
should expect to find them in sys/stat.h. S_FIFO was wrong anyways
(should
have been S_IFIFO).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When building with compiler-rt enabled, warnings such as the following
are
observed:


llvm-project/llvm/build/projects/compiler-rt/../libc/include/llvm-libc-macros/linux/sys-stat-macros.h:46:9:
    warning: 'S_IXOTH' macro redefined [-Wmacro-redefined]
    #define S_IXOTH 00001
            ^

llvm-project/llvm/build/projects/compiler-rt/../libc/include/llvm-libc-macros/linux/fcntl-macros.h:61:9:
    note: previous definition is here
    #define S_IXOTH 01
            ^
It looks like we have these multiply defined. Deduplicate these flags;
users
should expect to find them in sys/stat.h. S_FIFO was wrong anyways
(should
have been S_IFIFO).</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Mass replace enclosing namespace (#67032)</title>
<updated>2023-09-26T09:45:04+00:00</updated>
<author>
<name>Guillaume Chatelet</name>
<email>gchatelet@google.com</email>
</author>
<published>2023-09-26T09:45:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b6bc9d72f65a5086f310f321e969d96e9a559e75'/>
<id>b6bc9d72f65a5086f310f321e969d96e9a559e75</id>
<content type='text'>
This is step 4 of
https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is step 4 of
https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Unify lseek implementations</title>
<updated>2023-09-06T14:56:41+00:00</updated>
<author>
<name>Mikhail R. Gadelha</name>
<email>mikhail@igalia.com</email>
</author>
<published>2023-09-06T14:35:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8cd4ecfa6001eed7486fa3618bbd6bde47a0b075'/>
<id>8cd4ecfa6001eed7486fa3618bbd6bde47a0b075</id>
<content type='text'>
In patch D157792, the calls to SYS_llseek/SYS_llseek for 32-bit systems
were fixed in lseek.cpp but there was another implementation in file.cpp
that was missed.

To reduce the code duplication, this patch unifies both call sites to
use a new lseekimpl function.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D159208
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In patch D157792, the calls to SYS_llseek/SYS_llseek for 32-bit systems
were fixed in lseek.cpp but there was another implementation in file.cpp
that was missed.

To reduce the code duplication, this patch unifies both call sites to
use a new lseekimpl function.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D159208
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][NFC] Put definitions of stdout and friends into their own object files.</title>
<updated>2023-08-17T19:48:35+00:00</updated>
<author>
<name>Siva Chandra Reddy</name>
<email>sivachandra@google.com</email>
</author>
<published>2023-08-16T19:52:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0f6ef9bc2a14be0a5fdb0d05fc6bb2d5474bf0c6'/>
<id>0f6ef9bc2a14be0a5fdb0d05fc6bb2d5474bf0c6</id>
<content type='text'>
This is done so that tests which only require platform file but not the
platform streams can be run as unit tests. The tests which use platform
streams can only be hermetic tests to avoid conflicts with the
system-libc streams.

Fixes:
https://github.com/llvm/llvm-project/issues/64663
https://github.com/llvm/llvm-project/issues/63558

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D158193
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is done so that tests which only require platform file but not the
platform streams can be run as unit tests. The tests which use platform
streams can only be hermetic tests to avoid conflicts with the
system-libc streams.

Fixes:
https://github.com/llvm/llvm-project/issues/64663
https://github.com/llvm/llvm-project/issues/63558

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D158193
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][cleanup] Fix most conversion warnings</title>
<updated>2023-08-07T22:03:01+00:00</updated>
<author>
<name>Michael Jones</name>
<email>michaelrj@google.com</email>
</author>
<published>2023-08-02T23:30:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f0a3954ef1af274cb0b79a6e0bc51a31e0de540b'/>
<id>f0a3954ef1af274cb0b79a6e0bc51a31e0de540b</id>
<content type='text'>
This patch is large, but is almost entirely just adding casts to calls
to syscall_impl. Much of the work was done programatically, with human
checking when the syntax or types got confusing.

Reviewed By: mcgrathr

Differential Revision: https://reviews.llvm.org/D156950
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch is large, but is almost entirely just adding casts to calls
to syscall_impl. Much of the work was done programatically, with human
checking when the syntax or types got confusing.

Reviewed By: mcgrathr

Differential Revision: https://reviews.llvm.org/D156950
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add support to compile some syscalls on 32 bit platform</title>
<updated>2023-08-03T13:08:01+00:00</updated>
<author>
<name>Mikhail R. Gadelha</name>
<email>mikhail@igalia.com</email>
</author>
<published>2023-08-03T12:30:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c9783d2bda95ec6921b3ca2df930b17af3a6c7b1'/>
<id>c9783d2bda95ec6921b3ca2df930b17af3a6c7b1</id>
<content type='text'>
This patch adds a bunch of ifdefs to handle the 32 bit versions of
some syscalls, which often only append a 64 to the name of the syscall
(with exception of SYS_lseek -&gt; SYS_llseek and SYS_futex -&gt;
SYS_futex_time64)

This patch also tries to handle cases where wait4 is not available
(as in riscv32): to implement wait, wait4 and waitpid when wait4 is
not available, we check for alternative wait calls and ultimately rely
on waitid to implement them all.

In riscv32, only waitid is available, so we need it to support this
platform.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D148371
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds a bunch of ifdefs to handle the 32 bit versions of
some syscalls, which often only append a 64 to the name of the syscall
(with exception of SYS_lseek -&gt; SYS_llseek and SYS_futex -&gt;
SYS_futex_time64)

This patch also tries to handle cases where wait4 is not available
(as in riscv32): to implement wait, wait4 and waitpid when wait4 is
not available, we check for alternative wait calls and ultimately rely
on waitid to implement them all.

In riscv32, only waitid is available, so we need it to support this
platform.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D148371
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Make close function of the internal File class cleanup the file object.</title>
<updated>2023-06-21T05:05:04+00:00</updated>
<author>
<name>Siva Chandra Reddy</name>
<email>sivachandra@google.com</email>
</author>
<published>2023-06-20T21:36:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=75d70b73063fb5abd12643207c6dda867d955df6'/>
<id>75d70b73063fb5abd12643207c6dda867d955df6</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Remove the requirement of a platform-flush operation in File abstraction.</title>
<updated>2023-06-19T18:38:29+00:00</updated>
<author>
<name>Siva Chandra Reddy</name>
<email>sivachandra@google.com</email>
</author>
<published>2023-06-16T23:23:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=21e1651c0ceb40eef4f1c3226c2e19a4ebe356c5'/>
<id>21e1651c0ceb40eef4f1c3226c2e19a4ebe356c5</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Move the definitions of the standard IO streams to the platform</title>
<updated>2023-06-15T12:06:43+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>jhuber6@vols.utk.edu</email>
</author>
<published>2023-06-14T23:59:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a09bec6459331e7f949c2ed3df6102de52d25f5d'/>
<id>a09bec6459331e7f949c2ed3df6102de52d25f5d</id>
<content type='text'>
This patch moves the definitions of the standard IO streams to the
platform file definition. This is necessary because previously we had a
level of indirection where the stream's `FILE *` was initialized based
on the pointer to the internal `__llvm_libc` version. This cannot be
resolved ahead of time by the linker because the address will not be
known until runtime. This caused the previous implementation to emit a
global constructor to initialize the pointer to the actual `FILE *`. By
moving these definitions so that we can bind their address to the
original file type we can avoid this global constructor.

This file keeps the entrypoints, but makes them empty files only
containing an external reference. This is so they still appear as
entrypoints and get emitted as declarations in the generated headers.

Reviewed By: lntue, sivachandra

Differential Revision: https://reviews.llvm.org/D152983
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch moves the definitions of the standard IO streams to the
platform file definition. This is necessary because previously we had a
level of indirection where the stream's `FILE *` was initialized based
on the pointer to the internal `__llvm_libc` version. This cannot be
resolved ahead of time by the linker because the address will not be
known until runtime. This caused the previous implementation to emit a
global constructor to initialize the pointer to the actual `FILE *`. By
moving these definitions so that we can bind their address to the
original file type we can avoid this global constructor.

This file keeps the entrypoints, but makes them empty files only
containing an external reference. This is so they still appear as
entrypoints and get emitted as declarations in the generated headers.

Reviewed By: lntue, sivachandra

Differential Revision: https://reviews.llvm.org/D152983
</pre>
</div>
</content>
</entry>
</feed>
