Sophie

Sophie

distrib > CentOS > 6 > i386 > by-pkgid > cf93d8a8acdcc6fe2225039da0502495 > files > 3786

kernel-doc-2.6.32-131.17.1.el6.centos.plus.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>/proc/bus/usb/devices</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="The Linux-USB Host Side API" /><link rel="up" href="ch07.html" title="Chapter&#160;7.&#160;The USB Filesystem (usbfs)" /><link rel="prev" href="ch07s02.html" title="Mounting and Access Control" /><link rel="next" href="ch07s04.html" title="/proc/bus/usb/BBB/DDD" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">/proc/bus/usb/devices</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch07s02.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;7.&#160;The USB Filesystem (usbfs)</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch07s04.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="/proc/bus/usb/devices"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="usbfs-devices"></a>/proc/bus/usb/devices</h2></div></div></div><p>This file is handy for status viewing tools in user
	    mode, which can scan the text format and ignore most of it.
	    More detailed device status (including class and vendor
	    status) is available from device-specific files.
	    For information about the current format of this file,
	    see the
	    <code class="filename">Documentation/usb/proc_usb_info.txt</code>
	    file in your Linux kernel sources.
	    </p><p>This file, in combination with the poll() system call, can
	    also be used to detect when devices are added or removed:
</p><pre class="programlisting">int fd;
struct pollfd pfd;

fd = open("/proc/bus/usb/devices", O_RDONLY);
pfd = { fd, POLLIN, 0 };
for (;;) {
	/* The first time through, this call will return immediately. */
	poll(&amp;pfd, 1, -1);

	/* To see what's changed, compare the file's previous and current
	   contents or scan the filesystem.  (Scanning is more precise.) */
}</pre><p>
	    Note that this behavior is intended to be used for informational
	    and debug purposes.  It would be more appropriate to use programs
	    such as udev or HAL to initialize a device or start a user-mode
	    helper program, for instance.
	    </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch07s02.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch07.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch07s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Mounting and Access Control&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;/proc/bus/usb/BBB/DDD</td></tr></table></div></body></html>