svn commit: r40171 - head/en_US.ISO8859-1/books/arch-handbook/driverbasics
Eitan Adler
eadler at FreeBSD.org
Tue Nov 27 19:34:46 UTC 2012
Author: eadler
Date: Tue Nov 27 19:34:45 2012
New Revision: 40171
URL: http://svnweb.freebsd.org/changeset/doc/40171
Log:
Minor tweaks to the example code that I had forgotten to migrate
from code to documentation.
Submitted by: gonzo
Approved by: bcr (mentor)
Modified:
head/en_US.ISO8859-1/books/arch-handbook/driverbasics/chapter.xml
Modified: head/en_US.ISO8859-1/books/arch-handbook/driverbasics/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/arch-handbook/driverbasics/chapter.xml Tue Nov 27 18:32:37 2012 (r40170)
+++ head/en_US.ISO8859-1/books/arch-handbook/driverbasics/chapter.xml Tue Nov 27 19:34:45 2012 (r40171)
@@ -307,7 +307,7 @@ static int
echo_close(struct cdev *dev __unused, int fflag __unused, int devtype __unused, struct thread *p __unused)
{
- uprintf("Closing device \"echo.\"\n");
+ uprintf("Closing device \"echo\".\n");
return (0);
}
@@ -347,6 +347,10 @@ echo_write(struct cdev *dev __unused, st
/* Copy the string in from user memory to kernel memory */
+ /*
+ * We either write from the beginning or are appending - do
+ * not allow ranom access.
+ */
if (uio-<uio_offset != 0 && (uio-<uio_offset != echomsg-<len))
return (EINVAL);
@@ -369,7 +373,6 @@ echo_write(struct cdev *dev __unused, st
echomsg-<len += amt + 1;
uio-<uio_offset += amt + 1;
echomsg-<msg[echomsg-<len - 1] = 0;
- //echomsg-<msg[BUFFERSIZE - 1] = '\n';
if (error != 0)
uprintf("Write failed: bad address!\n");
@@ -386,7 +389,7 @@ DEV_MODULE(echo,echo_loader,NULL);</prog
&prompt.root; <userinput>cat /dev/echo</userinput>
Opened device "echo" successfully.
Test Data
-Closing device "echo."</screen>
+Closing device "echo".</screen>
<para>Real hardware devices are described in the next chapter.</para>
</sect1>
More information about the svn-doc-all
mailing list