blog.8-p.info

I learned Unix by reading books, magazines and blogs. It was long time ago. One resource I still can remember and like is “Unix Programming Environment” by Brian W. Kernighan and Rob Pike. I read its Japanese translation from ASCII 1.However this book was aged even at that time and the original English version from Prentice-Hall seems discontinued. It is not something I could recommend to others.

MIT CSAIL’s the Missing Semester of Your CS Education looks good. I only have skimmed through though. It is good to see that the page mentions man;

A more detailed approach is to use the man command. Short for manual, man provides a manual page (called manpage) for a command you specify.

But new developers also should know the difference between kill(1) and kill(2). How do people learn that nowadays?


  1. No. Not American Standard Code for Information Interchange. There is a Japanese company called ASCII. The publishing label is now called ASCII Dwango which sells technical books such as the Rust Programming Language’s Japanese translation. ↩︎

SIGRTMIN is tricky

Aug 2, 2021

I was working on a pull request to support real-time signals in containerd. While the merged change is using github.com/moby/sys, I went the DIY way first and learned a bit about real-time signals, or more specifically saying SIGRTMIN.

According to signal(7);

The range of supported real-time signals is defined by the macros SIGRTMIN and SIGRTMAX.

However, containerd is avoiding cgo unless it is absolutely necessary. So I wanted to define SIGRTMIN by myself, which is tricky.

Again from the same manpage;

The Linux kernel supports a range of 33 different real-time signals, numbered 32 to 64. However, the glibc POSIX threads implementation internally uses two (for NPTL) or three (for LinuxThreads) real-time signals (see pthreads(7)), and adjusts the value of SIGRTMIN suitably (to 34 or 35).

This man page is flatly comparing NPTL and LinuxThreads, but LinuxThreads is an ancient threads implementation in Linux. You really don’t have to worry about. That being said, the man page only talks about glibc, GNU’s libc implementation. There is musl libc, which defines SIGRTMIN as 35.

Back to the containerd story. We decided that it would be better to be compatible with Docker, Sebastiaan extracted the part as moby/sys/signal and we simply took it.

Three OCI specs

Jul 27, 2021

Open Container Initiative (OCI) defines three specifications around containers. I often forget which spec is which. So here is the brief note for myself.

Runtime Specification

Runtime Specification defines basically a big JSON configuration file for OCI runtimes such as runc, crun and youki. It has sections for Linux, Windows and Solaris.

Image Format Specification

Image Format Specification defines a way to package a container image. It also defines media types such as application/vnd.oci.descriptor.v1+json.

When you use Docker, you often need to think about image layers. The layer structure is seen in this Image Format Specification, but not in the Runtime Specification.

Distribution Specification

Distribution Specification defines a way to distribute container images. This is basically HTTP API for uploading/downloading container images.

After living in Seattle for 6+ years, I finally have visited the Museum of Flight. The airplanes there were beautiful. Some of them were weapons, though.

It would be the first time I saw B-29. This Boeing-made heavy bomber could have killed my grandmother.

Seattle Public Library (SPL) has O’Reilly subscription, called O’Reilly Complete Public Library.

Improve your computer and business skills with O’Reilly Complete Public Library. You can read more than 40,000 books on software, programming and business for free with your Library card using standard web browsers, with no due dates.

Seems many public libraries in the States do the same, from District of Columbia Public Library, San Jose Public Library to Madison Public Library. Most of them, except for SPL’s called “O’Reilly for Public Libraries”.

O’Reilly for Public Libraries is slightly limited from what O’Reilly offers. For example, you cannot create a personal account. Accounts seems ephemeral and highlights and notes won’t be saved. You cannot use O’Reilly’s iPad/Android apps. These limitation are summarized in ProQuest’s help page 1.

I’ve been having O’Reilly subscription from my ACM membership. Seems ACM’s one is still more “complete” than SPL’s one. Of course SPL’s one is completely free if you live in Seattle though.

That being said, as a former Japanese resident, I’d say that having O’Reilly subscription though a public library is awesome. Too good to be true, to be honest.


  1. I’m not totally sure about the connection between ProQuest and the public libraries. Is ProQuest the vendor who brings O’Reilly to the public libraries? ↩︎