Unix.st
changeset 348 5ac1b6b43600
parent 345 cf2301210c47
child 354 f8cdd814a21c
equal deleted inserted replaced
347:0d4c08ca9da3 348:5ac1b6b43600
    20 
    20 
    21 OperatingSystem comment:'
    21 OperatingSystem comment:'
    22 COPYRIGHT (c) 1988 by Claus Gittinger
    22 COPYRIGHT (c) 1988 by Claus Gittinger
    23 	     All Rights Reserved
    23 	     All Rights Reserved
    24 
    24 
    25 $Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.34 1995-05-16 17:09:31 claus Exp $
    25 $Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.35 1995-05-18 15:10:35 claus Exp $
    26 '!
    26 '!
    27 
    27 
    28 !OperatingSystem primitiveDefinitions!
    28 !OperatingSystem primitiveDefinitions!
    29 
    29 
    30 %{
    30 %{
   154 "
   154 "
   155 !
   155 !
   156 
   156 
   157 version
   157 version
   158 "
   158 "
   159 $Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.34 1995-05-16 17:09:31 claus Exp $
   159 $Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.35 1995-05-18 15:10:35 claus Exp $
   160 "
   160 "
   161 !
   161 !
   162 
   162 
   163 documentation
   163 documentation
   164 "
   164 "
  1999 
  1999 
  2000     extern void __spyInterrupt();
  2000     extern void __spyInterrupt();
  2001 #if defined(ITIMER_VIRTUAL)
  2001 #if defined(ITIMER_VIRTUAL)
  2002     struct itimerval dt;
  2002     struct itimerval dt;
  2003 
  2003 
       
  2004 # ifndef xxxSYSV4
       
  2005 #  if defined(BSD) || defined(HAS_SIGSETMASK)
       
  2006     sigsetmask(0);
       
  2007 #  endif
       
  2008 # endif
       
  2009 
       
  2010 # ifdef SIGVTALRM
       
  2011     signal(SIGVTALRM, __spyInterrupt);
       
  2012 # else
       
  2013     signal(SIGALRM, __spyInterrupt);
       
  2014 # endif
       
  2015 
  2004     dt.it_interval.tv_sec = 0;
  2016     dt.it_interval.tv_sec = 0;
  2005     dt.it_interval.tv_usec = 0;
  2017     dt.it_interval.tv_usec = 0;
  2006     dt.it_value.tv_sec = 0;
  2018     dt.it_value.tv_sec = 0;
  2007     dt.it_value.tv_usec = 1000;   /* 1000 Hz */
  2019     dt.it_value.tv_usec = 1000;   /* 1000 Hz */
  2008     setitimer(ITIMER_VIRTUAL, &dt, 0);
  2020     setitimer(ITIMER_VIRTUAL, &dt, 0);
  2009 # ifndef xxxSYSV4
       
  2010 #  if defined(BSD) || defined(HAS_SIGSETMASK)
       
  2011     sigsetmask(0);
       
  2012 #  endif
       
  2013 # endif
       
  2014 
       
  2015 # ifdef SIGVTALRM
       
  2016     signal(SIGVTALRM, __spyInterrupt);
       
  2017 # else
       
  2018     signal(SIGALRM, __spyInterrupt);
       
  2019 # endif
       
  2020 
  2021 
  2021     RETURN (true);
  2022     RETURN (true);
  2022 #endif
  2023 #endif
  2023 %}
  2024 %}
  2024 .
  2025 .
  2053     extern void __signalTimerInterrupt();
  2054     extern void __signalTimerInterrupt();
  2054 
  2055 
  2055 #if defined(ITIMER_REAL)
  2056 #if defined(ITIMER_REAL)
  2056     struct itimerval dt;
  2057     struct itimerval dt;
  2057 
  2058 
  2058     dt.it_interval.tv_sec = 0;
       
  2059     dt.it_interval.tv_usec = 0;
       
  2060     dt.it_value.tv_sec = _intVal(millis) / 1000;
       
  2061     dt.it_value.tv_usec = (_intVal(millis) % 1000) * 1000;  
       
  2062     setitimer(ITIMER_REAL, &dt, 0);
       
  2063 # ifndef xxxSYSV4
  2059 # ifndef xxxSYSV4
  2064 #  if defined(BSD) || defined(HAS_SIGSETMASK)
  2060 #  if defined(BSD) || defined(HAS_SIGSETMASK)
  2065     sigsetmask(0);
  2061     sigsetmask(0);
  2066 #  endif
  2062 #  endif
  2067 # endif
  2063 # endif
  2068     signal(SIGALRM, __signalTimerInterrupt);
  2064     signal(SIGALRM, __signalTimerInterrupt);
       
  2065 
       
  2066     dt.it_interval.tv_sec = 0;
       
  2067     dt.it_interval.tv_usec = 0;
       
  2068     dt.it_value.tv_sec = _intVal(millis) / 1000;
       
  2069     dt.it_value.tv_usec = (_intVal(millis) % 1000) * 1000;  
       
  2070     setitimer(ITIMER_REAL, &dt, 0);
  2069     RETURN (true);
  2071     RETURN (true);
  2070 #endif
  2072 #endif
  2071 %}
  2073 %}
  2072 .
  2074 .
  2073     ^ false
  2075     ^ false