Hacker News new | ask | show | jobs
by senderista 12 days ago
I'm surprised there was no reference to the librseq library, maintained by the rseq implementer:

https://github.com/compudj/librseq

This has helpers for common use cases like counters and linked lists. You shouldn't need to write assembly at all to use rseq in most applications.

2 comments

Justine is writing her own libc and her own malloc so I'm not surprised she wants to use rseq from scratch.
That's fine, but I think an article claiming to give an introduction to a technology should at least mention that an essential library exists, and that writing assembly is no longer usually required.
> an article claiming to give an introduction to a technology

Is it claiming that?

I'm took a brief look and left confused. The list implementation seems completely bog standard with no special code for synchronization whatsoever. I don't see any counter and the rseq syscall seems unused except for feature detection. I don't think that's a viable replacement for any low level code.
The low level interface is documented at https://github.com/compudj/librseq/blob/master/include/rseq/..., the list is just an internal implementation detail.

The syscall these days is invoked by libc not the program; libc provides access to some symbols that let the program execute rseqs as well.