home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / hp / 9761 < prev    next >
Encoding:
Text File  |  1992-08-27  |  2.4 KB  |  82 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!mcsun!news.funet.fi!cc.tut.fi!tut!hannu
  3. From: hannu@ae.tut.fi (Hannu Koivisto)
  4. Subject: datalock() system call bug in HP9000/43T ?
  5. Message-ID: <HANNU.92Aug27160041@ae.ae.tut.fi>
  6. Sender: news@cc.tut.fi (USENET News System)
  7. Organization: Tampere Univ. of Technology, Finland.
  8. Distribution: comp.sys.hp
  9. Date: 27 Aug 92 16:00:41
  10. Lines: 69
  11.  
  12.  
  13.  
  14. There seems to be some problems with real-time system calls with
  15. HP9000/43T (i.e. upgraded to 68040). The appended simple program tries
  16. to lock itself into the memory using datalock() call. 
  17. Results: 
  18. 9000/43T system crash (HP-UX  B.08.00 A 9000/43T )
  19. 9000/720           OK (HP-UX  A.08.07 A 9000/720 )
  20.  
  21. The locking using plock() system call works on both platfroms.
  22. A bug in 43T ? Have anybody notice this or any other real-time
  23. specific  problems? Can this be fixed ?
  24.  
  25.  
  26. ------------------------------------------------------------------------
  27. Hannu Koivisto                      Tampere University of Technology,
  28. hannu@ae.tut.fi                   Control Engineering Laboratory
  29.                           P.O. Box 692, 33101 Tampere, FINLAND
  30.                           Telefax + 358 31 162340
  31. ------------------------------------------------------------------------
  32.  
  33.  
  34.  /* ----------- test.c   -------------------------    */
  35.  /* note: you should have RTPRIO and MLOCK privileges */
  36.  /* to run this program. compile: cc test.c -o test   */
  37.  
  38.  #include <sys/lock.h>
  39.  #include <sys/rtprio.h>
  40.  
  41.  #define MAINERR 1
  42.  #define RTPRIOVAL 50
  43.  
  44.  #define HALFMEGA 524288
  45.  #define ONEMEGA 1048576
  46.  
  47.  main(argc,argv)
  48.  int argc;
  49.  char *argv[];
  50.  {
  51.        int c[10000];
  52.        int i;
  53.        int a;
  54.  
  55.        if((i=rtprio(0,RTPRIOVAL))==-1){
  56.          perror("rtprio failed\n");
  57.          exit(MAINERR);
  58.        }
  59.        printf("rtprio OK= %d \n",i);
  60.  
  61.  
  62.        if((i=datalock(ONEMEGA,HALFMEGA))==-1){
  63.          perror("datalock failed\n");
  64.          exit(MAINERR);
  65.        }
  66.        printf("datalock= %d \n",i);
  67.  
  68.  
  69.  
  70.        printf("Succes - give letter: ");
  71.        scanf("%d",&a);
  72.       printf("a= %d \n",a);
  73.  
  74.  }
  75. --
  76. ------------------------------------------------------------------------
  77. Hannu Koivisto                      Tampere University of Technology,
  78. hannu@ae.tut.fi                   Control Engineering Laboratory
  79.                           P.O. Box 692, 33101 Tampere, FINLAND
  80.                           Telefax + 358 31 162340
  81. ------------------------------------------------------------------------
  82.