mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 19:28:53 +03:00
Initial Linux ZFS GIT Repo
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
subdir-m += sys
|
||||
|
||||
DISTFILES = fake_ioctl.h libdiskmgt.h libshare.h mntent.h stdlib.h
|
||||
DISTFILES += string.h strings.h stropts.h unistd.h
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef _PORT_FAKE_IOCTL_H
|
||||
#define _PORT_FAKE_IOCTL_H
|
||||
|
||||
static inline int real_ioctl(int fd, int request, void *arg)
|
||||
{
|
||||
return ioctl(fd, request, arg);
|
||||
}
|
||||
|
||||
#ifdef WANT_FAKE_IOCTL
|
||||
|
||||
#include <sys/dmu_ctl.h>
|
||||
#define ioctl(fd,req,arg) dctlc_ioctl(fd,req,arg)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _PORT_FAKE_IOCTL_H */
|
||||
@@ -0,0 +1,278 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifdef HAVE_LIBDISKMGT_H
|
||||
#include_next <libdiskmgt.h>
|
||||
#else
|
||||
|
||||
#ifndef _LIBDISKMGT_H
|
||||
#define _LIBDISKMGT_H
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <libnvpair.h>
|
||||
#include <sys/swap.h>
|
||||
|
||||
|
||||
/*
|
||||
* Holds all the data regarding the device.
|
||||
* Private to libdiskmgt. Must use dm_xxx functions to set/get data.
|
||||
*/
|
||||
typedef uint64_t dm_descriptor_t;
|
||||
|
||||
typedef enum {
|
||||
DM_WHO_MKFS = 0,
|
||||
DM_WHO_ZPOOL,
|
||||
DM_WHO_ZPOOL_FORCE,
|
||||
DM_WHO_FORMAT,
|
||||
DM_WHO_SWAP,
|
||||
DM_WHO_DUMP,
|
||||
DM_WHO_ZPOOL_SPARE
|
||||
} dm_who_type_t;
|
||||
|
||||
typedef enum {
|
||||
DM_DRIVE = 0,
|
||||
DM_CONTROLLER,
|
||||
DM_MEDIA,
|
||||
DM_SLICE,
|
||||
DM_PARTITION,
|
||||
DM_PATH,
|
||||
DM_ALIAS,
|
||||
DM_BUS
|
||||
} dm_desc_type_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
DM_DT_UNKNOWN = 0,
|
||||
DM_DT_FIXED,
|
||||
DM_DT_ZIP,
|
||||
DM_DT_JAZ,
|
||||
DM_DT_FLOPPY,
|
||||
DM_DT_MO_ERASABLE,
|
||||
DM_DT_MO_WRITEONCE,
|
||||
DM_DT_AS_MO,
|
||||
DM_DT_CDROM,
|
||||
DM_DT_CDR,
|
||||
DM_DT_CDRW,
|
||||
DM_DT_DVDROM,
|
||||
DM_DT_DVDR,
|
||||
DM_DT_DVDRAM,
|
||||
DM_DT_DVDRW,
|
||||
DM_DT_DDCDROM,
|
||||
DM_DT_DDCDR,
|
||||
DM_DT_DDCDRW
|
||||
} dm_drive_type_t;
|
||||
|
||||
typedef enum {
|
||||
DM_MT_UNKNOWN = 0,
|
||||
DM_MT_FIXED,
|
||||
DM_MT_FLOPPY,
|
||||
DM_MT_CDROM,
|
||||
DM_MT_ZIP,
|
||||
DM_MT_JAZ,
|
||||
DM_MT_CDR,
|
||||
DM_MT_CDRW,
|
||||
DM_MT_DVDROM,
|
||||
DM_MT_DVDR,
|
||||
DM_MT_DVDRAM,
|
||||
DM_MT_MO_ERASABLE,
|
||||
DM_MT_MO_WRITEONCE,
|
||||
DM_MT_AS_MO
|
||||
} dm_media_type_t;
|
||||
|
||||
#define DM_FILTER_END -1
|
||||
|
||||
/* drive stat name */
|
||||
typedef enum {
|
||||
DM_DRV_STAT_PERFORMANCE = 0,
|
||||
DM_DRV_STAT_DIAGNOSTIC,
|
||||
DM_DRV_STAT_TEMPERATURE
|
||||
} dm_drive_stat_t;
|
||||
|
||||
/* slice stat name */
|
||||
typedef enum {
|
||||
DM_SLICE_STAT_USE = 0
|
||||
} dm_slice_stat_t;
|
||||
|
||||
/* attribute definitions */
|
||||
|
||||
/* drive */
|
||||
#define DM_DISK_UP 1
|
||||
#define DM_DISK_DOWN 0
|
||||
|
||||
#define DM_CLUSTERED "clustered"
|
||||
#define DM_DRVTYPE "drvtype"
|
||||
#define DM_FAILING "failing"
|
||||
#define DM_LOADED "loaded" /* also in media */
|
||||
#define DM_NDNRERRS "ndevice_not_ready_errors"
|
||||
#define DM_NBYTESREAD "nbytes_read"
|
||||
#define DM_NBYTESWRITTEN "nbytes_written"
|
||||
#define DM_NHARDERRS "nhard_errors"
|
||||
#define DM_NILLREQERRS "nillegal_req_errors"
|
||||
#define DM_NMEDIAERRS "nmedia_errors"
|
||||
#define DM_NNODEVERRS "nno_dev_errors"
|
||||
#define DM_NREADOPS "nread_ops"
|
||||
#define DM_NRECOVERRS "nrecoverable_errors"
|
||||
#define DM_NSOFTERRS "nsoft_errors"
|
||||
#define DM_NTRANSERRS "ntransport_errors"
|
||||
#define DM_NWRITEOPS "nwrite_ops"
|
||||
#define DM_OPATH "opath"
|
||||
#define DM_PRODUCT_ID "product_id"
|
||||
#define DM_REMOVABLE "removable" /* also in media */
|
||||
#define DM_RPM "rpm"
|
||||
#define DM_STATUS "status"
|
||||
#define DM_SYNC_SPEED "sync_speed"
|
||||
#define DM_TEMPERATURE "temperature"
|
||||
#define DM_VENDOR_ID "vendor_id"
|
||||
#define DM_WIDE "wide" /* also on controller */
|
||||
#define DM_WWN "wwn"
|
||||
|
||||
/* bus */
|
||||
#define DM_BTYPE "btype"
|
||||
#define DM_CLOCK "clock" /* also on controller */
|
||||
#define DM_PNAME "pname"
|
||||
|
||||
/* controller */
|
||||
#define DM_FAST "fast"
|
||||
#define DM_FAST20 "fast20"
|
||||
#define DM_FAST40 "fast40"
|
||||
#define DM_FAST80 "fast80"
|
||||
#define DM_MULTIPLEX "multiplex"
|
||||
#define DM_PATH_STATE "path_state"
|
||||
|
||||
#define DM_CTYPE_ATA "ata"
|
||||
#define DM_CTYPE_SCSI "scsi"
|
||||
#define DM_CTYPE_FIBRE "fibre channel"
|
||||
#define DM_CTYPE_USB "usb"
|
||||
#define DM_CTYPE_UNKNOWN "unknown"
|
||||
|
||||
/* media */
|
||||
#define DM_BLOCKSIZE "blocksize"
|
||||
#define DM_FDISK "fdisk"
|
||||
#define DM_MTYPE "mtype"
|
||||
#define DM_NACTUALCYLINDERS "nactual_cylinders"
|
||||
#define DM_NALTCYLINDERS "nalt_cylinders"
|
||||
#define DM_NCYLINDERS "ncylinders"
|
||||
#define DM_NHEADS "nheads"
|
||||
#define DM_NPHYSCYLINDERS "nphys_cylinders"
|
||||
#define DM_NSECTORS "nsectors" /* also in partition */
|
||||
#define DM_SIZE "size" /* also in slice */
|
||||
#define DM_NACCESSIBLE "naccessible"
|
||||
#define DM_LABEL "label"
|
||||
|
||||
/* partition */
|
||||
#define DM_BCYL "bcyl"
|
||||
#define DM_BHEAD "bhead"
|
||||
#define DM_BOOTID "bootid"
|
||||
#define DM_BSECT "bsect"
|
||||
#define DM_ECYL "ecyl"
|
||||
#define DM_EHEAD "ehead"
|
||||
#define DM_ESECT "esect"
|
||||
#define DM_PTYPE "ptype"
|
||||
#define DM_RELSECT "relsect"
|
||||
|
||||
/* slice */
|
||||
#define DM_DEVICEID "deviceid"
|
||||
#define DM_DEVT "devt"
|
||||
#define DM_INDEX "index"
|
||||
#define DM_EFI_NAME "name"
|
||||
#define DM_MOUNTPOINT "mountpoint"
|
||||
#define DM_LOCALNAME "localname"
|
||||
#define DM_START "start"
|
||||
#define DM_TAG "tag"
|
||||
#define DM_FLAG "flag"
|
||||
#define DM_EFI "efi" /* also on media */
|
||||
#define DM_USED_BY "used_by"
|
||||
#define DM_USED_NAME "used_name"
|
||||
#define DM_USE_MOUNT "mount"
|
||||
#define DM_USE_SVM "svm"
|
||||
#define DM_USE_LU "lu"
|
||||
#define DM_USE_DUMP "dump"
|
||||
#define DM_USE_VXVM "vxvm"
|
||||
#define DM_USE_FS "fs"
|
||||
#define DM_USE_VFSTAB "vfstab"
|
||||
#define DM_USE_EXPORTED_ZPOOL "exported_zpool"
|
||||
#define DM_USE_ACTIVE_ZPOOL "active_zpool"
|
||||
#define DM_USE_SPARE_ZPOOL "spare_zpool"
|
||||
#define DM_USE_L2CACHE_ZPOOL "l2cache_zpool"
|
||||
|
||||
/* event */
|
||||
#define DM_EV_NAME "name"
|
||||
#define DM_EV_DTYPE "edtype"
|
||||
#define DM_EV_TYPE "evtype"
|
||||
#define DM_EV_TADD "add"
|
||||
#define DM_EV_TREMOVE "remove"
|
||||
#define DM_EV_TCHANGE "change"
|
||||
|
||||
/* findisks */
|
||||
#define DM_CTYPE "ctype"
|
||||
#define DM_LUN "lun"
|
||||
#define DM_TARGET "target"
|
||||
|
||||
#define NOINUSE_SET getenv("NOINUSE_CHECK") != NULL
|
||||
|
||||
void dm_free_descriptors(dm_descriptor_t *desc_list);
|
||||
void dm_free_descriptor(dm_descriptor_t desc);
|
||||
void dm_free_name(char *name);
|
||||
void dm_free_swapentries(swaptbl_t *);
|
||||
|
||||
dm_descriptor_t *dm_get_descriptors(dm_desc_type_t type, int filter[],
|
||||
int *errp);
|
||||
dm_descriptor_t *dm_get_associated_descriptors(dm_descriptor_t desc,
|
||||
dm_desc_type_t type, int *errp);
|
||||
dm_desc_type_t *dm_get_associated_types(dm_desc_type_t type);
|
||||
dm_descriptor_t dm_get_descriptor_by_name(dm_desc_type_t desc_type,
|
||||
char *name, int *errp);
|
||||
char *dm_get_name(dm_descriptor_t desc, int *errp);
|
||||
dm_desc_type_t dm_get_type(dm_descriptor_t desc);
|
||||
nvlist_t *dm_get_attributes(dm_descriptor_t desc, int *errp);
|
||||
nvlist_t *dm_get_stats(dm_descriptor_t desc, int stat_type,
|
||||
int *errp);
|
||||
void dm_init_event_queue(void(*callback)(nvlist_t *, int),
|
||||
int *errp);
|
||||
nvlist_t *dm_get_event(int *errp);
|
||||
void dm_get_slices(char *drive, dm_descriptor_t **slices,
|
||||
int *errp);
|
||||
void dm_get_slice_stats(char *slice, nvlist_t **dev_stats,
|
||||
int *errp);
|
||||
int dm_get_swapentries(swaptbl_t **, int *);
|
||||
void dm_get_usage_string(char *who, char *data, char **msg);
|
||||
int dm_inuse(char *dev_name, char **msg, dm_who_type_t who,
|
||||
int *errp);
|
||||
int dm_inuse_swap(const char *dev_name, int *errp);
|
||||
int dm_isoverlapping(char *dev_name, char **msg, int *errp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LIBDISKMGT_H */
|
||||
#endif /* HAVE_LIBDISKMGT_H */
|
||||
@@ -0,0 +1,287 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
/*
|
||||
* basic API declarations for share management
|
||||
*/
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifdef HAVE_LIBSHARE
|
||||
#include_next <libshare.h>
|
||||
#else
|
||||
|
||||
#ifndef _LIBSHARE_H
|
||||
#define _LIBSHARE_H
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* Basic datatypes for most functions
|
||||
*/
|
||||
typedef void *sa_group_t;
|
||||
typedef void *sa_share_t;
|
||||
typedef void *sa_property_t;
|
||||
typedef void *sa_optionset_t;
|
||||
typedef void *sa_security_t;
|
||||
typedef void *sa_protocol_properties_t;
|
||||
typedef void *sa_resource_t;
|
||||
|
||||
typedef void *sa_handle_t; /* opaque handle to access core functions */
|
||||
|
||||
/*
|
||||
* defined error values
|
||||
*/
|
||||
|
||||
#define SA_OK 0
|
||||
#define SA_NO_SUCH_PATH 1 /* provided path doesn't exist */
|
||||
#define SA_NO_MEMORY 2 /* no memory for data structures */
|
||||
#define SA_DUPLICATE_NAME 3 /* object name is already in use */
|
||||
#define SA_BAD_PATH 4 /* not a full path */
|
||||
#define SA_NO_SUCH_GROUP 5 /* group is not defined */
|
||||
#define SA_CONFIG_ERR 6 /* system configuration error */
|
||||
#define SA_SYSTEM_ERR 7 /* system error, use errno */
|
||||
#define SA_SYNTAX_ERR 8 /* syntax error on command line */
|
||||
#define SA_NO_PERMISSION 9 /* no permission for operation */
|
||||
#define SA_BUSY 10 /* resource is busy */
|
||||
#define SA_NO_SUCH_PROP 11 /* property doesn't exist */
|
||||
#define SA_INVALID_NAME 12 /* name of object is invalid */
|
||||
#define SA_INVALID_PROTOCOL 13 /* specified protocol not valid */
|
||||
#define SA_NOT_ALLOWED 14 /* operation not allowed */
|
||||
#define SA_BAD_VALUE 15 /* bad value for property */
|
||||
#define SA_INVALID_SECURITY 16 /* invalid security type */
|
||||
#define SA_NO_SUCH_SECURITY 17 /* security set not found */
|
||||
#define SA_VALUE_CONFLICT 18 /* property value conflict */
|
||||
#define SA_NOT_IMPLEMENTED 19 /* plugin interface not implemented */
|
||||
#define SA_INVALID_PATH 20 /* path is sub-dir of existing share */
|
||||
#define SA_NOT_SUPPORTED 21 /* operation not supported for proto */
|
||||
#define SA_PROP_SHARE_ONLY 22 /* property valid on share only */
|
||||
#define SA_NOT_SHARED 23 /* path is not shared */
|
||||
#define SA_NO_SUCH_RESOURCE 24 /* resource not found */
|
||||
#define SA_RESOURCE_REQUIRED 25 /* resource name is required */
|
||||
#define SA_MULTIPLE_ERROR 26 /* multiple protocols reported error */
|
||||
#define SA_PATH_IS_SUBDIR 27 /* check_path found path is subdir */
|
||||
#define SA_PATH_IS_PARENTDIR 28 /* check_path found path is parent */
|
||||
#define SA_NO_SECTION 29 /* protocol requires section info */
|
||||
#define SA_NO_SUCH_SECTION 30 /* no section found */
|
||||
#define SA_NO_PROPERTIES 31 /* no properties found */
|
||||
#define SA_PASSWORD_ENC 32 /* passwords must be encrypted */
|
||||
|
||||
/* API Initialization */
|
||||
#define SA_INIT_SHARE_API 0x0001 /* init share specific interface */
|
||||
#define SA_INIT_CONTROL_API 0x0002 /* init control specific interface */
|
||||
|
||||
/* not part of API returns */
|
||||
#define SA_LEGACY_ERR 32 /* share/unshare error return */
|
||||
|
||||
/*
|
||||
* other defined values
|
||||
*/
|
||||
|
||||
#define SA_MAX_NAME_LEN 100 /* must fit service instance name */
|
||||
#define SA_MAX_RESOURCE_NAME 255 /* Maximum length of resource name */
|
||||
|
||||
/* Used in calls to sa_add_share() and sa_add_resource() */
|
||||
#define SA_SHARE_TRANSIENT 0 /* shared but not across reboot */
|
||||
#define SA_SHARE_LEGACY 1 /* share is in dfstab only */
|
||||
#define SA_SHARE_PERMANENT 2 /* share goes to repository */
|
||||
|
||||
/* sa_check_path() related */
|
||||
#define SA_CHECK_NORMAL 0 /* only check against active shares */
|
||||
#define SA_CHECK_STRICT 1 /* check against all shares */
|
||||
|
||||
/* RBAC related */
|
||||
#define SA_RBAC_MANAGE "solaris.smf.manage.shares"
|
||||
#define SA_RBAC_VALUE "solaris.smf.value.shares"
|
||||
|
||||
/*
|
||||
* Feature set bit definitions
|
||||
*/
|
||||
|
||||
#define SA_FEATURE_NONE 0x0000 /* no feature flags set */
|
||||
#define SA_FEATURE_RESOURCE 0x0001 /* resource names are required */
|
||||
#define SA_FEATURE_DFSTAB 0x0002 /* need to manage in dfstab */
|
||||
#define SA_FEATURE_ALLOWSUBDIRS 0x0004 /* allow subdirs to be shared */
|
||||
#define SA_FEATURE_ALLOWPARDIRS 0x0008 /* allow parent dirs to be shared */
|
||||
#define SA_FEATURE_HAS_SECTIONS 0x0010 /* protocol supports sections */
|
||||
#define SA_FEATURE_ADD_PROPERTIES 0x0020 /* can add properties */
|
||||
#define SA_FEATURE_SERVER 0x0040 /* protocol supports server mode */
|
||||
|
||||
/*
|
||||
* legacy files
|
||||
*/
|
||||
|
||||
#define SA_LEGACY_DFSTAB "/etc/dfs/dfstab"
|
||||
#define SA_LEGACY_SHARETAB "/etc/dfs/sharetab"
|
||||
|
||||
/*
|
||||
* SMF related
|
||||
*/
|
||||
|
||||
#define SA_SVC_FMRI_BASE "svc:/network/shares/group"
|
||||
|
||||
/* initialization */
|
||||
extern sa_handle_t sa_init(int);
|
||||
extern void sa_fini(sa_handle_t);
|
||||
extern int sa_update_config(sa_handle_t);
|
||||
extern char *sa_errorstr(int);
|
||||
|
||||
/* protocol names */
|
||||
extern int sa_get_protocols(char ***);
|
||||
extern int sa_valid_protocol(char *);
|
||||
|
||||
/* group control (create, remove, etc) */
|
||||
extern sa_group_t sa_create_group(sa_handle_t, char *, int *);
|
||||
extern int sa_remove_group(sa_group_t);
|
||||
extern sa_group_t sa_get_group(sa_handle_t, char *);
|
||||
extern sa_group_t sa_get_next_group(sa_group_t);
|
||||
extern char *sa_get_group_attr(sa_group_t, char *);
|
||||
extern int sa_set_group_attr(sa_group_t, char *, char *);
|
||||
extern sa_group_t sa_get_sub_group(sa_group_t);
|
||||
extern int sa_valid_group_name(char *);
|
||||
|
||||
/* share control */
|
||||
extern sa_share_t sa_add_share(sa_group_t, char *, int, int *);
|
||||
extern int sa_check_path(sa_group_t, char *, int);
|
||||
extern int sa_move_share(sa_group_t, sa_share_t);
|
||||
extern int sa_remove_share(sa_share_t);
|
||||
extern sa_share_t sa_get_share(sa_group_t, char *);
|
||||
extern sa_share_t sa_find_share(sa_handle_t, char *);
|
||||
extern sa_share_t sa_get_next_share(sa_share_t);
|
||||
extern char *sa_get_share_attr(sa_share_t, char *);
|
||||
extern char *sa_get_share_description(sa_share_t);
|
||||
extern sa_group_t sa_get_parent_group(sa_share_t);
|
||||
extern int sa_set_share_attr(sa_share_t, char *, char *);
|
||||
extern int sa_set_share_description(sa_share_t, char *);
|
||||
extern int sa_enable_share(sa_group_t, char *);
|
||||
extern int sa_disable_share(sa_share_t, char *);
|
||||
extern int sa_is_share(void *);
|
||||
|
||||
/* resource name related */
|
||||
extern sa_resource_t sa_find_resource(sa_handle_t, char *);
|
||||
extern sa_resource_t sa_get_resource(sa_group_t, char *);
|
||||
extern sa_resource_t sa_get_next_resource(sa_resource_t);
|
||||
extern sa_share_t sa_get_resource_parent(sa_resource_t);
|
||||
extern sa_resource_t sa_get_share_resource(sa_share_t, char *);
|
||||
extern sa_resource_t sa_add_resource(sa_share_t, char *, int, int *);
|
||||
extern int sa_remove_resource(sa_resource_t);
|
||||
extern char *sa_get_resource_attr(sa_resource_t, char *);
|
||||
extern int sa_set_resource_attr(sa_resource_t, char *, char *);
|
||||
extern int sa_set_resource_description(sa_resource_t, char *);
|
||||
extern char *sa_get_resource_description(sa_resource_t);
|
||||
extern int sa_enable_resource(sa_resource_t, char *);
|
||||
extern int sa_disable_resource(sa_resource_t, char *);
|
||||
extern int sa_rename_resource(sa_resource_t, char *);
|
||||
extern void sa_fix_resource_name(char *);
|
||||
|
||||
/* data structure free calls */
|
||||
extern void sa_free_attr_string(char *);
|
||||
extern void sa_free_share_description(char *);
|
||||
|
||||
/* optionset control */
|
||||
extern sa_optionset_t sa_get_optionset(sa_group_t, char *);
|
||||
extern sa_optionset_t sa_get_next_optionset(sa_group_t);
|
||||
extern char *sa_get_optionset_attr(sa_optionset_t, char *);
|
||||
extern void sa_set_optionset_attr(sa_optionset_t, char *, char *);
|
||||
extern sa_optionset_t sa_create_optionset(sa_group_t, char *);
|
||||
extern int sa_destroy_optionset(sa_optionset_t);
|
||||
extern sa_optionset_t sa_get_derived_optionset(void *, char *, int);
|
||||
extern void sa_free_derived_optionset(sa_optionset_t);
|
||||
|
||||
/* property functions */
|
||||
extern sa_property_t sa_get_property(sa_optionset_t, char *);
|
||||
extern sa_property_t sa_get_next_property(sa_group_t);
|
||||
extern char *sa_get_property_attr(sa_property_t, char *);
|
||||
extern sa_property_t sa_create_section(char *, char *);
|
||||
extern void sa_set_section_attr(sa_property_t, char *, char *);
|
||||
extern sa_property_t sa_create_property(char *, char *);
|
||||
extern int sa_add_property(void *, sa_property_t);
|
||||
extern int sa_update_property(sa_property_t, char *);
|
||||
extern int sa_remove_property(sa_property_t);
|
||||
extern int sa_commit_properties(sa_optionset_t, int);
|
||||
extern int sa_valid_property(void *, char *, sa_property_t);
|
||||
extern int sa_is_persistent(void *);
|
||||
|
||||
/* security control */
|
||||
extern sa_security_t sa_get_security(sa_group_t, char *, char *);
|
||||
extern sa_security_t sa_get_next_security(sa_security_t);
|
||||
extern char *sa_get_security_attr(sa_optionset_t, char *);
|
||||
extern sa_security_t sa_create_security(sa_group_t, char *, char *);
|
||||
extern int sa_destroy_security(sa_security_t);
|
||||
extern void sa_set_security_attr(sa_security_t, char *, char *);
|
||||
extern sa_optionset_t sa_get_all_security_types(void *, char *, int);
|
||||
extern sa_security_t sa_get_derived_security(void *, char *, char *, int);
|
||||
extern void sa_free_derived_security(sa_security_t);
|
||||
|
||||
/* protocol specific interfaces */
|
||||
extern int sa_parse_legacy_options(sa_group_t, char *, char *);
|
||||
extern char *sa_proto_legacy_format(char *, sa_group_t, int);
|
||||
extern int sa_is_security(char *, char *);
|
||||
extern sa_protocol_properties_t sa_proto_get_properties(char *);
|
||||
extern uint64_t sa_proto_get_featureset(char *);
|
||||
extern sa_property_t sa_get_protocol_section(sa_protocol_properties_t, char *);
|
||||
extern sa_property_t sa_get_next_protocol_section(sa_property_t, char *);
|
||||
extern sa_property_t sa_get_protocol_property(sa_protocol_properties_t, char *);
|
||||
extern sa_property_t sa_get_next_protocol_property(sa_property_t, char *);
|
||||
extern int sa_set_protocol_property(sa_property_t, char *, char *);
|
||||
extern char *sa_get_protocol_status(char *);
|
||||
extern void sa_format_free(char *);
|
||||
extern sa_protocol_properties_t sa_create_protocol_properties(char *);
|
||||
extern int sa_add_protocol_property(sa_protocol_properties_t, sa_property_t);
|
||||
extern int sa_proto_valid_prop(char *, sa_property_t, sa_optionset_t);
|
||||
extern int sa_proto_valid_space(char *, char *);
|
||||
extern char *sa_proto_space_alias(char *, char *);
|
||||
extern int sa_proto_get_transients(sa_handle_t, char *);
|
||||
extern int sa_proto_notify_resource(sa_resource_t, char *);
|
||||
extern int sa_proto_change_notify(sa_share_t, char *);
|
||||
extern int sa_proto_delete_section(char *, char *);
|
||||
|
||||
/* handle legacy (dfstab/sharetab) files */
|
||||
extern int sa_delete_legacy(sa_share_t, char *);
|
||||
extern int sa_update_legacy(sa_share_t, char *);
|
||||
extern int sa_update_sharetab(sa_share_t, char *);
|
||||
extern int sa_delete_sharetab(sa_handle_t, char *, char *);
|
||||
|
||||
/* ZFS functions */
|
||||
extern int sa_zfs_is_shared(sa_handle_t, char *);
|
||||
extern int sa_group_is_zfs(sa_group_t);
|
||||
extern int sa_path_is_zfs(char *);
|
||||
|
||||
/* SA Handle specific functions */
|
||||
extern sa_handle_t sa_find_group_handle(sa_group_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LIBSHARE_H */
|
||||
#endif /* HAVE_LIBSHARE */
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include_next <mntent.h>
|
||||
|
||||
#ifndef _PORT_MNTENT_H
|
||||
#define _PORT_MNTENT_H
|
||||
|
||||
/* For HAVE_SETMNTENT */
|
||||
#include "zfs_config.h"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include_next <stdlib.h>
|
||||
|
||||
#ifndef _PORT_STDLIB_H
|
||||
#define _PORT_STDLIB_H
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifndef HAVE_GETEXECNAME
|
||||
extern const char *getexecname();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include_next <string.h>
|
||||
|
||||
#ifndef _PORT_STRING_H
|
||||
#define _PORT_STRING_H
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifndef HAVE_STRLCPY
|
||||
extern size_t strlcpy(char *dst, const char *src, size_t len);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRLCAT
|
||||
extern size_t strlcat(char *, const char *, size_t);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNLEN
|
||||
extern size_t strnlen(const char *src, size_t maxlen);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include_next <strings.h>
|
||||
|
||||
#ifndef _PORT_STRINGS_H
|
||||
#define _PORT_STRINGS_H
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifndef HAVE_STRCMP_IN_STRINGS_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include_next <stropts.h>
|
||||
|
||||
#ifndef _PORT_STROPTS_H
|
||||
#define _PORT_STROPTS_H
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifdef HAVE_IOCTL_IN_STROPTS_H
|
||||
#include <fake_ioctl.h>
|
||||
#endif
|
||||
|
||||
#endif /* _PORT_STROPTS_H */
|
||||
@@ -0,0 +1,3 @@
|
||||
DISTFILES = byteorder.h debug.h efi_partition.h ioctl.h isa_defs.h
|
||||
DISTFILES += policy.h socket.h swap.h systeminfo.h systm.h time.h
|
||||
DISTFILES += types.h u8_textprep.h u8_textprep_data.h
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifdef HAVE_SYS_BYTEORDER_H
|
||||
#include_next <sys/byteorder.h>
|
||||
#endif
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef _PORT_SYS_DEBUG_H
|
||||
#define _PORT_SYS_DEBUG_H
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
/* This definition is copied from assert.h. */
|
||||
#if defined(__STDC__)
|
||||
#if __STDC_VERSION__ - 0 >= 199901L
|
||||
#define zp_verify(EX) (void)((EX) || \
|
||||
(__assert_c99(#EX, __FILE__, __LINE__, __func__), 0))
|
||||
#else
|
||||
#define zp_verify(EX) (void)((EX) || (__assert(#EX, __FILE__, __LINE__), 0))
|
||||
#endif /* __STDC_VERSION__ - 0 >= 199901L */
|
||||
#else
|
||||
#define zp_verify(EX) (void)((EX) || (_assert("EX", __FILE__, __LINE__), 0))
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#define VERIFY(EX) zp_verify(EX)
|
||||
#define ASSERT(EX) assert(EX)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifdef HAVE_LIBEFI
|
||||
|
||||
#include_next <sys/efi_partition.h>
|
||||
|
||||
#ifndef EFI_MIN_RESV_SIZE
|
||||
#define EFI_MIN_RESV_SIZE (16 * 1024)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include_next <sys/ioctl.h>
|
||||
|
||||
#ifndef _PORT_SYS_IOCTL_H
|
||||
#define _PORT_SYS_IOCTL_H
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifdef HAVE_IOCTL_IN_SYS_IOCTL_H
|
||||
#include <fake_ioctl.h>
|
||||
#endif
|
||||
|
||||
#endif /* _PORT_SYS_IOCTL_H */
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifdef HAVE_SYS_ISA_DEFS_H
|
||||
#include_next <sys/isa_defs.h>
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef _PORT_SYS_POLICY_H
|
||||
#define _PORT_SYS_POLICY_H
|
||||
|
||||
#ifdef WANT_KERNEL_EMUL
|
||||
|
||||
#define secpolicy_fs_unmount(c,vfs) (0)
|
||||
#define secpolicy_nfs(c) (0)
|
||||
#define secpolicy_sys_config(c,co) (0)
|
||||
#define secpolicy_zfs(c) (0)
|
||||
#define secpolicy_zinject(c) (0)
|
||||
|
||||
#endif /* WANT_KERNEL_EMUL */
|
||||
|
||||
#endif /* _PORT_SYS_POLICY_H */
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include_next <sys/socket.h>
|
||||
|
||||
#ifndef _PORT_SYS_SOCKET_H
|
||||
#define _PORT_SYS_SOCKET_H
|
||||
|
||||
/* Solaris doesn't have MSG_NOSIGNAL */
|
||||
#ifndef MSG_NOSIGNAL
|
||||
#define MSG_NOSIGNAL 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef _PORT_SYS_SWAP_H
|
||||
#define _PORT_SYS_SWAP_H
|
||||
|
||||
typedef int swaptbl_t;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifdef HAVE_SYS_SYSTEMINFO_H
|
||||
#include_next <sys/systeminfo.h>
|
||||
#endif
|
||||
|
||||
#ifndef _PORT_SYS_SYSTEMINFO_H
|
||||
#define _PORT_SYS_SYSTEMINFO_H
|
||||
|
||||
#ifndef HAVE_SYSINFO_IN_SYSTEMINFO_H
|
||||
#define sysinfo(cmd,buf,cnt) (-1)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef _PORT_SYS_SYSTM_H
|
||||
#define _PORT_SYS_SYSTM_H
|
||||
|
||||
#ifdef WANT_KERNEL_EMUL
|
||||
|
||||
#include <sys/dmu_ctl.h>
|
||||
|
||||
#define copyinstr(from,to,max,len) dctls_copyinstr(from,to,max,len)
|
||||
#define xcopyin(src,dest,size) dctls_copyin(src,dest,size)
|
||||
#define xcopyout(src,dest,size) dctls_copyout(src,dest,size)
|
||||
|
||||
#endif /* WANT_KERNEL_EMUL */
|
||||
|
||||
#endif /* _PORT_SYS_SYSM_H */
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include_next <sys/time.h>
|
||||
|
||||
#ifndef NANOSEC
|
||||
#define NANOSEC 1000000000
|
||||
#endif
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include_next <sys/types.h>
|
||||
|
||||
#ifndef _PORT_SYS_TYPES_H
|
||||
#define _PORT_SYS_TYPES_H
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifndef HAVE_INTTYPES
|
||||
#include <inttypes.h>
|
||||
|
||||
typedef enum boolean { B_FALSE, B_TRUE } boolean_t;
|
||||
|
||||
typedef unsigned char uchar_t;
|
||||
typedef unsigned short ushort_t;
|
||||
typedef unsigned int uint_t;
|
||||
typedef unsigned long ulong_t;
|
||||
|
||||
typedef long long longlong_t;
|
||||
typedef unsigned long long u_longlong_t;
|
||||
|
||||
#endif /* HAVE_INTTYPES */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifdef HAVE_UNICODE
|
||||
#include_next <sys/u8_textprep.h>
|
||||
#else
|
||||
|
||||
#ifndef _SYS_U8_TEXTPREP_H
|
||||
#define _SYS_U8_TEXTPREP_H
|
||||
|
||||
#include <sys/isa_defs.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Unicode encoding conversion functions and their macros.
|
||||
*/
|
||||
#define UCONV_IN_BIG_ENDIAN 0x0001
|
||||
#define UCONV_OUT_BIG_ENDIAN 0x0002
|
||||
#define UCONV_IN_SYSTEM_ENDIAN 0x0004
|
||||
#define UCONV_OUT_SYSTEM_ENDIAN 0x0008
|
||||
#define UCONV_IN_LITTLE_ENDIAN 0x0010
|
||||
#define UCONV_OUT_LITTLE_ENDIAN 0x0020
|
||||
#define UCONV_IGNORE_NULL 0x0040
|
||||
#define UCONV_IN_ACCEPT_BOM 0x0080
|
||||
#define UCONV_OUT_EMIT_BOM 0x0100
|
||||
|
||||
extern int uconv_u16tou32(const uint16_t *, size_t *, uint32_t *, size_t *,
|
||||
int);
|
||||
extern int uconv_u16tou8(const uint16_t *, size_t *, uchar_t *, size_t *, int);
|
||||
extern int uconv_u32tou16(const uint32_t *, size_t *, uint16_t *, size_t *,
|
||||
int);
|
||||
extern int uconv_u32tou8(const uint32_t *, size_t *, uchar_t *, size_t *, int);
|
||||
extern int uconv_u8tou16(const uchar_t *, size_t *, uint16_t *, size_t *, int);
|
||||
extern int uconv_u8tou32(const uchar_t *, size_t *, uint32_t *, size_t *, int);
|
||||
|
||||
/*
|
||||
* UTF-8 text preparation functions and their macros.
|
||||
*
|
||||
* Among the macros defined, U8_CANON_DECOMP, U8_COMPAT_DECOMP, and
|
||||
* U8_CANON_COMP are not public interfaces and must not be used directly
|
||||
* at the flag input argument.
|
||||
*/
|
||||
#define U8_STRCMP_CS (0x00000001)
|
||||
#define U8_STRCMP_CI_UPPER (0x00000002)
|
||||
#define U8_STRCMP_CI_LOWER (0x00000004)
|
||||
|
||||
#define U8_CANON_DECOMP (0x00000010)
|
||||
#define U8_COMPAT_DECOMP (0x00000020)
|
||||
#define U8_CANON_COMP (0x00000040)
|
||||
|
||||
#define U8_STRCMP_NFD (U8_CANON_DECOMP)
|
||||
#define U8_STRCMP_NFC (U8_CANON_DECOMP | U8_CANON_COMP)
|
||||
#define U8_STRCMP_NFKD (U8_COMPAT_DECOMP)
|
||||
#define U8_STRCMP_NFKC (U8_COMPAT_DECOMP | U8_CANON_COMP)
|
||||
|
||||
#define U8_TEXTPREP_TOUPPER (U8_STRCMP_CI_UPPER)
|
||||
#define U8_TEXTPREP_TOLOWER (U8_STRCMP_CI_LOWER)
|
||||
|
||||
#define U8_TEXTPREP_NFD (U8_STRCMP_NFD)
|
||||
#define U8_TEXTPREP_NFC (U8_STRCMP_NFC)
|
||||
#define U8_TEXTPREP_NFKD (U8_STRCMP_NFKD)
|
||||
#define U8_TEXTPREP_NFKC (U8_STRCMP_NFKC)
|
||||
|
||||
#define U8_TEXTPREP_IGNORE_NULL (0x00010000)
|
||||
#define U8_TEXTPREP_IGNORE_INVALID (0x00020000)
|
||||
#define U8_TEXTPREP_NOWAIT (0x00040000)
|
||||
|
||||
#define U8_UNICODE_320 (0)
|
||||
#define U8_UNICODE_500 (1)
|
||||
#define U8_UNICODE_LATEST (U8_UNICODE_500)
|
||||
|
||||
#define U8_VALIDATE_ENTIRE (0x00100000)
|
||||
#define U8_VALIDATE_CHECK_ADDITIONAL (0x00200000)
|
||||
#define U8_VALIDATE_UCS2_RANGE (0x00400000)
|
||||
|
||||
#define U8_ILLEGAL_CHAR (-1)
|
||||
#define U8_OUT_OF_RANGE_CHAR (-2)
|
||||
|
||||
extern int u8_validate(char *, size_t, char **, int, int *);
|
||||
extern int u8_strcmp(const char *, const char *, size_t, int, size_t, int *);
|
||||
extern size_t u8_textprep_str(char *, size_t *, char *, size_t *, int, size_t,
|
||||
int *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_UNICODE */
|
||||
|
||||
#endif /* _SYS_U8_TEXTPREP_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include_next <unistd.h>
|
||||
|
||||
#ifndef _PORT_UNISTD_H
|
||||
#define _PORT_UNISTD_H
|
||||
|
||||
#include "zfs_config.h"
|
||||
|
||||
#ifndef HAVE_ISSETUGID
|
||||
#include <sys/types.h>
|
||||
#define issetugid() (geteuid() == 0 || getegid() == 0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IOCTL_IN_UNISTD_H
|
||||
#include <fake_ioctl.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__sun__) && !defined(__sun)
|
||||
/* It seems Solaris only returns positive host ids */
|
||||
static inline long fake_gethostid()
|
||||
{
|
||||
long id = gethostid();
|
||||
return id >= 0 ? id : -id;
|
||||
}
|
||||
#define gethostid() fake_gethostid()
|
||||
#endif
|
||||
|
||||
#endif /* _PORT_UNISTD_H */
|
||||
Reference in New Issue
Block a user