aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2002-09-29 23:00:11 +0000
committerWarner Losh <imp@FreeBSD.org>2002-09-29 23:00:11 +0000
commit0bd71bcb9b33617d8124160535c0732ee6a31e32 (patch)
tree6a12e627047bb40310921bc067af11998cfe3840 /usr.sbin
parent83431b577e980cda9b0a216788425467c6485315 (diff)
downloadsrc-0bd71bcb9b33617d8124160535c0732ee6a31e32.tar.gz
src-0bd71bcb9b33617d8124160535c0732ee6a31e32.zip
Add -x option. This causes pccardd to exit after probing the cards. This
is useful for low memory systems. PR: 36418 Submitted by: Forrest W. Christian
Notes
Notes: svn path=/head/; revision=104155
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pccard/pccardd/pccardd.89
-rw-r--r--usr.sbin/pccard/pccardd/pccardd.c7
2 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/pccard/pccardd/pccardd.8 b/usr.sbin/pccard/pccardd/pccardd.8
index 71523d4096a7..33e3a3a867d2 100644
--- a/usr.sbin/pccard/pccardd/pccardd.8
+++ b/usr.sbin/pccard/pccardd/pccardd.8
@@ -35,6 +35,7 @@
.Nm
.Op Fl d
.Op Fl v
+.Op Fl x
.Op Fl z
.Op Fl i Ar IRQ
.Op Fl I
@@ -137,6 +138,14 @@ display error messages.
.It Fl v
After reading the configuration file, print out a summary
of it.
+.It Fl x
+Exits immediately after the cards have been probed and attached.
+This is primarily useful in embedded applications where it is
+desirable to use
+.Nm
+to start PC-CARD devices but prohibitive memory-wise to leave the
+.Nm
+process running.
.It Fl z
Delays running as a daemon until after the cards have been probed and attached.
.It Fl I
diff --git a/usr.sbin/pccard/pccardd/pccardd.c b/usr.sbin/pccard/pccardd/pccardd.c
index ba703365ffbc..1b18b78505fc 100644
--- a/usr.sbin/pccard/pccardd/pccardd.c
+++ b/usr.sbin/pccard/pccardd/pccardd.c
@@ -156,12 +156,13 @@ main(int argc, char *argv[])
{
struct slot *sp;
int count, dodebug = 0;
+ int probeonly = 0;
int delay = 0;
int irq_arg[16];
int irq_specified = 0;
int i;
struct sockaddr_un sun;
-#define COM_OPTS ":Idvf:s:i:z"
+#define COM_OPTS ":Idf:i:s:vxz"
bzero(irq_arg, sizeof(irq_arg));
use_kern_irq = 1;
@@ -224,12 +225,14 @@ main(int argc, char *argv[])
if (doverbose)
dump_config_file();
log_setup();
- if (!dodebug && !delay)
+ if (!dodebug && !delay && !probeonly)
if (daemon(0, 0))
die("fork failed");
slots = readslots();
if (slots == 0)
die("no PC-CARD slots");
+ if (probeonly)
+ exit(0);
if (delay)
if (daemon(0, 0))
die("fork failed");