Changeset fec3bde in git for Singular/ssiLink.cc


Ignore:
Timestamp:
Mar 17, 2011, 1:41:54 PM (12 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
2815e8ac192a591e3d2618c320e12f21d3e7a2cd
Parents:
fbb23ba606a10b85b9967f56b46d70c6ed807282
Message:
check for pselect and alternative to pselect

git-svn-id: file:///usr/local/Singular/svn/trunk@14006 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/ssiLink.cc

    rfbb23b rfec3bde  
    12201220
    12211221  /* timeout */
     1222  #ifdef HAVE_PSELECT
    12221223  struct timespec wt;
     1224  struct timespec *wt_ptr=&wt;
     1225  #else
     1226  struct timeval wt;
     1227  struct timeval *wt_ptr=&wt;
     1228  #endif
    12231229  int startingtime = getRTimer()/TIMER_RESOLUTION;  // in seconds
    1224   struct timespec *wt_ptr=&wt;
    12251230  if (timeout== -1)
    12261231  {
     
    12301235  {
    12311236    wt.tv_sec  = timeout / 1000000;
     1237  #ifdef HAVE_PSELECT
    12321238    wt.tv_nsec = 1000 * (timeout % 1000000);
     1239  #else
     1240    wt.tv_usec = timeout % 1000000;
     1241  #endif
    12331242  }
    12341243
     
    13041313
    13051314  /* check with select: chars waiting: no -> not ready */
     1315  #ifdef HAVE_PSELECT
    13061316  s = pselect(max_fd, &mask, NULL, NULL, wt_ptr, &sigmask);
     1317  #else
     1318   sigset_t origsigmask;
     1319
     1320   sigprocmask(SIG_SETMASK, &sigmask, &origsigmask);
     1321   s = select(max_fd, &mask, NULL, NULL, wt_ptr);
     1322   sigprocmask(SIG_SETMASK, &origsigmask, NULL);
     1323   #endif
     1324
    13071325  if (s==-1)
    13081326  {
     
    13741392               timeout - 1000000*(getRTimer()/TIMER_RESOLUTION - startingtime));
    13751393          wt.tv_sec  = timeout / 1000000;
     1394          #ifdef HAVE_PSELECT
    13761395          wt.tv_nsec = 1000 * (timeout % 1000000);
     1396          #else
     1397          wt.tv_usec = (timeout % 1000000);
     1398          #endif
    13771399        }
    13781400        goto do_select;
Note: See TracChangeset for help on using the changeset viewer.