summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibIPC
AgeCommit message (Collapse)Author
2021-09-12LibIPC: Add support for transferring doubles over IPC messageskleines Filmröllchen
I'm still wondering why nobody did this yet :^) Also changes the use of unions for the more cleaner / less undefined AK::bit_cast.
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-09-03LibIPC: Convert Encoder class to east-const styleAndreas Kling
2021-09-02Userland: Migrate to argument-less deferred_invokesin-ack
Only one place used this argument and it was to hold on to a strong ref for the object. Since we already do that now, there's no need to keep this argument around since this can be easily captured. This commit contains no changes.
2021-08-11LibIPC: Pass only message size to decoderFederico Guerinoni
Fixes #9015.
2021-08-01Libraries: Remove unused header includesBrian Gianforcaro
2021-07-21LibIPC: Fix losing messages when connection is closedTom
This fixes not processing any messages read up until a connection close is detected. We were returning from the function despite having read some messages.
2021-07-18LibIPC: Close the socket and die when the peer is closedGunnar Beutner
This will close the socket when the recv() returns 0 indicating that the peer has shutdown, and when there are no pending bytes to be processed.
2021-07-18LibIPC: Add Connection::is_open()Gunnar Beutner
This will allow clients to see if the IPC socket is still open.
2021-07-08LibIPC: Remove unnecessary `template<>`Daniel Bertalan
This fixes a Clang warning.
2021-07-08Everywhere: Forward declare structs as structsDaniel Bertalan
While structs being forward declared as classes is not strictly an issue, Clang complains as this is not portable code, since some ABIs treat classes declared as `class` and `struct` differently. It's easier to fix these than to reason about explicitly disabling another warning.
2021-07-04AK+LibIPC: Make all enums codableTimothy
If an enum has a supported underlying type we can provide encoding and decoding for the enum as well.
2021-06-24Userland: Disambiguate dependent typesDaniel Bertalan
Clang produced an error on these pieces of code without the `typename` keyword.
2021-05-24LibIPC: Fix unaligned u32 access in drain_messages_from_peer()Andreas Kling
Caught by userspace UBSAN. :^)
2021-05-23LibIPC: Remove unnecessary IPC::ServerConnection::handshake()Andreas Kling
This is no longer used by any of our IPC pairs.
2021-05-19Everywhere: Add missing includes for <AK/OwnPtr.h>Gunnar Beutner
Previously <AK/Function.h> also included <AK/OwnPtr.h>. That's about to change though. This patch fixes a few build problems that will occur when that change happens.
2021-05-14LibC: Do not include errno.h inside unistd.hJean-Baptiste Boric
POSIX does not mandate this, therefore let's not do it.
2021-05-03Userland: Add try_* IPC handlersGunnar Beutner
This enables calling auto-generated IPC methods in a way that doesn't crash the client if the peer disconnects.
2021-05-03Userland: Update IPC calls to use proxiesGunnar Beutner
This updates all existing code to use the auto-generated client methods instead of post_message/send_sync.
2021-05-03Userland: Split IPC endpoints into proxies and stubsGunnar Beutner
This enables support for automatically generating client methods. With this added the user gets code completion support for all IPC methods which are available on a connection object.
2021-05-02LibIPC: Make sure FDs survive when passed into a MessageBufferGunnar Beutner
2021-05-02Userland: Make IPC handlers return void if they don't have any outputsGunnar Beutner
2021-05-02Userland: Get rid of the OwnPtr<...> boilerplate code for IPC handlersGunnar Beutner
2021-04-27LibIPC: Add missing errno.h includeJean-Baptiste Boric
2021-04-25IPCCompiler: Remove hardcoded endpoint magic, attempt deuxsin-ack
This patch removes the IPC endpoint numbers that needed to be specified in the IPC files. Since the string hash is a (hopefully) collision free number that depends on the name of the endpoint, we now use that instead. :^) Additionally, endpoint magic is now treated as a u32, because endpoint numbers were never negative anyway. For cases where the endpoint number does have to be hardcoded (a current case is LookupServer because the endpoint number must be known in LibC), the syntax has been made more explicit to avoid confusing those unfamiliar. To hardcode the endpoint magic, the following syntax is now used: endpoint EndpointName [magic=1234]
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-21LibCore: Remove the barely-used Core::safe_syscall()Andreas Kling
This was a helper that would call a syscall repeatedly until it either succeeded or failed with a non-EINTR error. It was only used in two places, so I don't think we need this helper.
2021-04-20LibIPC: Make Connection::send_sync return a NonnullOwnPtrIdan Horowitz
Since we VERIFY that we received a response, the response pointer is always non-null.
2021-04-16LibCore+LibIPC: Add IPC coder for Core::DateTimeTimothy Flynn
Since LibCore cannot depend on LibIPC, the coders are defined in LibIPC just like they are for Core::AnonymousBuffer.
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-02-20LibIPC: Add Connection::send_sync_but_allow_failure()Andreas Kling
Instead of asserting that the peer responds successfully, this API allows for the peer to die/crash/whatever happens on the other side while handling a synchronous request. This will be useful when using process separation to parse untrusted data from the web.
2021-02-14Kernel+Userland: Give sys$recvfd() an options argument for O_CLOEXECAndreas Kling
@bugaevc pointed out that we shouldn't be setting this flag in userspace, and he's right of course.
2021-02-13LibIPC: Oops, fix busted dbgln() format string (thanks, checker!)Andreas Kling
2021-02-13LibIPC: Make received file descriptors close-on-exec by defaultAndreas Kling
I noticed that programs running in the terminal had an open file descriptor for the system theme buffer, inherited from the Terminal. Let's be nice and always mark incoming fds with FD_CLOEXEC.
2021-02-01LibIPC: Stop sending client ID to clientsAndreas Kling
The client ID is not useful to normal clients anymore, so stop telling everyone what their ID is.
2021-01-31LibIPC: Stop exchanging client/server PIDs in greeting handshakeAndreas Kling
The PIDs were used for sharing shbufs between processes, but now that we have migrated to file descriptor passing, we no longer need to know the PID of the other side.
2021-01-16LibCore+LibIPC: Add Core::AnonymousBuffer, an IPC-friendly buffer classAndreas Kling
This will be used to migrate remaining clients off of shbufs.
2021-01-16Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-14LibIPC: Add an expressive way to close an IPC::File after sending itAndreas Kling
If you don't need a file descriptor after sending it to someone over IPC, construct it with IPC::File(fd, IPC::File::CloseAfterSending) and LibIPC will take care of it for you. :^)
2021-01-14LibIPC: Close received IPC::File fd's by default unless takenAndreas Kling
When receiving a file descriptor over IPC, the receiver must now call take_fd() on the IPC::File to take over the descriptor. Otherwise, IPC::File will close the file on destruction.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling