Global: Add support for Oracle Solaris (#2176)

* Fix Oracle Solaris zpool build

* Add memrchr fallback

* Change to include fron extern

* add new line

* remove ; in zpool.c

* Change wrapper to macro

Also change README.md

* Tweaks

---------

Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
This commit is contained in:
Verdgil
2026-02-10 12:32:20 +03:00
committed by GitHub
parent e8f2b9a1c7
commit 5b10cde59f
6 changed files with 32 additions and 1 deletions
+1
View File
@@ -1115,6 +1115,7 @@ elseif(SunOS)
src/detection/displayserver/linux/xcb.c
src/detection/displayserver/linux/xlib.c
src/detection/font/font_linux.c
src/common/solaris/memrchr.c
src/detection/gpu/gpu_sunos.c
src/detection/gpu/gpu_pci.c
src/detection/gtk_qt/gtk.c
+1 -1
View File
@@ -13,7 +13,7 @@
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/fastfetch-cli/fastfetch)
[![中文README](https://img.shields.io/badge/%E4%B8%AD%E6%96%87-README-red)](README-cn.md)
Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it in a visually appealing way. It is written mainly in C, with a focus on performance and customizability. Currently, it supports Linux, macOS, Windows 7+, Android, FreeBSD, OpenBSD, NetBSD, DragonFly, Haiku, and illumos (SunOS).
Fastfetch is a [neofetch](https://github.com/dylanaraps/neofetch)-like tool for fetching system information and displaying it in a visually appealing way. It is written mainly in C, with a focus on performance and customizability. Currently, it supports Linux, macOS, Windows 7+, Android, FreeBSD, OpenBSD, NetBSD, DragonFly, Haiku, illumos (SunOS), and Solaris.
<img src="screenshots/example1.png" width="49%" align="left" />
<img src="https://upload.wikimedia.org/wikipedia/commons/2/24/Transparent_Square_Tiles_Texture.png" width="49%" height="16px" align="left" />
+15
View File
@@ -0,0 +1,15 @@
#if defined(__sun) && ! defined(__illumos__)
#include "memrchr.h"
void *memrchr(const void *s, int c, size_t n)
{
if(n == 0) return NULL;
const unsigned char *p = (const unsigned char *)s + n;
while (n--) {
if (*(--p) == (unsigned char) c)
return (void*) p;
}
return NULL;
}
#endif
+6
View File
@@ -0,0 +1,6 @@
#pragma once
#include <stddef.h>
#if defined(__sun) && !defined(__illumos__)
void *memrchr(const void *s, int c, size_t n);
#endif
+4
View File
@@ -24,6 +24,10 @@
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
#if defined(__sun) && ! defined(__illumos__)
#include "common/solaris/memrchr.h"
#endif
static const FFstrbuf* loadPciIds()
{
static FFstrbuf pciids;
+5
View File
@@ -6,6 +6,11 @@
#ifdef __sun
#include <libzfs.h>
#ifndef __illumos__
// On Solaris 11, zpool_get_prop has only 5 arguments. #2173
#define ffzpool_get_prop(zhp, prop, buf, len, srctype, literal) \
ffzpool_get_prop(zhp, prop, buf, len, srctype)
#endif
#else
#include "libzfs_simplified.h"
#endif