rem_drv.c revision f4da9be01648d6afa604495d9b9956dddeb92a8c
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <libintl.h>
#include <string.h>
#include <fcntl.h>
#include <limits.h>
#include <malloc.h>
#include <locale.h>
#include <ftw.h>
#include "addrem.h"
#include "errmsg.h"
static void usage(void);
int
{
int opt;
int server = 0, mod_unloaded = 0;
int err;
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
#endif
(void) textdomain(TEXT_DOMAIN);
/* must be run by root */
if (getuid() != 0) {
exit(1);
}
switch (opt) {
case 'b' :
server = 1;
exit(1);
}
break;
case '?' :
usage();
exit(1);
}
}
if (driver_name == NULL) {
exit(1);
}
/*
* check for extra args
*/
usage();
exit(1);
}
} else {
usage();
exit(1);
}
/* set up add_drv filenames */
exit(1);
}
enter_lock();
err_exit();
err_exit();
/* look up the major number of the driver being removed. */
err_exit();
}
err_exit();
}
if (!server) {
mod_unloaded = 1;
/* get the module id for this driver */
/* module is installed */
if (modid != -1) {
mod_unloaded = 0;
}
}
/* unload driver.conf file */
}
}
}
/*
* add driver to rem_name_to_major; if this fails, don`t
* delete from name_to_major
*/
err_exit();
}
/*
* If removing the driver from the running system, notify
* kernel dynamically to remove minor perm entries.
*/
if (err != 0) {
driver_name, err);
}
}
/*
*/
/*
* Clean up any dangling devfs shadow nodes for this
* driver so that, in the event the driver is re-added
* to the system, newly created nodes won't incorrectly
* pick up these stale shadow node permissions.
*/
if (err != 0) {
driver_name, err);
}
}
exit_unlock();
return (NOERR);
}
static void
usage()
{
}