diff options
Diffstat (limited to 'cddl/compat')
-rw-r--r-- | cddl/compat/opensolaris/include/libshare.h | 36 | ||||
-rw-r--r-- | cddl/compat/opensolaris/include/mnttab.h | 2 | ||||
-rw-r--r-- | cddl/compat/opensolaris/misc/mnttab.c | 2 | ||||
-rw-r--r-- | cddl/compat/opensolaris/misc/zmount.c | 5 | ||||
-rw-r--r-- | cddl/compat/opensolaris/misc/zone.c | 4 |
5 files changed, 45 insertions, 4 deletions
diff --git a/cddl/compat/opensolaris/include/libshare.h b/cddl/compat/opensolaris/include/libshare.h new file mode 100644 index 0000000..82aacad --- /dev/null +++ b/cddl/compat/opensolaris/include/libshare.h @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_LIBSHARE_H_ +#define _OPENSOLARIS_LIBSHARE_H_ + +#define SA_OK 0 + +#define SA_INIT_CONTROL_API 0 + +#endif /* !_OPENSOLARIS_LIBSHARE_H_ */ diff --git a/cddl/compat/opensolaris/include/mnttab.h b/cddl/compat/opensolaris/include/mnttab.h index 9d0bfc7..abd2f9d 100644 --- a/cddl/compat/opensolaris/include/mnttab.h +++ b/cddl/compat/opensolaris/include/mnttab.h @@ -9,6 +9,8 @@ #define MNTTAB _PATH_DEVNULL #define MNT_LINE_MAX 1024 +#define umount2(p, f) unmount(p, f) + struct mnttab { char *mnt_special; char *mnt_mountp; diff --git a/cddl/compat/opensolaris/misc/mnttab.c b/cddl/compat/opensolaris/misc/mnttab.c index c1971ca..8c1c2d6 100644 --- a/cddl/compat/opensolaris/misc/mnttab.c +++ b/cddl/compat/opensolaris/misc/mnttab.c @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include <sys/mntent.h> #include <sys/mnttab.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> static char * mntopt(char **p) diff --git a/cddl/compat/opensolaris/misc/zmount.c b/cddl/compat/opensolaris/misc/zmount.c index d80a3b3..493a4fc 100644 --- a/cddl/compat/opensolaris/misc/zmount.c +++ b/cddl/compat/opensolaris/misc/zmount.c @@ -35,9 +35,10 @@ __FBSDID("$FreeBSD$"); #include <sys/mount.h> #include <sys/uio.h> #include <sys/mntent.h> +#include <assert.h> #include <stdio.h> #include <stdlib.h> -#include <assert.h> +#include <string.h> static void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, @@ -86,7 +87,7 @@ zmount(const char *spec, const char *dir, int mflag, char *fstype, assert(optlen > 0); optstr = strdup(optptr); - assert(optptr != NULL); + assert(optstr != NULL); iov = NULL; iovlen = 0; diff --git a/cddl/compat/opensolaris/misc/zone.c b/cddl/compat/opensolaris/misc/zone.c index 1ce77cf..9d48e6d 100644 --- a/cddl/compat/opensolaris/misc/zone.c +++ b/cddl/compat/opensolaris/misc/zone.c @@ -32,7 +32,7 @@ #include <sys/sysctl.h> #include <sys/zone.h> -int +zoneid_t getzoneid(void) { size_t size; @@ -42,5 +42,5 @@ getzoneid(void) size = sizeof(jailid); if (sysctlbyname("security.jail.jailed", &jailid, &size, NULL, 0) == -1) assert(!"No security.jail.jailed sysctl!"); - return (jailid); + return ((zoneid_t)jailid); } |