From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6FB6A1381F3 for ; Fri, 26 Jul 2013 03:34:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BF460E09B7; Fri, 26 Jul 2013 03:34:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E2B40E09B7 for ; Fri, 26 Jul 2013 03:34:47 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 821AC33DAC7 for ; Fri, 26 Jul 2013 03:34:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 0A690E5458 for ; Fri, 26 Jul 2013 03:34:45 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1374809604.9ebd5a6aff73d70717f1d9a2f57767eae3eeb0c8.WilliamH@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/librc/, mk/, etc/, src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: etc/rc.conf.DragonFly mk/os-DragonFly.mk src/librc/librc-daemon.c src/rc/rc-plugin.h src/rc/start-stop-daemon.c X-VCS-Directories: src/librc/ mk/ etc/ src/rc/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 9ebd5a6aff73d70717f1d9a2f57767eae3eeb0c8 X-VCS-Branch: master Date: Fri, 26 Jul 2013 03:34:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 141cb904-041d-4350-96ad-3aeae7ad2dbf X-Archives-Hash: d4eea134c5beb4ff96c478565d8d3bdd commit: 9ebd5a6aff73d70717f1d9a2f57767eae3eeb0c8 Author: Gary garyshood com> AuthorDate: Tue Jul 23 05:07:23 2013 +0000 Commit: William Hubbs gentoo org> CommitDate: Fri Jul 26 03:33:24 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=9ebd5a6a Add support for DragonFly BSD --- etc/rc.conf.DragonFly | 13 +++++++++++++ mk/os-DragonFly.mk | 6 ++++++ src/librc/librc-daemon.c | 12 +++++++++--- src/rc/rc-plugin.h | 2 +- src/rc/start-stop-daemon.c | 2 ++ 5 files changed, 31 insertions(+), 4 deletions(-) diff --git a/etc/rc.conf.DragonFly b/etc/rc.conf.DragonFly new file mode 100644 index 0000000..208bcc1 --- /dev/null +++ b/etc/rc.conf.DragonFly @@ -0,0 +1,13 @@ +############################################################################## +# DragonFly BSD SPECIFIC OPTIONS + +# This is the subsystem type. Valid options on DragonFly BSD: +# "" - nothing special +# "jail" - DragonFly BSD jails +# "prefix" - Prefix +# If this is commented out, automatic detection will be used. +# +# This should be set to the value representing the environment this file is +# PRESENTLY in, not the virtualization the environment is capable of. +#rc_sys="" + diff --git a/mk/os-DragonFly.mk b/mk/os-DragonFly.mk new file mode 100644 index 0000000..ff5e42f --- /dev/null +++ b/mk/os-DragonFly.mk @@ -0,0 +1,6 @@ +# Copyright (c) 2008 Roy Marples +# Released under the 2-clause BSD license. + +# Generic definitions + +include ${MK}/os-BSD.mk diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c index 982da35..6e7d57f 100644 --- a/src/librc/librc-daemon.c +++ b/src/librc/librc-daemon.c @@ -164,9 +164,15 @@ librc_hidden_def(rc_find_pids) # endif # define _KINFO_PROC kinfo_proc # define _KVM_GETARGV kvm_getargv -# define _GET_KINFO_UID(kp) (kp.ki_ruid) -# define _GET_KINFO_COMM(kp) (kp.ki_comm) -# define _GET_KINFO_PID(kp) (kp.ki_pid) +# if defined(__DragonFly__) +# define _GET_KINFO_UID(kp) (kp.kp_ruid) +# define _GET_KINFO_COMM(kp) (kp.kp_comm) +# define _GET_KINFO_PID(kp) (kp.kp_pid) +# else +# define _GET_KINFO_UID(kp) (kp.ki_ruid) +# define _GET_KINFO_COMM(kp) (kp.ki_comm) +# define _GET_KINFO_PID(kp) (kp.ki_pid) +# endif # define _KVM_PATH _PATH_DEVNULL # define _KVM_FLAGS O_RDONLY # endif diff --git a/src/rc/rc-plugin.h b/src/rc/rc-plugin.h index f763c3e..b4e40ab 100644 --- a/src/rc/rc-plugin.h +++ b/src/rc/rc-plugin.h @@ -41,7 +41,7 @@ void rc_plugin_unload(void); void rc_plugin_run(RC_HOOK, const char *value); /* dlfunc defines needed to avoid ISO errors. FreeBSD has this right :) */ -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__DragonFly__) struct __dlfunc_arg { int __dlfunc_dummy; }; diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index bfa8852..5576d49 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -110,6 +110,7 @@ extern char **environ; #if !defined(SYS_ioprio_set) && defined(__NR_ioprio_set) # define SYS_ioprio_set __NR_ioprio_set #endif +#if !defined(__DragonFly__) static inline int ioprio_set(int which, int who, int ioprio) { #ifdef SYS_ioprio_set @@ -118,6 +119,7 @@ static inline int ioprio_set(int which, int who, int ioprio) return 0; #endif } +#endif static void free_schedulelist(void)