diff options
author | Joerg Wunsch <joerg@FreeBSD.org> | 1995-07-27 09:45:28 +0000 |
---|---|---|
committer | Joerg Wunsch <joerg@FreeBSD.org> | 1995-07-27 09:45:28 +0000 |
commit | f4734ea953e1c4b7dd2b32393df82efac49730c0 (patch) | |
tree | c4ac1fb31564136e84366d486dc1110e394a3cbb /share/examples/lkm/misc/test | |
parent | b124e4f2845952c15899e2305d0879d1293b847d (diff) |
Make this bugger actually compile and work again:
o a couple of header files have been missing
o convert the LKM Makefile to use <bsd.kmod.mk>
o rename the module to ``misc_mod'' (as opposed to ``miscmod''), so
the module name can be made identical to the module's file name,
avoiding the clash with one of the component's .o file names
o modstat(1/8) has been moved meanwhile
Notes
Notes:
svn path=/head/; revision=9732
Diffstat (limited to 'share/examples/lkm/misc/test')
-rw-r--r-- | share/examples/lkm/misc/test/Makefile | 9 | ||||
-rw-r--r-- | share/examples/lkm/misc/test/testmisc.c | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/share/examples/lkm/misc/test/Makefile b/share/examples/lkm/misc/test/Makefile index 466e4ac19021..61bbf372708b 100644 --- a/share/examples/lkm/misc/test/Makefile +++ b/share/examples/lkm/misc/test/Makefile @@ -34,10 +34,13 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # - +# $Id$ +# PROG= testmisc NOMAN= +MODSTAT= /usr/bin/modstat + load: @echo "This test program will call the sample system call;" @echo "the "offset requested will be shown as 'Off' in the" @@ -48,7 +51,7 @@ load: @echo "system console each time it is run." @echo @echo - /sbin/modstat -n miscmod + ${MODSTAT} -n misc_mod @echo @./testmisc @@ -57,7 +60,7 @@ unload: @echo "has been successfully unloaded by building 'unload' in" @echo "the 'module' subdirectory." @echo - /sbin/modstat -n miscmod + ${MODSTAT} -n misc_mod .include <bsd.prog.mk> diff --git a/share/examples/lkm/misc/test/testmisc.c b/share/examples/lkm/misc/test/testmisc.c index 622857d0ca52..83f333817fc0 100644 --- a/share/examples/lkm/misc/test/testmisc.c +++ b/share/examples/lkm/misc/test/testmisc.c @@ -46,12 +46,13 @@ main() int err = 0; printf( "Table offset as reported by modstat: "); - if( gets( buf) == NULL) { + fflush( stdout); + if( fgets( buf, 80, stdin) == NULL) { printf( "[ABORT]\n"); exit( 1); } - if( err = syscall( atoi( buf) /* no arguments*/)) + if(( err = syscall( atoi( buf) /* no arguments*/))) perror( "syscall"); exit( err); |