<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Support/raw_socket_stream.cpp, branch users/nico/python-1</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>[LLVM][Cygwin] add workaround for blocking connect/accept in AF_UNIX sockets (#140353)</title>
<updated>2025-05-22T05:15:21+00:00</updated>
<author>
<name>jeremyd2019</name>
<email>github@jdrake.com</email>
</author>
<published>2025-05-22T05:15:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7857543a6350f49f12d17af0bcf2c0f42db0311e'/>
<id>7857543a6350f49f12d17af0bcf2c0f42db0311e</id>
<content type='text'>
On Cygwin, UNIX sockets involve a handshake between connect and accept
to enable SO_PEERCRED/getpeereid handling. This necessitates accept
being called before connect can return, but at least the tests in
llvm/unittests/Support/raw_socket_stream_test do both on the same thread
(first connect and then accept), resulting in a deadlock. Add a call to
both places sockets are created that turns off the handshake (and
SO_PEERCRED/getpeereid support).

References:
* https://github.com/cygwin/cygwin/blob/cec8a6680ea1fe38f38001b06c34ae355a785209/winsup/cygwin/fhandler/socket_local.cc#L1462-L1471
* https://inbox.sourceware.org/cygwin/Z_UERXFI1g-1v3p2@calimero.vinschen.de/T/#u</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Cygwin, UNIX sockets involve a handshake between connect and accept
to enable SO_PEERCRED/getpeereid handling. This necessitates accept
being called before connect can return, but at least the tests in
llvm/unittests/Support/raw_socket_stream_test do both on the same thread
(first connect and then accept), resulting in a deadlock. Add a call to
both places sockets are created that turns off the handshake (and
SO_PEERCRED/getpeereid support).

References:
* https://github.com/cygwin/cygwin/blob/cec8a6680ea1fe38f38001b06c34ae355a785209/winsup/cygwin/fhandler/socket_local.cc#L1462-L1471
* https://inbox.sourceware.org/cygwin/Z_UERXFI1g-1v3p2@calimero.vinschen.de/T/#u</pre>
</div>
</content>
</entry>
<entry>
<title>[Support] Remove unused includes (NFC) (#116752)</title>
<updated>2024-11-20T14:51:43+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-11-20T14:51:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d44ea7186befe38eb2b3804b15cd1ee1777458ed'/>
<id>d44ea7186befe38eb2b3804b15cd1ee1777458ed</id>
<content type='text'>
Identified with misc-include-cleaner.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identified with misc-include-cleaner.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][Support] Implement raw_socket_stream::read with optional timeout (#92308)</title>
<updated>2024-07-22T03:50:28+00:00</updated>
<author>
<name>Connor Sughrue</name>
<email>55301806+cpsughrue@users.noreply.github.com</email>
</author>
<published>2024-07-22T03:50:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=76321b9f08ef31a2b8ca26f7522aee511a05f7a8'/>
<id>76321b9f08ef31a2b8ca26f7522aee511a05f7a8</id>
<content type='text'>
This PR implements `raw_socket_stream::read`, which overloads the base
class `raw_fd_stream::read`. `raw_socket_stream::read` provides a way to
timeout the underlying `::read`. The timeout functionality was not added
to `raw_fd_stream::read` to avoid needlessly increasing compile times
and allow for convenient code reuse with `raw_socket_stream::accept`,
which also requires timeout functionality. This PR supports the module
build daemon and will help guarantee it never becomes a zombie process.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR implements `raw_socket_stream::read`, which overloads the base
class `raw_fd_stream::read`. `raw_socket_stream::read` provides a way to
timeout the underlying `::read`. The timeout functionality was not added
to `raw_fd_stream::read` to avoid needlessly increasing compile times
and allow for convenient code reuse with `raw_socket_stream::accept`,
which also requires timeout functionality. This PR supports the module
build daemon and will help guarantee it never becomes a zombie process.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm-project] Fix typo "seperate" (#95373)</title>
<updated>2024-06-13T19:20:27+00:00</updated>
<author>
<name>Jay Foad</name>
<email>jay.foad@amd.com</email>
</author>
<published>2024-06-13T19:20:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d4a0154902fb9b0611ed857134b26a64a1d5ad1e'/>
<id>d4a0154902fb9b0611ed857134b26a64a1d5ad1e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][Support] ListeningSocket::accept returns operation_canceled if FD is set to -1 (#89479)</title>
<updated>2024-05-22T00:32:11+00:00</updated>
<author>
<name>Connor Sughrue</name>
<email>55301806+cpsughrue@users.noreply.github.com</email>
</author>
<published>2024-05-22T00:32:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=203232ffbd80e9f4631213a3876f14dde155a92d'/>
<id>203232ffbd80e9f4631213a3876f14dde155a92d</id>
<content type='text'>
If `::poll` returns and `FD` equals -1, then `ListeningSocket::shutdown`
has been called. So, regardless of any other information that could be
gleaned from `FDs.revents` or `PollStatus`, it is appropriate to return
`std::errc::operation_canceled`. `ListeningSocket::shutdown` copies
`FD`'s value to `ObservedFD` then sets `FD` to -1 before canceling
`::poll` by calling `::close(ObservedFD)` and writing to the pipe.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If `::poll` returns and `FD` equals -1, then `ListeningSocket::shutdown`
has been called. So, regardless of any other information that could be
gleaned from `FDs.revents` or `PollStatus`, it is appropriate to return
`std::errc::operation_canceled`. `ListeningSocket::shutdown` copies
`FD`'s value to `ObservedFD` then sets `FD` to -1 before canceling
`::poll` by calling `::close(ObservedFD)` and writing to the pipe.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][NFC] Suppress `-Wunused-result` call to `write`</title>
<updated>2024-04-11T02:14:07+00:00</updated>
<author>
<name>Jordan Rupprecht</name>
<email>rupprecht@google.com</email>
</author>
<published>2024-04-11T02:14:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6b46166ef2612d2a58767447b3db8f0343afb552'/>
<id>6b46166ef2612d2a58767447b3db8f0343afb552</id>
<content type='text'>
Commit 87e6f87fe7e343eb656e9b49d30cbb065c086651 adds a call to `::write()`, which may be annotated w/ `warn_unused_result`, leading to `-Wunused-result` failures.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 87e6f87fe7e343eb656e9b49d30cbb065c086651 adds a call to `::write()`, which may be annotated w/ `warn_unused_result`, leading to `-Wunused-result` failures.
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][Support] Improvements to ListeningSocket functionality and documentation (#84710)</title>
<updated>2024-04-10T03:41:18+00:00</updated>
<author>
<name>Connor Sughrue</name>
<email>55301806+cpsughrue@users.noreply.github.com</email>
</author>
<published>2024-04-10T03:41:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=87e6f87fe7e343eb656e9b49d30cbb065c086651'/>
<id>87e6f87fe7e343eb656e9b49d30cbb065c086651</id>
<content type='text'>
Improvements include
* Enable `ListeningSocket::accept` to timeout after a specified amount
of time or block indefinitely
* Enable `ListeningSocket::createUnix` to handle instances where the
target socket address already exists and differentiate between
situations where the existing file does and does not already have a
bound socket
* Doxygen comments

Functionality added for the module build daemon

---------

Co-authored-by: Michael Spencer &lt;bigcheesegs@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improvements include
* Enable `ListeningSocket::accept` to timeout after a specified amount
of time or block indefinitely
* Enable `ListeningSocket::createUnix` to handle instances where the
target socket address already exists and differentiate between
situations where the existing file does and does not already have a
bound socket
* Doxygen comments

Functionality added for the module build daemon

---------

Co-authored-by: Michael Spencer &lt;bigcheesegs@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][Support] Add and use errnoAsErrorCode (#84423)</title>
<updated>2024-03-09T07:30:33+00:00</updated>
<author>
<name>Michael Spencer</name>
<email>bigcheesegs@gmail.com</email>
</author>
<published>2024-03-09T07:30:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ba13fa2a5d57581bff1a7e9322234af30f4882f6'/>
<id>ba13fa2a5d57581bff1a7e9322234af30f4882f6</id>
<content type='text'>
LLVM is inconsistent about how it converts `errno` to `std::error_code`.
This can cause problems because values outside of `std::errc` compare
differently if one is system and one is generic on POSIX systems.

This is even more of a problem on Windows where use of the system
category is just wrong, as that is for Windows errors, which have a
completely different mapping than POSIX/generic errors. This patch fixes
one instance of this mistake in `JSONTransport.cpp`.

This patch adds `errnoAsErrorCode()` which makes it so people do not
need to think about this issue in the future. It also cleans up a lot of
usage of `errno` in LLVM and Clang.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LLVM is inconsistent about how it converts `errno` to `std::error_code`.
This can cause problems because values outside of `std::errc` compare
differently if one is system and one is generic on POSIX systems.

This is even more of a problem on Windows where use of the system
category is just wrong, as that is for Windows errors, which have a
completely different mapping than POSIX/generic errors. This patch fixes
one instance of this mistake in `JSONTransport.cpp`.

This patch adds `errnoAsErrorCode()` which makes it so people do not
need to think about this issue in the future. It also cleans up a lot of
usage of `errno` in LLVM and Clang.</pre>
</div>
</content>
</entry>
<entry>
<title>Move raw_string_ostream back to raw_ostream.cpp (#79224)</title>
<updated>2024-01-24T19:20:23+00:00</updated>
<author>
<name>Andy Kaylor</name>
<email>andrew.kaylor@intel.com</email>
</author>
<published>2024-01-24T19:20:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bb65f5a5d95736cf08b282c1ded7f5cceed5fd7e'/>
<id>bb65f5a5d95736cf08b282c1ded7f5cceed5fd7e</id>
<content type='text'>
The implementation of raw_string_ostream::write_impl() was moved to
raw_socket_stream.cpp when the raw_socket_ostream support was separated.
This patch moves it back to facilitate disabling socket support in
downstream projects.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The implementation of raw_string_ostream::write_impl() was moved to
raw_socket_stream.cpp when the raw_socket_ostream support was separated.
This patch moves it back to facilitate disabling socket support in
downstream projects.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm][Support] Lift raw_socket_stream implementation out into own files (#75653)</title>
<updated>2023-12-19T01:13:47+00:00</updated>
<author>
<name>criis</name>
<email>christian.riis@gmail.com</email>
</author>
<published>2023-12-19T01:13:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c0d5d36dda04cdd409aabc015da0beb810842fcd'/>
<id>c0d5d36dda04cdd409aabc015da0beb810842fcd</id>
<content type='text'>
Move the implementation of raw_socket_stream from raw_ostream.h/cpp to
raw_socket_stream.h/cpp as requested in #73603.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the implementation of raw_socket_stream from raw_ostream.h/cpp to
raw_socket_stream.h/cpp as requested in #73603.</pre>
</div>
</content>
</entry>
</feed>
