/***************************************************************************
*
* osspec.c : Solaris HAL backend entry points
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Licensed under the Academic Free License version 2.1
*
**************************************************************************/
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <unistd.h>
#include <strings.h>
#include <port.h>
#include <fcntl.h>
#include "../osspec.h"
#include "../logger.h"
#include "../hald.h"
#include "../hald_dbus.h"
#include "../device_info.h"
#include "../util.h"
#include "../ids.h"
#include "osspec_solaris.h"
#include "hotplug.h"
#include "sysevent.h"
#include "devinfo.h"
#include "devinfo_storage.h"
static void mnttab_event_init ();
void
osspec_init (void)
{
ids_init ();
sysevent_init ();
}
void
hotplug_queue_now_empty (void)
{
if (hald_is_initialising) {
}
}
void
osspec_probe (void)
{
/* add entire device tree */
/* start processing events */
}
{
return (devinfo_device_rescan (d));
}
{
return FALSE;
}
{
}
/** Find the closest ancestor by looking at devfs paths
*
* @param devfs_path Path into devfs, e.g. /pci@0,0/pci1025,57@10,2/storage@1
* @return Parent Hal Device Object or #NULL if there is none
*/
hal_util_find_closest_ancestor (const gchar *devfs_path, gchar **ancestor_devfs_path, gchar **hotplug_devfs_path)
{
gchar c;
do {
char *p;
if (p == NULL)
break;
c = *p;
*p = '\0';
"solaris.devfs_path",
buf);
if (ancestor_devfs_path != NULL) {
}
if (hotplug_devfs_path != NULL) {
*p = c;
}
break;
}
} while (TRUE);
return parent;
}
char *
{
char *p;
char *rdsk;
return (strdup(""));
}
}
}
if (p == NULL) {
return (strdup(""));
}
}
return (rdsk);
}
/*
* Setup to watch mnttab changes
*
* When mnttab changes, POLLRDBAND is set. However, glib does not
* support POLLRDBAND, so we use Solaris ports (see port_create(3C))
* to "map" POLLRDBAND to POLLIN:
*
* - create a port
* - associate the port with mnttab file descriptor and POLLRDBAND
* - now polling for POLLIN on the port descriptor will unblock when
* the associated file descriptor receives POLLRDBAND
*/
static int mnttab_fd;
static int mnttab_port;
static void
{
return;
}
if ((mnttab_port = port_create ()) < 0) {
return;
}
NULL) != 0) {
(void) close (mnttab_port);
return;
}
/* suppress initial event */
}
static gboolean
{
/* if (cond & ~G_IO_ERR)
return TRUE;
*/
HAL_INFO (("mnttab event"));
/* we have to re-associate port with fd every time */
if (!hald_is_initialising) {
}
return TRUE;
}
void
{
}