/*
* 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
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "ses_impl.h"
static void
{
}
abort();
_exit(1);
}
/*PRINTFLIKE1*/
void
{
}
int
{
/*NOTREACHED*/
return (0);
}
int
{
}
/*
* Like fixed_string, but clears any leading or trailing spaces.
*/
int
{
buf++;
len--;
}
len--;
}
ses_errno(void)
{
return (_ses_errno);
}
const char *
ses_errmsg(void)
{
if (_ses_errmsg[0] == '\0')
return (_ses_errmsg);
}
const char *
ses_nv_error_member(void)
{
if (_ses_nverr_member[0] != '\0')
return (_ses_nverr_member);
else
return (NULL);
}
static int
{
_ses_nverr_member[0] = '\0';
} else {
sizeof (_ses_nverr_member));
}
_ses_errmsg[0] = '\0';
_ses_errno = err;
return (-1);
}
int
{
}
int
{
/*
* If the error is ESES_NVL, then we should always have a member
* available. The only time 'member' is NULL is when nvlist_alloc()
* fails, which should only be possible if memory allocation fails.
*/
}
static int
{
size_t n;
char *errmsg;
(void) ses_set_errno(err);
errmsg[--n] = '\0';
return (-1);
}
static int
{
size_t n;
char *errmsg;
errmsg[--n] = '\0';
return (-1);
}
int
{
int rv;
return (rv);
}
int
{
int rv;
return (rv);
}
int
{
ses_errno_t e;
switch (se) {
case ESCSI_NONE:
return (0);
case ESCSI_NOMEM:
e = ESES_NOMEM;
break;
case ESCSI_NOTSUP:
e = ESES_NOTSUP;
break;
case ESCSI_ZERO_LENGTH:
case ESCSI_VERSION:
case ESCSI_BADFLAGS:
case ESCSI_BOGUSFLAGS:
case ESCSI_BADLENGTH:
case ESCSI_NEEDBUF:
break;
case ESCSI_UNKNOWN:
e = ESES_UNKNOWN;
break;
default:
e = ESES_LIBSCSI;
break;
}
}
int
{
return (ses_error(ESES_LIBSCSI,
"%s: SCSI status %d (no sense data available)", errmsg,
"(%s) additional sense code 0x%llx/0x%llx (%s)", errmsg,
}
void *
{
void *p;
if (sz == 0)
ses_panic("attempted zero-length allocation");
(void) ses_set_errno(ESES_NOMEM);
return (p);
}
void *
{
void *p;
return (p);
}
char *
ses_strdup(const char *s)
{
char *p;
if (s == NULL)
ses_panic("attempted zero-length allocation");
return (p);
}
void *
{
if (sz == 0)
ses_panic("attempted zero-length allocation");
(void) ses_set_errno(ESES_NOMEM);
return (p);
}
/*ARGSUSED*/
void
ses_free(void *p)
{
free(p);
}