Index: Makefile
===================================================================
--- Makefile	(revision 2be3612092d0ddffe266e1f9d1d15c79aedb110b)
+++ Makefile	(revision 4a74b5bcfc9449be0d22257a0f73f116301f7f0e)
@@ -1,5 +1,5 @@
 PREFIX?=	/usr/local
 BINDIR=		${PREFIX}/sbin
-MANDIR=		${PREFIX}/man/man
+MANDIR=		${PREFIX}/man/man8
 
 PROG=		icbd
@@ -7,7 +7,9 @@
 MAN=		icbd.8
 
+.ifdef __OpenBSD__
 CFLAGS+=	-W -Wall -Werror
 CFLAGS+=	-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
 CFLAGS+=	-Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
+.endif
 
 DPADD=		${LIBEVENT}
Index: README
===================================================================
--- README	(revision 2be3612092d0ddffe266e1f9d1d15c79aedb110b)
+++ README	(revision 4a74b5bcfc9449be0d22257a0f73f116301f7f0e)
@@ -1,5 +1,38 @@
-icbd: a simple ICB daemon written in C
-======================================
-
-http://www.icb.net/
-http://www.icb.net/_jrudd/icb/protocol.html
+ _____________________
+( A simple ICB daemon )
+ ---------------------
+            \
+             \
+              \                 ,__--**@@@**--__,
+               \             ,@%*               *%@m,
+                          ,@*  #    +@*#          @ *@,
+                        ,@*    @       # __       @    @,
+                    ,*@m#,     @,     m*@  %_-   ,@     ,#m@*,
+              ,@@*-%     @      #                #      @     %-+m,
+             @     @     @#=====#================#=====#@     @    %,
+            @*     ,*@m,##                              ##,m@*,     @
+            #    :@     #====---__________________---====#     @:   @
+           @*    :@     @                                @.    @:   @
+           @      *m__m*         #m,         .#           *m__*     @
+           @      @       .#    %  @         @ @            =-     @*
+           *,     %      ,% @   @   @       @. *%    #,     .-    ,@
+            @     *@     @   @, @   *@    :@    @  ,@ *,    @.    @
+            @      @@.  %      *#     @ ,@*     #+*    %   .@     @
+            @     %  @, @ m--#@+*+@#-- # --#@+*+@#--m  @  ,@+     @
+           .@     @   *@# | @  @    @     @  @    @ | +@ ,@ %     *,
+          ,@      @,     @  @*^     @     @*^     @  @ #%*  @      %,
+         ,@       *%     @   @     @       %     @   @      @        %
+         @       ,*@      %   *=_=*         *=_=*   %      ,*+        @
+        %*     m*  @      %                         %      %  @,       @
+        @     @*   %     ,@                         @,     @   @       @:
+        @     @    @     @            *_*            @      @   @      @:
+        @:    %,   %,    @**__,                 ,__**@      @  _%      @
+         @,    *_   @,   @  @. *--__,     ,__--* .@  @     @  #,     ,@*
+           *--__+#    @,  @  @,    . ^^^^^ .    ,@   *   ,@     *+@@*
+                        ^*+#  *%__*%,m***m,%*__%*   #@@+*
+                                    O     O  *=
+                                     *m_m*
+                                       # #
+                                        # @*#
+                                         #  -#
+                                          #+*^
Index: dns.c
===================================================================
--- dns.c	(revision 2be3612092d0ddffe266e1f9d1d15c79aedb110b)
+++ dns.c	(revision 4a74b5bcfc9449be0d22257a0f73f116301f7f0e)
@@ -28,5 +28,16 @@
 #include <syslog.h>
 
+#ifdef __NetBSD__
+#define NO_ASYNC
+#endif
+
+#ifdef NO_ASYNC
+struct asr_result {
+	struct addrinfo* ar_addrinfo;
+	int ar_gai_errno;
+};
+#else
 #include <asr.h>
+#endif
 
 #include "icb.h"
@@ -86,5 +97,9 @@
 {
 	struct icb_session *is = arg;
+#ifdef NO_ASYNC
+	struct asr_result result;
+#else
 	struct asr_query *as;
+#endif
 	struct addrinfo	hints;
 
@@ -100,6 +115,12 @@
 		memset(&hints, 0, sizeof(hints));
 		hints.ai_family = PF_UNSPEC;
+#ifdef NO_ASYNC
+		getaddrinfo(is->hostname, NULL, &hints, &result.ar_addrinfo);
+		result.ar_gai_errno = errno;
+		dns_done_host(&result, is);
+#else
 		as = getaddrinfo_async(is->hostname, NULL, &hints, NULL);
 		event_asr_run(as, dns_done_host, is);
+#endif
 	} else {
 		icbd_log(is, LOG_DEBUG, "reverse dns resolution failed: %s",
@@ -130,5 +151,9 @@
 dns_resolve(struct icb_session *is)
 {
+#ifdef NO_ASYNC
+	struct asr_result result;
+#else
 	struct asr_query *as;
+#endif
 
 	if (!dodns)
@@ -140,8 +165,16 @@
 		icbd_log(is, LOG_DEBUG, "resolving: %s", is->host);
 
+#ifdef NO_ASYNC
+	getnameinfo((struct sockaddr *)&is->ss,
+		    ((struct sockaddr *)&is->ss)->sa_len, is->hostname,
+		    sizeof is->hostname, NULL, 0, NI_NOFQDN);
+	result.ar_gai_errno = errno;
+	dns_done_reverse(&result, is);
+#else
 	as = getnameinfo_async((struct sockaddr *)&is->ss,
 	    ((struct sockaddr *)&is->ss)->sa_len, is->hostname,
 	    sizeof is->hostname, NULL, 0, NI_NOFQDN, NULL);
 	event_asr_run(as, dns_done_reverse, is);
+#endif
 }
 
Index: icb.c
===================================================================
--- icb.c	(revision 2be3612092d0ddffe266e1f9d1d15c79aedb110b)
+++ icb.c	(revision 4a74b5bcfc9449be0d22257a0f73f116301f7f0e)
@@ -579,5 +579,9 @@
 	LIST_FOREACH(s, &ig->sess, entry) {
 		(void)snprintf(buf, sizeof buf,
+#ifdef __NetBSD__
+		    "%c%c%s%c%ld%c0%c%ld%c%s%c%s%c%s",
+#else
 		    "%c%c%s%c%lld%c0%c%lld%c%s%c%s%c%s",
+#endif
 		    icb_ismod(ig, s) ? 'm' : ' ', ICB_M_SEP,
 		    s->nick, ICB_M_SEP, now - s->last,
Index: icbd.c
===================================================================
--- icbd.c	(revision 2be3612092d0ddffe266e1f9d1d15c79aedb110b)
+++ icbd.c	(revision 4a74b5bcfc9449be0d22257a0f73f116301f7f0e)
@@ -2,4 +2,6 @@
  * Copyright (c) 2009 Mike Belopuhov
  * Copyright (c) 2007 Oleg Safiullin
+ * Copyright (c) 2024 Nishi
+ * Copyright (C) 2025 Izuru Yakumo
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -175,4 +177,8 @@
 		hints.ai_socktype = SOCK_STREAM;
 		hints.ai_flags = AI_PASSIVE;
+#ifdef __OpenBSD__
+		/* Apparently OpenBSD is the only one that has icb on /etc/services */
+		/* Sure, it could be easily added to any other system, but I'm personally against it */
+		/* ~Izuru Yakumo */
 		if ((error = getaddrinfo(addr, port ? port : "icb", &hints,
 		    &res0)) != 0) {
@@ -180,5 +186,10 @@
 			return (EX_UNAVAILABLE);
 		}
-
+#else
+		if ((error = getaddrinfo(addr, port ? port : "7326", &hints, &res0)) != 0) {
+			syslog(LOG_ERR, "%s", gai_strerror(error));
+			return (EX_UNAVAILABLE);
+		}
+#endif
 		for (res = res0; res != NULL; res = res->ai_next) {
 			if ((s = socket(res->ai_family, res->ai_socktype,
@@ -476,10 +487,9 @@
 		exit(EX_NOPERM);
 	}
-
+#ifdef __OpenBSD__
 	if (sb.st_uid != 0 || (sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) {
 		syslog(LOG_ERR, "bad directory permissions");
 		exit(EX_NOPERM);
 	}
-
 	if (chroot(pw->pw_dir) < 0) {
 		syslog(LOG_ERR, "%s: %m", pw->pw_dir);
@@ -493,5 +503,5 @@
 
 	chdir(ICBD_HOME);
-
+#endif
 	if (setuid(pw->pw_uid) < 0) {
 		syslog(LOG_ERR, "%d: %m", pw->pw_uid);
@@ -499,4 +509,5 @@
 	}
 
+#ifdef __OpenBSD__
 	if (dodns) {
 		if (pledge("stdio inet rpath dns", NULL) == -1) {
@@ -510,4 +521,5 @@
 		}
 	}
+#endif
 
 	(void)setproctitle("icbd");
Index: logger.c
===================================================================
--- logger.c	(revision 2be3612092d0ddffe266e1f9d1d15c79aedb110b)
+++ logger.c	(revision 4a74b5bcfc9449be0d22257a0f73f116301f7f0e)
@@ -1,5 +1,7 @@
 /*
+ * Copyright (c) 2009 Michael Shalayeff
  * Copyright (c) 2014 Mike Belopuhov
- * Copyright (c) 2009 Michael Shalayeff
+ * Copyright (c) 2024 Nishi
+ * Copyright (c) 2025 Izuru Yakumo
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -96,5 +98,5 @@
 		exit(EX_NOUSER);
 	}
-
+#ifdef __OpenBSD
 	if (chroot(pw->pw_dir) < 0) {
 		syslog(LOG_ERR, "%s: %s: %m", __func__, pw->pw_dir);
@@ -113,9 +115,11 @@
 		exit(EX_NOPERM);
 	}
-
+#endif
+#ifdef __OpenBSD__
 	if (pledge("stdio cpath wpath", NULL) == -1) {
 		syslog(LOG_ERR, "%s: pledge", __func__);
 		exit(EX_NOPERM);
 	}
+#endif
 
 	event_init();
