summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibIPC
AgeCommit message (Collapse)Author
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