Seeking recommendations and information reddit / BSD ---------------------------------------------------------------------- KingAggressive1498 · 2021-12-05 03:33 Hi, I'm a hobbyist C++ developer and I recently started working on a modest utility library that extends functionality provided by the C++ standard library and adds some relatively trivial new functionality that I think can be broadly useful (like getting OS version information). I usually develop on Windows but have already begun porting it to Linux, and I'm interested in including the BSDs as well. I could just code by the manpages but that's failed me in the past on Linux What I'm looking for a recommendation for is a lightweight BSD distro that comes packaged with a GUI, runs graphical applications reasonably well in QEMU, has at least GCC11 in the package manager, and covers the best API cross-section for modern BSD variants as far as non- POSIX/non-BSD4.4 APIs go. I also have some questions though: 1. I recall reading somewhere that OpenBSD only provides green threads to userspace for security reasons, is this (still) true? 2. I was looking through the FreeBSD headers to get a feel for differences in headers between BSD and GNU/Linux. I saw there was no features.h and didn't see a libc version macro elsewhere. Did I just miss it, are BSD libcs usually unversioned, or is this a quirk of the FreeBSD libc? 3. How much do BSD filesystem hierarchies generally differ from the Linux Standard Base filesystem hierarchy? How much do they generally differ from each other? If not is there any defacto standard between the BSDs about where an application should store application data, user preferences, and stuff like that, or a defacto standard environment variable containing such information? 4. Is there any sort of standard among BSD distros of putting distro version information in a file in a specific location such as /etc/*-release on Linux? Any assistance would be appreciated, even if you're just directing me to a specific section of the documentation. Thanks ---------------------------------------------------------------------- brynet · 2021-12-05 04:42 > I recall reading somewhere that OpenBSD only provides green threads to userspace for security reasons, is this (still) true? No. OpenBSD has used a 1:1 POSIX threads implementation by default since [2012](https://man.openbsd.org/pthreads.3#HISTORY), meaning each userland thread maps to a kernel thread. > I saw there was no features.h and didn't see a libc version macro elsewhere. That is a Linux/glibc-ism. Every *BSD is different, but in general base system components are not versioned separately from the OS release, but shared libraries do have major/minor versions. > How much do BSD filesystem hierarchies generally differ from the Linux Standard Base filesystem hierarchy? BSD is not Linux, so it doesn't adhere to it at all. Each BSD project has a `hier(7)` man page you can refer to. e.g: [for OpenBSD](https://man.openbsd.org/hier). > Is there any sort of standard among BSD distros of putting distro version information in a file in a specific location such as /etc/*-release on Linux? No. You can use sysctl(8) or uname(1). ---------------------------------------------------------------------- KingAggressive1498 · 2021-12-05 07:20 Thanks for the answers. Glad to hear OpenBSD has 1:1 threads now, what I'd read must have been very out of date or perhaps I read it very long ago. I see from the hier(7) manpage that /usr/ /var/ etc still have generally the same use as in Linux so that's probably inherited Unix behavior. I have one follow up question with regards to the last answer; on Linux the sysname field of the utsname struct will generally just read "Linux" regardless of what the installed distro is, and this is why I have to read /etc/*-release to get distro version information. Am I correct in thinking that if I had a process running on ie GhostBSD that the sysname field of the utsname struct would say "FreeBSD"? ---------------------------------------------------------------------- reddit_original · 2021-12-05 10:45 Learn that there is no such thing as a "distro" with BSDs. That is a Linux-ism. The BSDs are complete operating systems unto themselves. You are either running FreeBSD, for example, or you are not. Anything else is just FreeBSD customized. Also learn that the BSDs are direct descendants of Unix. Linux is not. ---------------------------------------------------------------------- brynet · 2021-12-05 16:44 > Am I correct in thinking that if I had a process running on ie GhostBSD that the sysname field of the utsname struct would say "FreeBSD"? Sorry. I'm not familiar with GhostBSD. But if they're using an unmodified FreeBSD base system with custom packages, then that is likely the case. It will be certainly be different on the main three BSDs. ---------------------------------------------------------------------- KingAggressive1498 · 2021-12-05 16:49 Okay then. Thanks for the answers.