5 ms·
That is not documentation, that is incomplete[1] notes in a man page of a library call. That said, that's getting pretty close to a correctly uncoupled impleme
by felixgallo 12y ago
That is not documentation, that is incomplete[1] notes in a man page of a library call. That said, that's getting pretty close to a correctly uncoupled implementation.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=820448#c3 https://bugzilla.redhat.com/show_bug.cgi?id=820448#c3
- mjg59 12y agoThe notes define that a socket name starting with @ is a Linux abstract namespace socket, so I don't see where "incomplete" comes from. You can quibble over whether the documentation meets your preferred style (and I'll admit it certainly is odd to reference the underlying implementation in the notes for the wrapper rather than the other way around), but it's a page of text, shipped with the code, that tells you everything you need to reimplement it.
- felixgallo 12y agoThe link I included in my comment shows that the behavior is not actually what is stated in the notes. Do you have any documentation that describes the complete behavior?
- mjg59 12y agoThat's how Linux abstract sockets work. They're documented in unix(7).
- felixgallo 12y agooh man, that's a ridiculously grotesque hack. Huh! Thanks! You learn something new every day. That said, now I don't understand why one would use these things instead of something less openly hacky, like normal portable sockets, which have all sorts of advantages. And I can't find a reason why these were implemented in such a weird and nonportable way. From all I can piece together from the web, it looks like these were implemented by the freedesktop guys for that hacky desktop bus thing, is that right? Well that's an aside; in any case, having discovered this unnecessary coupling to a hacky linux-only feature, I would go back to the OP's idea of using standard unix IPC, which for the purpose appears to be more than enough to do the job but doesn't bring baggage. Any idea why that would be a bad thing?
- mjg59 12y agoAbstract sockets were added to Linux waaaaaaaaaaaay before dbus existed - they were already there in 2.4.0, which is as far back as the history I have goes. You really can't blame the Freedesktop people for them. If your init daemon doesn't run on Linux there's no reason to care about supporting them, either. Write a library that implements sd_notify(), and just leave that bit out.