I can't compile basu on OpenBSD.

Thu, Jul 18 2024 19:15:01 KST

I recently tried to create a nimf package for OpenBSD. There are quite a few libraries used in nimf. sunpinyin, rime, and basu are not in OpenBSD, so I had to create the packages myself. I succeeded in creating the sunpinyin and rime packages, but I failed in creating the basu package.

basu-openbsd.png

The following is a part of the bus-socket.c source code.

static int bus_socket_write_null_byte(sd_bus *b) {
#if defined(__linux__)
#define SOCKET_CRED_OPTION SCM_CREDENTIALS
        struct ucred creds;
        creds.pid = getpid();
        creds.uid = getuid();
        creds.gid = getgid();

#elif defined(__FreeBSD__)
#define SOCKET_CRED_OPTION SCM_CREDS
        struct cmsgcred creds = { 0 };
#else
#error auth not implemented for this OS
#endif

It seems that OpenBSD does not have something that acts as SCM_CREDS, so I can’t compile basu. Also, I do not know what SCM_CREDS is, so I cannot write code to replace it.