devinfo_finddev.c revision facf4a8d7b59fde89a8662b4f4c73a758e6c402c
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <thread.h>
#include <synch.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <dirent.h>
#include <regex.h>
#include <errno.h>
#include <stdarg.h>
#include <libdevinfo.h>
#include <syslog.h>
#include <assert.h>
struct finddevhdl {
int npaths;
int curpath;
char **paths;
};
int
device_exists(const char *devname)
{
int rv;
return ((rv == 0) ? 1 : 0);
}
int
{
struct finddevhdl *handle;
int n;
int rv;
char *pathlist;
char *p;
int len;
return (ENOMEM);
if (rv != 0) {
return (rv);
}
for (;;) {
return (ENOMEM);
}
if (rv == 0) {
for (n = 0, p = pathlist;
n++;
}
return (ENOMEM);
}
for (n = 0, p = pathlist;
return (ENOMEM);
}
}
return (0);
}
switch (errno) {
case EAGAIN:
break;
case ENOENT:
default:
return (errno);
}
}
/*NOTREACHED*/
}
void
{
int i;
}
}
const char *
{
}
return (path);
}