Changeset 55cb6b in git


Ignore:
Timestamp:
Apr 10, 2013, 4:04:09 PM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '48f1dd268d0ff74ef2f7dccbf02545425002ddcc')
Children:
ccae2f26143f71606cceb669458d60a2c39c4654
Parents:
c60380d927be780ce0fe437b14c03e70f0df8f5984299e1e1d2b92c5e28fc52391cc529f8eb8ade7
Message:
Merge pull request #317 from mmklee/factory_flint_built

fix: include problems when compiling without NTL but with FLINT
Files:
3 added
20 edited

Legend:

Unmodified
Added
Removed
  • Singular/Makefile.am

    r84299e r55cb6b  
    147147   links/ssiLink.h \
    148148   links/simpleipc.h \
     149   si_signals.h \
    149150   stype.h \
    150151   subexpr.h \
  • Singular/cntrlc.cc

    r84299e r55cb6b  
    2626#include <kernel/febase.h>
    2727void sig_chld_hdl(int sig); /*#include <Singular/links/ssiLink.h>*/
     28//#include <Singular/feOpt.h>
     29//#include <Singular/version.h>
     30//#include <Singular/silink.h>
     31//#include <Singular/ssiLink.h>
     32#include <Singular/si_signals.h>
    2833
    2934#include "tok.h"
     
    138143     fprintf(stderr, "Unable to init signal %d ... exiting...\n", sig);
    139144  }
    140 #ifdef HAVE_SIGINTERRUPT
    141   siginterrupt(sig, 0);
     145  si_siginterrupt(sig, 0);
    142146  /*system calls will be restarted if interrupted by  the  specified
    143147   * signal sig.  This is the default behavior in Linux.
    144148   */
    145 #endif
    146149#else
    147150  struct sigaction new_action,old_action;
     
    154157    new_action.sa_flags = SA_RESTART;
    155158
    156   int r=sigaction (sig, &new_action, &old_action);
     159  int r=si_sigaction (sig, &new_action, &old_action);
    157160  si_hdl_typ retval=(si_hdl_typ)old_action.sa_handler;
    158161  if (r == -1)
     
    498501  if (pid == 0)
    499502  {
    500     close (0); dup2 (in_fd[0],0);   /* set the stdin to the in pipe */
    501     close (1); dup2 (out_fd[1],1);  /* set the stdout to the out pipe */
    502     close (2); dup2 (out_fd[1],2);  /* set the stderr to the out pipe */
     503    si_close (0); si_dup2 (in_fd[0],0);   /* set the stdin to the in pipe */
     504    si_close (1); si_dup2 (out_fd[1],1);  /* set the stdout to the out pipe */
     505    si_close (2); si_dup2 (out_fd[1],2);  /* set the stderr to the out pipe */
    503506
    504507    execvp (args[0], args);      /* exec gdb */
     
    515518  FD_SET (out_fd[0], &fdset);
    516519
    517   write (in_fd[1], "backtrace\n", 10);
    518   write (in_fd[1], "p si_stop_stack_trace_x = 0\n", 28);
    519   write (in_fd[1], "quit\n", 5);
     520  si_write (in_fd[1], "backtrace\n", 10);
     521  si_write (in_fd[1], "p si_stop_stack_trace_x = 0\n", 28);
     522  si_write (in_fd[1], "quit\n", 5);
    520523
    521524  index = 0;
     
    528531    tv.tv_usec = 0;
    529532
    530     sel = select (FD_SETSIZE, &readset, NULL, NULL, &tv);
     533    sel = si_select (FD_SETSIZE, &readset, NULL, NULL, &tv);
    531534    if (sel == -1)
    532535      break;
     
    534537    if ((sel > 0) && (FD_ISSET (out_fd[0], &readset)))
    535538    {
    536       if (read (out_fd[0], &c, 1))
     539      if (si_read (out_fd[0], &c, 1))
    537540      {
    538541        switch (state)
     
    565568  }
    566569
    567   close (in_fd[0]);
    568   close (in_fd[1]);
    569   close (out_fd[0]);
    570   close (out_fd[1]);
     570  si_close (in_fd[0]);
     571  si_close (in_fd[1]);
     572  si_close (out_fd[0]);
     573  si_close (out_fd[1]);
    571574  m2_end(0);
    572575}
  • Singular/fehelp.cc

    r84299e r55cb6b  
    2323
    2424#include <findexec/omFindExec.h>
     25
     26#include <Singular/si_signals.h>
    2527
    2628#include "ipid.h"
     
    510512        hentry->url[i] = '\0';
    511513
    512         if (fscanf(fd, "%ld\n", &(hentry->chksum)) != 1)
     514        if (si_fscanf(fd, "%ld\n", &(hentry->chksum)) != 1)
    513515        {
    514516          hentry->chksum = -1;
     
    638640  if (fd == NULL) return 0;
    639641  memset(index_key,0,MAX_HE_ENTRY_LENGTH);
    640   while (fscanf(fd, "%[^\t]\t%*[^\n]\n", index_key) == 1)
     642  while (si_fscanf(fd, "%[^\t]\t%*[^\n]\n", index_key) == 1)
    641643  {
    642644    if ((index_key[MAX_HE_ENTRY_LENGTH-1]!='\0'))
     
    12201222  {
    12211223    // char* dummy=fgets(buffer, BUF_LEN, index); /* */
    1222     (void)sscanf(buffer, "Node:%[^\177]\177%ld\n", Index, &offset);
     1224    (void)si_sscanf(buffer, "Node:%[^\177]\177%ld\n", Index, &offset);
    12231225    for(p=Index; *p; p++) *p = tolow(*p);/* */
    12241226    (void)strcat(Index, " ");
  • Singular/fereadl.c

    r84299e r55cb6b  
    195195      #endif
    196196      /* OB: why this ? HS: char t_buf[128] does not work with glibc2 systems */
    197       char *t_buf=(char *)omAlloc(128); 
     197      char *t_buf=(char *)omAlloc(128);
    198198      /*char t_buf[128];*/
    199199      char *temp;
     
    325325    /* check for CSI */
    326326    c='\0';
    327     read (STDIN_FILENO, &c, 1);
     327    while((-1 == read (STDIN_FILENO, &c, 1)) && (errno == EINTR));
    328328    if (c == '[')
    329329    {
    330330      /* get command character */
    331331      c='\0';
    332       read (STDIN_FILENO, &c, 1);
     332      while((-1 == read (STDIN_FILENO, &c, 1)) && (errno == EINTR));
    333333      switch (c)
    334334      {
     
    415415          tv.tv_sec = 0;
    416416          tv.tv_usec = 0;
    417           #ifdef hpux
    418             sel = select (STDIN_FILENO+1, (int *)fdset.fds_bits, NULL, NULL, &tv);
    419           #else
    420             sel = select (STDIN_FILENO+1, &fdset, NULL, NULL, &tv);
    421           #endif
     417          do
     418          {
     419            sel = select (STDIN_FILENO+1,
     420#ifdef hpux
     421                          (int *)fdset.fds_bits,
     422#else
     423                          &fdset,
     424#endif
     425                          NULL, NULL, &tv);
     426          } while( (sel == -1) && (errno == EINTR) );
    422427          if (sel==0)
    423428            fe_temp_reset();
     
    770775    if (fe_rl_hdl==NULL) { return 1;}
    771776
    772     fe_filename_completion_function= 
     777    fe_filename_completion_function=
    773778      dynl_sym(fe_rl_hdl, "filename_completion_function");
    774779    if (fe_filename_completion_function==NULL) { res=3; break; }
     
    825830extern int history_total_bytes();
    826831extern int write_history (const char *);
    827 #endif   
     832#endif
    828833void fe_reset_input_mode ()
    829834{
  • Singular/iparith.cc

    r84299e r55cb6b  
    7979
    8080#include <polys/coeffrings.h>
     81#include <Singular/si_signals.h>
    8182
    8283lists rDecompose(const ring r);
     
    76517652    if (i_s > 0)
    76527653    {
    7653       sleep((is - 1)/1000000 + 1);
     7654      si_sleep((is - 1)/1000000 + 1);
    76547655      jjSTATUS3(res, v, v->next, v->next->next);
    76557656    }
  • Singular/links/ndbm.cc

    r84299e r55cb6b  
    1515
    1616#include "config.h"
     17#include <Singular/si_signals.h>
    1718#include <kernel/mod2.h>
    1819#ifdef HAVE_DBM
     
    8687  strcpy(db->dbm_pagbuf, file);
    8788  strcat(db->dbm_pagbuf, ".pag");
    88   db->dbm_pagf = open(db->dbm_pagbuf, flags, mode);
     89  db->dbm_pagf = si_open(db->dbm_pagbuf, flags, mode);
    8990  if (db->dbm_pagf < 0)
    9091    goto bad;
    9192  strcpy(db->dbm_pagbuf, file);
    9293  strcat(db->dbm_pagbuf, ".dir");
    93   db->dbm_dirf = open(db->dbm_pagbuf, flags, mode);
     94  db->dbm_dirf = si_open(db->dbm_pagbuf, flags, mode);
    9495  if (db->dbm_dirf < 0)
    9596    goto bad1;
     
    99100  return (db);
    100101bad1:
    101   (void) close(db->dbm_pagf);
     102  (void) si_close(db->dbm_pagf);
    102103bad:
    103104  free((char *)db);
     
    107108void dbm_close(DBM *db)
    108109{
    109   (void) close(db->dbm_dirf);
    110   (void) close(db->dbm_pagf);
     110  (void) si_close(db->dbm_dirf);
     111  (void) si_close(db->dbm_pagf);
    111112  free((char *)db);
    112113}
     
    166167  db->dbm_pagbno = db->dbm_blkno;
    167168  (void) lseek(db->dbm_pagf, db->dbm_blkno*PBLKSIZ, L_SET);
    168   if (write(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ)
     169  if (si_write(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ)
    169170  {
    170171  err:
     
    206207  db->dbm_pagbno = db->dbm_blkno;
    207208  (void) lseek(db->dbm_pagf, db->dbm_blkno*PBLKSIZ, L_SET);
    208   if ( (ret=write(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ)) != PBLKSIZ)
     209  if ( (ret=si_write(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ)) != PBLKSIZ)
    209210  {
    210211    db->dbm_flags |= _DBM_IOERR;
     
    245246  db->dbm_pagbno = db->dbm_blkno;
    246247  (void) lseek(db->dbm_pagf, db->dbm_blkno*PBLKSIZ, L_SET);
    247   if (write(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ)
     248  if (si_write(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ)
    248249  {
    249250    db->dbm_flags |= _DBM_IOERR;
     
    251252  }
    252253  (void) lseek(db->dbm_pagf, (db->dbm_blkno+db->dbm_hmask+1)*PBLKSIZ, L_SET);
    253   if (write(db->dbm_pagf, ovfbuf, PBLKSIZ) != PBLKSIZ)
     254  if (si_write(db->dbm_pagf, ovfbuf, PBLKSIZ) != PBLKSIZ)
    254255  {
    255256    db->dbm_flags |= _DBM_IOERR;
     
    284285      db->dbm_pagbno = db->dbm_blkptr;
    285286      (void) lseek(db->dbm_pagf, db->dbm_blkptr*PBLKSIZ, L_SET);
    286       if (read(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ)
     287      if (si_read(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ)
    287288        memset(db->dbm_pagbuf, 0, PBLKSIZ);
    288289#ifdef DEBUG
     
    323324    db->dbm_pagbno = db->dbm_blkno;
    324325    (void) lseek(db->dbm_pagf, db->dbm_blkno*PBLKSIZ, L_SET);
    325     if (read(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ)
     326    if (si_read(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ)
    326327      memset(db->dbm_pagbuf, 0, PBLKSIZ);
    327328#ifdef DEBUG
     
    348349    db->dbm_dirbno = b;
    349350    (void) lseek(db->dbm_dirf, (long)b*DBLKSIZ, L_SET);
    350     if (read(db->dbm_dirf, db->dbm_dirbuf, DBLKSIZ) != DBLKSIZ)
     351    if (si_read(db->dbm_dirf, db->dbm_dirbuf, DBLKSIZ) != DBLKSIZ)
    351352      memset(db->dbm_dirbuf, 0, DBLKSIZ);
    352353  }
     
    369370    db->dbm_dirbno = b;
    370371    (void) lseek(db->dbm_dirf, (long)b*DBLKSIZ, L_SET);
    371     if (read(db->dbm_dirf, db->dbm_dirbuf, DBLKSIZ) != DBLKSIZ)
     372    if (si_read(db->dbm_dirf, db->dbm_dirbuf, DBLKSIZ) != DBLKSIZ)
    372373      memset(db->dbm_dirbuf, 0, DBLKSIZ);
    373374  }
     
    375376  db->dbm_dirbno = b;
    376377  (void) lseek(db->dbm_dirf, (long)b*DBLKSIZ, L_SET);
    377   if (write(db->dbm_dirf, db->dbm_dirbuf, DBLKSIZ) != DBLKSIZ)
     378  if (si_write(db->dbm_dirf, db->dbm_dirbuf, DBLKSIZ) != DBLKSIZ)
    378379    db->dbm_flags |= _DBM_IOERR;
    379380}
  • Singular/links/pipeLink.cc

    r84299e r55cb6b  
    2727#include "lists.h"
    2828#include "pipeLink.h"
     29#include <Singular/si_signals.h>
    2930
    3031typedef struct
     
    5354  {
    5455    /* close unnecessary pipe descriptors for a clean environment */
    55     close(pc[1]); close(cp[0]);
     56    si_close(pc[1]); si_close(cp[0]);
    5657    /* dup pipe read/write to stdin/stdout */
    57     dup2( pc[0], STDIN_FILENO );
    58     dup2( cp[1], STDOUT_FILENO  );
     58    si_dup2( pc[0], STDIN_FILENO );
     59    si_dup2( cp[1], STDOUT_FILENO  );
    5960    int r=system(l->name);
    60     close(pc[0]);
    61     close(cp[1]);
     61    si_close(pc[0]);
     62    si_close(cp[1]);
    6263    exit(r);
    6364        /* never reached*/
     
    6667  {
    6768    d->pid=pid;
    68     close(pc[0]); close(cp[1]);
     69    si_close(pc[0]); si_close(cp[1]);
    6970    d->f_read=fdopen(cp[0],"r");
    7071    d->fd_read=cp[0];
     
    176177      //Print("test fd %d\n",d->fd_read);
    177178      /* check with select: chars waiting: no -> not ready */
    178       s=select(d->fd_read+1, &mask, NULL, NULL, &wt);
     179      s=si_select(d->fd_read+1, &mask, NULL, NULL, &wt);
    179180    }
    180181    switch (s)
  • Singular/links/s_buff.cc

    r84299e r55cb6b  
    1111#include <omalloc/omalloc.h>
    1212#include <Singular/links/s_buff.h>
     13#include <Singular/si_signals.h>
    1314//struct s_buff_s
    1415//{
     
    4344{
    4445  SSI_BLOCK_CHLD;
    45   int fd=open(n,O_RDONLY);
     46  int fd=si_open(n,O_RDONLY);
    4647  SSI_UNBLOCK_CHLD;
    4748  return s_open(fd);
     
    5455    SSI_BLOCK_CHLD;
    5556    omFreeSize(F->buff,S_BUFF_LEN);
    56     int r=close(F->fd);
     57    int r=si_close(F->fd);
    5758    omFreeSize(F,sizeof(*F));
    5859    F=NULL;
     
    7475    memset(F->buff,0,S_BUFF_LEN); /*debug*/
    7576    SSI_BLOCK_CHLD;
    76     int r=read(F->fd,F->buff,S_BUFF_LEN);
     77    int r=si_read(F->fd,F->buff,S_BUFF_LEN);
    7778    SSI_UNBLOCK_CHLD;
    7879    if (r<=0)
  • Singular/links/semaphore.c

    r84299e r55cb6b  
    77
    88#include <kernel/mod2.h>
     9#include <Singular/si_signals.h>
    910
    1011#ifdef HAVE_SIMPLEIPC
     
    6667{
    6768  if ((id<0) || (id >= SIPC_MAX_SEMAPHORES) || (semaphore[id]==NULL))  return -1;
    68   sem_wait(semaphore[id]);
     69  si_sem_wait(semaphore[id]);
    6970  return 1;
    7071}
     
    7374{
    7475  if ((id<0) || (id >= SIPC_MAX_SEMAPHORES) || (semaphore[id]==NULL))  return -1;
    75   return !sem_trywait(semaphore[id]);
     76  return !si_sem_trywait(semaphore[id]);
    7677}
    7778
  • Singular/links/silink.cc

    r84299e r55cb6b  
    3131#include <Singular/links/ssiLink.h>
    3232#include <Singular/links/pipeLink.h>
     33#include <Singular/si_signals.h>
    3334#include "feOpt.h"
    3435
     
    159160  {
    160161    struct stat buf;
    161     if (lstat(l->name,&buf)==0) return "yes";
     162    if (si_lstat(l->name,&buf)==0) return "yes";
    162163    else return "no";
    163164  }
  • Singular/links/ssiLink.cc

    r84299e r55cb6b  
    2525#include "config.h"
    2626#include <kernel/mod2.h>
     27#include <Singular/si_signals.h>
    2728
    2829#include <omalloc/omalloc.h>
     
    198199      {
    199200        mpz_t tmp;
    200         mpz_init_set_si(tmp,nn);
     201        mpz_init_set_si(tmp,nn);
    201202        fputs("8 ",d->f_write);
    202203        mpz_out_str (d->f_write,32, tmp);
    203204        fputc(' ',d->f_write);
    204         mpz_clear(tmp);
     205        mpz_clear(tmp);
    205206      }
    206207      #endif
     
    490491         mpz_init(((number_dummy)n)->z);
    491492         mpz_init(((number_dummy)n)->n);
    492         s_readmpz_base (d->f_read,((number_dummy)n)->z, 32);
    493         s_readmpz_base (d->f_read,((number_dummy)n)->n, 32);
     493        s_readmpz_base (d->f_read,((number_dummy)n)->z, 32);
     494        s_readmpz_base (d->f_read,((number_dummy)n)->n, 32);
    494495         ((number_dummy)n)->s=sub_type-5;
    495496         return n;
     
    499500         number n=(number)omAlloc0(sizeof(snumber_dummy));
    500501         mpz_init(((number_dummy)n)->z);
    501         s_readmpz_base (d->f_read,((number_dummy)n)->z, 32);
     502        s_readmpz_base (d->f_read,((number_dummy)n)->z, 32);
    502503         ((number_dummy)n)->s=sub_type=3; /*subtype-5*/
    503504         return n;
     
    832833          ssiToBeClosed->next=NULL;
    833834          SSI_BLOCK_CHLD;
    834           close(pc[1]); close(cp[0]);
     835          si_close(pc[1]); si_close(cp[0]);
    835836          d->f_write=fdopen(cp[1],"w");
    836837          SSI_UNBLOCK_CHLD;
     
    869870          d->pid=pid;
    870871          SSI_BLOCK_CHLD;
    871           close(pc[0]); close(cp[1]);
     872          si_close(pc[0]); si_close(cp[1]);
    872873          d->f_write=fdopen(pc[1],"w");
    873874          SSI_UNBLOCK_CHLD;
     
    919920        Print("waiting on port %d\n", portno);mflush();
    920921        listen(sockfd,1);
    921         newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, (socklen_t *)&clilen);
     922        newsockfd = si_accept(sockfd, (struct sockaddr *) &cli_addr, (socklen_t *)&clilen);
    922923        if(newsockfd < 0)
    923924        {
     
    933934        d->f_write = fdopen(newsockfd, "w");
    934935        SI_LINK_SET_RW_OPEN_P(l);
    935         close(sockfd);
     936        si_close(sockfd);
    936937      }
    937938      // no ssi-Link on stdin or stdout
     
    981982        char* cli_host = (char*)omAlloc(256);
    982983        char* path = (char*)omAlloc(1024);
    983         int r = sscanf(l->name,"%255[^:]:%s",cli_host,path);
     984        int r = si_sscanf(l->name,"%255[^:]:%s",cli_host,path);
    984985        if(r == 0)
    985986        {
     
    10081009        omFree(ser_host);
    10091010        clilen = sizeof(cli_addr);
    1010         newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, (socklen_t *)&clilen);
     1011        newsockfd = si_accept(sockfd, (struct sockaddr *) &cli_addr, (socklen_t *)&clilen);
    10111012        if(newsockfd < 0)
    10121013        {
     
    10221023        SSI_BLOCK_CHLD;
    10231024        d->f_write = fdopen(newsockfd, "w");
    1024         close(sockfd);
     1025        si_close(sockfd);
    10251026        SSI_UNBLOCK_CHLD;
    10261027        SI_LINK_SET_RW_OPEN_P(l);
     
    10381039        struct hostent *server;
    10391040
    1040         sscanf(l->name,"%255[^:]:%d",host,&portno);
     1041        si_sscanf(l->name,"%255[^:]:%d",host,&portno);
    10411042        //Print("connect to host %s, port %d\n",host,portno);mflush();
    10421043        if (portno!=0)
     
    10521053                server->h_length);
    10531054          serv_addr.sin_port = htons(portno);
    1054           if (connect(sockfd,(sockaddr*)&serv_addr,sizeof(serv_addr)) < 0)
     1055          if (si_connect(sockfd,(sockaddr*)&serv_addr,sizeof(serv_addr)) < 0)
    10551056          { Werror("ERROR connecting(errno=%d)",errno); return TRUE; }
    10561057          //PrintS("connected\n");mflush();
     
    11621163      if (d->r!=NULL) rKill(d->r);
    11631164      if ((d->pid!=0)
    1164       && (waitpid(d->pid,NULL,WNOHANG)==0))
     1165      && (si_waitpid(d->pid,NULL,WNOHANG)==0))
    11651166      {
    11661167        struct timespec t;
     
    11681169        t.tv_nsec=50000000; // <=50 ms
    11691170        int r=nanosleep(&t,NULL);
    1170         if((r==0) && (waitpid(d->pid,NULL,WNOHANG)==0))
     1171        if((r==0) && (si_waitpid(d->pid,NULL,WNOHANG)==0))
    11711172        {
    11721173          kill(d->pid,15);
     
    11741175          t.tv_nsec=10000000; // <=10 ms
    11751176          r=nanosleep(&t,NULL);
    1176           if((r==0)&&(waitpid(d->pid,NULL,WNOHANG)==0))
     1177          if((r==0)&&(si_waitpid(d->pid,NULL,WNOHANG)==0))
    11771178          {
    11781179            kill(d->pid,9); // just to be sure
    1179             waitpid(d->pid,NULL,0);
     1180            si_waitpid(d->pid,NULL,0);
    11801181          }
    11811182        }
     
    13001301    case 19: res->rtyp=BIGINTMAT_CMD;
    13011302             res->data=ssiReadBigintmat(d);
    1302              break;
     1303             break;
    13031304    case 20: ssiReadBlackbox(res,l);
    13041305             break;
     
    14981499      //Print("test fd %d\n",d->fd_read);
    14991500    /* check with select: chars waiting: no -> not ready */
    1500       switch (select(d->fd_read+1, &mask, NULL, NULL, &wt))
     1501      switch (si_select(d->fd_read+1, &mask, NULL, NULL, &wt))
    15011502      {
    15021503        case 0: /* not ready */ return "not ready";
     
    16691670  #endif
    16701671  #ifdef HAVE_PSELECT
    1671   s = pselect(max_fd, &mask, NULL, NULL, wt_ptr, &sigmask);
     1672  s = si_pselect(max_fd, &mask, NULL, NULL, wt_ptr, &sigmask);
    16721673  #else
    16731674  SSI_BLOCK_CHLD;
    1674   s = select(max_fd, &mask, NULL, NULL, wt_ptr);
     1675  s = si_select(max_fd, &mask, NULL, NULL, wt_ptr);
    16751676  SSI_UNBLOCK_CHLD;
    16761677  #endif
     
    18481849  struct sockaddr_in cli_addr;
    18491850  int clilen = sizeof(cli_addr);
    1850   int newsockfd = accept(ssiReserved_sockfd, (struct sockaddr *) &cli_addr, (socklen_t *)&clilen);
     1851  int newsockfd = si_accept(ssiReserved_sockfd, (struct sockaddr *) &cli_addr, (socklen_t *)&clilen);
    18511852  if(newsockfd < 0)
    18521853  {
     
    18941895  {
    18951896    ssiReserved_P=0;
    1896     close(ssiReserved_sockfd);
     1897    si_close(ssiReserved_sockfd);
    18971898  }
    18981899  return l;
     
    19191920  loop
    19201921  {
    1921     kidpid = waitpid(-1, &status, WNOHANG);
     1922    kidpid = si_waitpid(-1, &status, WNOHANG);
    19221923    if (kidpid==-1)
    19231924    {
  • Singular/misc_ip.cc

    r84299e r55cb6b  
    1515#include "config.h"
    1616#include <kernel/mod2.h>
     17#include <Singular/si_signals.h>
    1718
    1819#ifdef HAVE_FACTORY
     
    10271028int singular_fstat(int fd, struct stat *buf)
    10281029{
    1029   return fstat(fd,buf);
     1030  return si_fstat(fd,buf);
    10301031}
    10311032
  • Singular/sdb.cc

    r84299e r55cb6b  
    1717#include <Singular/ipid.h>
    1818#include <Singular/sdb.h>
     19#include <Singular/si_signals.h>
    1920
    2021#ifdef HAVE_SDB
     
    137138        PrintS("cannot get the procedure body\n");
    138139        fclose(fp);
    139         unlink(filename);
     140        si_unlink(filename);
    140141        omFree(filename);
    141142        return;
     
    149150    if (pid!=0)
    150151    {
    151       wait(&pid);
     152      si_wait(&pid);
    152153    }
    153154    else if(pid==0)
     
    189190    }
    190191  }
    191   unlink(filename);
     192  si_unlink(filename);
    192193  omFree(filename);
    193194}
  • factory/algext.cc

    rc60380d r55cb6b  
    864864        equal= true; // modular image did not add any new information
    865865      TIMING_START (alg_termination)
     866#ifdef HAVE_NTL
    866867#ifdef HAVE_FLINT
    867868      if (equal && tmp.isUnivariate() && f.isUnivariate() && g.isUnivariate()
     
    889890      }
    890891      else
     892#endif
    891893#endif
    892894      if(equal && fdivides( tmp, f ) && fdivides( tmp, g )) // trial division
  • factory/algext.h

    rc60380d r55cb6b  
    1 #ifndef ALGEXT_H
    2 #define ALGEXT_H
     1#ifndef CF_ALGEXT_H
     2#define CF_ALGEXT_H
    33
    44// #include "config.h"
  • factory/facMul.h

    rc60380d r55cb6b  
    1818#include "fac_util.h"
    1919
     20#ifdef HAVE_NTL
    2021/// multiplication of univariate polys over a finite field using NTL, if we are
    2122/// in GF factory's default multiplication is used.
     
    166167             );
    167168#endif
     169#endif
    168170
    169171#endif
  • findexec/feFopen.cc

    r84299e r55cb6b  
    55#include <sys/stat.h>
    66#include <unistd.h>
     7#include <errno.h>
    78
    89#include "config.h"
     
    9798  {
    9899    struct stat statbuf;
    99     if ((stat(path,&statbuf)==0)
     100    int res = -1;
     101    do
     102    {
     103      res = stat(path,&statbuf);
     104    } while((res < 0) and (errno == EINTR));
     105    if ((res == 0)
    100106    && (S_ISREG(statbuf.st_mode)))
    101107      f = myfopen(path,mode);
  • kernel/tgb.cc

    r84299e r55cb6b  
    14691469
    14701470#define ENLARGE(pointer, type) pointer=(type*) omrealloc(pointer, c->array_lengths*sizeof(type))
     1471
     1472#define ENLARGE_ALIGN(pointer, type) {if(pointer)\
     1473         pointer=(type*)omReallocAligned(pointer, c->array_lengths*sizeof(type));\
     1474         else pointer=(type*)omAllocAligned(c->array_lengths*sizeof(type));}
    14711475//  BOOLEAN corr=lenS_correct(c->strat);
    14721476  int sugar;
     
    14841488    assume (c->array_lengths >= c->n);
    14851489    ENLARGE (c->T_deg, int);
    1486     ENLARGE (c->tmp_pair_lm, poly);
    1487     ENLARGE (c->tmp_spn, sorted_pair_node *);
    1488 
    1489     ENLARGE (c->short_Exps, long);
     1490    ENLARGE_ALIGN (c->tmp_pair_lm, poly);
     1491    ENLARGE_ALIGN (c->tmp_spn, sorted_pair_node *);
     1492
     1493    ENLARGE_ALIGN (c->short_Exps, long);
    14901494    ENLARGE (c->lengths, int);
    14911495#ifndef HAVE_BOOST
    14921496#ifndef USE_STDVECBOOL
    14931497
    1494     ENLARGE (c->states, char *);
    1495 #endif
    1496 #endif
    1497     ENLARGE (c->gcd_of_terms, poly);
     1498    ENLARGE_ALIGN (c->states, char *);
     1499#endif
     1500#endif
     1501    ENLARGE_ALIGN (c->gcd_of_terms, poly);
    14981502    //if (c->weighted_lengths!=NULL) {
    1499     ENLARGE (c->weighted_lengths, wlen_type);
     1503    ENLARGE_ALIGN (c->weighted_lengths, wlen_type);
    15001504    //}
    1501     //ENLARGE(c->S->m,poly);
     1505    //ENLARGE_ALIGN(c->S->m,poly);
    15021506  }
    15031507  pEnlargeSet (&c->S->m, c->n - 1, 1);
     
    15501554
    15511555#undef ENLARGE
     1556#undef ENLARGE_ALIGN
    15521557  if(p_GetComp (h, currRing) <= c->syz_comp)
    15531558  {
     
    32873292  h = omalloc (n * sizeof (int));
    32883293  lengths = (int *) h;
    3289   weighted_lengths = (wlen_type *) omalloc (n * sizeof (wlen_type));
    3290   gcd_of_terms = (poly *) omalloc (n * sizeof (poly));
     3294  weighted_lengths = (wlen_type *) omAllocAligned (n * sizeof (wlen_type));
     3295  gcd_of_terms = (poly *) omAlloc (n * sizeof (poly));
    32913296
    32923297  short_Exps = (long *) omalloc (n * sizeof (long));
  • libpolys/coeffs/ffields.cc

    r84299e r55cb6b  
    2222#include <string.h>
    2323#include <math.h>
     24#include <errno.h>
    2425
    2526BOOLEAN nfGreaterZero (number k, const coeffs r);
     
    225226{
    226227  assume(i==1);
    227  
     228
    228229  if( i == 1 )
    229230    return (number)1;
     
    655656    /*this field is already set*/  return;
    656657  int i=0;
    657  
    658   while ((fftable[i]!=c) && (fftable[i]!=0)) 
     658
     659  while ((fftable[i]!=c) && (fftable[i]!=0))
    659660    i++;
    660  
     661
    661662  if (fftable[i]==0)
    662663  {
     
    693694    }
    694695    int q;
    695     sscanf(buf,"%d %d",&r->m_nfCharP,&q);
     696    int res = -1;
     697    do
     698    {
     699      res = sscanf(buf,"%d %d",&r->m_nfCharP,&q);
     700    }
     701    while((res < 0) and (errno == EINTR));
     702
    696703    nfReadMipo(buf);
    697704    r->m_nfCharQ1=r->m_nfCharQ-1;
     
    829836
    830837  const int P = n_NumberOfParameters(r);
    831  
     838
    832839  for( int i = 1; i <= P; i++ )
    833     if (p[i-1] != NULL) 
     840    if (p[i-1] != NULL)
    834841      omFree( (ADDRESS)p[i-1] );
    835  
    836   omFreeSize((ADDRESS)p, P * sizeof(char*)); 
     842
     843  omFreeSize((ADDRESS)p, P * sizeof(char*));
    837844}
    838845
     
    865872  //r->cfRePart = ndCopy;
    866873  //r->cfImPart = ndReturn0;
    867  
     874
    868875  r->cfWriteLong = nfWriteLong;
    869876  r->cfInit_bigint = nlModP;
     
    884891  // debug stuff
    885892  r->cfCoeffWrite=nfCoeffWrite;
    886    
     893
    887894  r->cfParDeg = nfParDeg;
    888895
     
    890897  r->cfDBTest=nfDBTest;
    891898#endif
    892  
     899
    893900  // the variables:
    894901  r->nNULL = (number)0;
     
    900907
    901908  const char * name = p->GFPar_name;
    902  
     909
    903910  r->m_nfCharQ = 0;
    904911  r->m_nfCharP = p->GFChar;
     
    913920  assume( pParameterNames != NULL );
    914921  assume( pParameterNames[0] != NULL );
    915  
     922
    916923  r->pParameterNames = pParameterNames;
    917924  // NOTE: r->m_nfParameter was replaced by n_ParameterNames(r)[0]
     
    937944  }
    938945
    939   const double check= log ((double) (p->GFChar)); 
     946  const double check= log ((double) (p->GFChar));
    940947
    941948  if( (p->GFDegree * check) > sixteenlog2 )
     
    950957
    951958  nfReadTable(c, r);
    952  
     959
    953960  if( r->m_nfPlus1Table == NULL )
    954961  {
     
    958965    return TRUE;
    959966  }
    960  
    961  
     967
     968
    962969  assume (r -> m_nfCharQ > 0);
    963970
    964   r->ch = r->m_nfCharP; 
     971  r->ch = r->m_nfCharP;
    965972  assume( r->m_nfPlus1Table != NULL );
    966  
     973
    967974  return FALSE;
    968  
     975
    969976}
    970977
     
    981988    char *s=StringEndS(); PrintS(s); omFree(s);
    982989  }
    983   else PrintS("//   minpoly        : ...\n"); 
     990  else PrintS("//   minpoly        : ...\n");
    984991}
    985992
  • libpolys/polys/mod_raw.cc

    r84299e r55cb6b  
    1616#include <ctype.h>
    1717#include <sys/stat.h>
     18#include <errno.h>
    1819
    1920
     
    3940char* si_bultin_libs[]={ SI_FOREACH_BUILTIN(SI_BUILTIN_LIBSTR)  NULL };
    4041
    41 #undef SI_BUILTIN_LIBSTR 
     42#undef SI_BUILTIN_LIBSTR
    4243
    4344lib_types type_of_LIB(char *newlib, char *libnamebuf)
     
    4546  const unsigned char mach_o[]={0xfe,0xed,0xfa,0xce,0};
    4647  const unsigned char mach_O[]={0xce,0xfa,0xed,0xfe,0};
    47    
     48
    4849  const unsigned char mach_o64[]={0xfe,0xed,0xfa,0xcf,0};
    4950  const unsigned char mach_O64[]={0xcf,0xfa,0xed,0xfe,0};
    50    
     51
    5152  int i=0;
    5253  while(si_bultin_libs[i]!=NULL)
     
    6263  struct stat sb;
    6364  int nbytes = 0;
    64   // int ret;
     65  int ret;
    6566  lib_types LT=LT_NONE;
    6667
    6768  FILE * fp = feFopen( newlib, "r", libnamebuf, FALSE );
    68   /*ret =*/ (void) stat(libnamebuf, &sb);
     69
     70  do
     71  {
     72    ret = stat(libnamebuf, &sb);
     73  } while((ret < 0) and (errno == EINTR));
    6974
    7075  if (fp==NULL)
Note: See TracChangeset for help on using the changeset viewer.