home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume4 / s5nap / ft.c next >
Encoding:
C/C++ Source or Header  |  1989-02-03  |  1.1 KB  |  59 lines

  1.  
  2. /*
  3.    Written by Jon Zeeff umix!b-tech!zeeff
  4.  
  5.    This "device driver" uses the kernel delay() call to allow calls
  6.    to nap() from user processes.  Nap() is like sleep, but with finer
  7.    resolution.
  8.  
  9.    Compile with cc -O  -c ft.c 
  10.  
  11.    Written for a Sys V.3 system, but should work on others.
  12.  
  13.    For Sys V.3:
  14.    
  15.    Make a new kernel according to the instructions and then:
  16.    mknod /dev/ft c 28 0 
  17.  
  18.    modules/ft/config:
  19.        character(28)
  20.        prefix = ft 
  21.        functions = open, close, read
  22.    
  23.    Edit systems/system.std and add ft.
  24.    Copy ft.o to modules/ft/config
  25.  
  26. */
  27.  
  28. #include <sys/signal.h>
  29. #include <sys/types.h>
  30. #include <sys/sysmacros.h>
  31. #include <sys/param.h>
  32. #include <sys/systm.h>
  33. #include <sys/buf.h>
  34. #include <sys/iobuf.h>
  35. #include <sys/conf.h>
  36. #include <sys/dir.h>
  37. #include <sys/user.h>
  38. #include <sys/utsname.h>
  39. #include <sys/elog.h>
  40. #include <sys/errno.h>
  41. #include <sys/trap.h>
  42. #include <sys/seg.h>
  43. #include <sys/map.h>
  44.  
  45. /* use a raw device interface */
  46.  
  47. ftopen() {}
  48.  
  49. ftread(dev)
  50. int dev;
  51. {
  52. delay(u.u_count);
  53. u.u_count = 0;
  54. }
  55.  
  56. ftwrite() {}
  57. ftclose() {}
  58.  
  59.