Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IPC with imsg? OpenBSD and Linux compatibility?

Tags:

linux

ipc

openbsd

I was reading the Tmux source to see how it works. It saw that it uses imsg for its IPC, which I had never even heard of. I've been trying to find out more, but it turns out imsg is kind of hard to google, and I get a lot of results for iMessage.

I found some imsg documentation here, so it seems to be an OpenBSD library. I started looking for a Linux implementation, but I can't find anything. It appears the author(s) of Tmux wrote their own compatibility layer. This kind of surprises me, because imsg seems like it would be really useful. Does Linux have a similar C API for this, that I just don't know about?

like image 240
tprk77 Avatar asked Apr 26 '14 18:04

tprk77


1 Answers

A quick look at the build script shows the following three files:

  • compat/imsg-buffer.c
  • compat/imsg.c
  • compat/imsg.h

So the tmux authors ship a copy of OpenBSD's imsg library, which is implemented entirely in user-space.

like image 55
Fred Foo Avatar answered Oct 16 '22 17:10

Fred Foo