Changeset 55cb6b in git
- Timestamp:
- Apr 10, 2013, 4:04:09 PM (11 years ago)
- Branches:
- (u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
- Children:
- ccae2f26143f71606cceb669458d60a2c39c4654
- Parents:
- c60380d927be780ce0fe437b14c03e70f0df8f5984299e1e1d2b92c5e28fc52391cc529f8eb8ade7
- Files:
-
- 3 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Makefile.am
r84299e r55cb6b 147 147 links/ssiLink.h \ 148 148 links/simpleipc.h \ 149 si_signals.h \ 149 150 stype.h \ 150 151 subexpr.h \ -
Singular/cntrlc.cc
r84299e r55cb6b 26 26 #include <kernel/febase.h> 27 27 void 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> 28 33 29 34 #include "tok.h" … … 138 143 fprintf(stderr, "Unable to init signal %d ... exiting...\n", sig); 139 144 } 140 #ifdef HAVE_SIGINTERRUPT 141 siginterrupt(sig, 0); 145 si_siginterrupt(sig, 0); 142 146 /*system calls will be restarted if interrupted by the specified 143 147 * signal sig. This is the default behavior in Linux. 144 148 */ 145 #endif146 149 #else 147 150 struct sigaction new_action,old_action; … … 154 157 new_action.sa_flags = SA_RESTART; 155 158 156 int r=si gaction (sig, &new_action, &old_action);159 int r=si_sigaction (sig, &new_action, &old_action); 157 160 si_hdl_typ retval=(si_hdl_typ)old_action.sa_handler; 158 161 if (r == -1) … … 498 501 if (pid == 0) 499 502 { 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 */ 503 506 504 507 execvp (args[0], args); /* exec gdb */ … … 515 518 FD_SET (out_fd[0], &fdset); 516 519 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); 520 523 521 524 index = 0; … … 528 531 tv.tv_usec = 0; 529 532 530 sel = s elect (FD_SETSIZE, &readset, NULL, NULL, &tv);533 sel = si_select (FD_SETSIZE, &readset, NULL, NULL, &tv); 531 534 if (sel == -1) 532 535 break; … … 534 537 if ((sel > 0) && (FD_ISSET (out_fd[0], &readset))) 535 538 { 536 if ( read (out_fd[0], &c, 1))539 if (si_read (out_fd[0], &c, 1)) 537 540 { 538 541 switch (state) … … 565 568 } 566 569 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]); 571 574 m2_end(0); 572 575 } -
Singular/fehelp.cc
r84299e r55cb6b 23 23 24 24 #include <findexec/omFindExec.h> 25 26 #include <Singular/si_signals.h> 25 27 26 28 #include "ipid.h" … … 510 512 hentry->url[i] = '\0'; 511 513 512 if ( fscanf(fd, "%ld\n", &(hentry->chksum)) != 1)514 if (si_fscanf(fd, "%ld\n", &(hentry->chksum)) != 1) 513 515 { 514 516 hentry->chksum = -1; … … 638 640 if (fd == NULL) return 0; 639 641 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) 641 643 { 642 644 if ((index_key[MAX_HE_ENTRY_LENGTH-1]!='\0')) … … 1220 1222 { 1221 1223 // char* dummy=fgets(buffer, BUF_LEN, index); /* */ 1222 (void)s scanf(buffer, "Node:%[^\177]\177%ld\n", Index, &offset);1224 (void)si_sscanf(buffer, "Node:%[^\177]\177%ld\n", Index, &offset); 1223 1225 for(p=Index; *p; p++) *p = tolow(*p);/* */ 1224 1226 (void)strcat(Index, " "); -
Singular/fereadl.c
r84299e r55cb6b 195 195 #endif 196 196 /* 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); 198 198 /*char t_buf[128];*/ 199 199 char *temp; … … 325 325 /* check for CSI */ 326 326 c='\0'; 327 read (STDIN_FILENO, &c, 1);327 while((-1 == read (STDIN_FILENO, &c, 1)) && (errno == EINTR)); 328 328 if (c == '[') 329 329 { 330 330 /* get command character */ 331 331 c='\0'; 332 read (STDIN_FILENO, &c, 1);332 while((-1 == read (STDIN_FILENO, &c, 1)) && (errno == EINTR)); 333 333 switch (c) 334 334 { … … 415 415 tv.tv_sec = 0; 416 416 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) ); 422 427 if (sel==0) 423 428 fe_temp_reset(); … … 770 775 if (fe_rl_hdl==NULL) { return 1;} 771 776 772 fe_filename_completion_function= 777 fe_filename_completion_function= 773 778 dynl_sym(fe_rl_hdl, "filename_completion_function"); 774 779 if (fe_filename_completion_function==NULL) { res=3; break; } … … 825 830 extern int history_total_bytes(); 826 831 extern int write_history (const char *); 827 #endif 832 #endif 828 833 void fe_reset_input_mode () 829 834 { -
Singular/iparith.cc
r84299e r55cb6b 79 79 80 80 #include <polys/coeffrings.h> 81 #include <Singular/si_signals.h> 81 82 82 83 lists rDecompose(const ring r); … … 7651 7652 if (i_s > 0) 7652 7653 { 7653 s leep((is - 1)/1000000 + 1);7654 si_sleep((is - 1)/1000000 + 1); 7654 7655 jjSTATUS3(res, v, v->next, v->next->next); 7655 7656 } -
Singular/links/ndbm.cc
r84299e r55cb6b 15 15 16 16 #include "config.h" 17 #include <Singular/si_signals.h> 17 18 #include <kernel/mod2.h> 18 19 #ifdef HAVE_DBM … … 86 87 strcpy(db->dbm_pagbuf, file); 87 88 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); 89 90 if (db->dbm_pagf < 0) 90 91 goto bad; 91 92 strcpy(db->dbm_pagbuf, file); 92 93 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); 94 95 if (db->dbm_dirf < 0) 95 96 goto bad1; … … 99 100 return (db); 100 101 bad1: 101 (void) close(db->dbm_pagf);102 (void) si_close(db->dbm_pagf); 102 103 bad: 103 104 free((char *)db); … … 107 108 void dbm_close(DBM *db) 108 109 { 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); 111 112 free((char *)db); 112 113 } … … 166 167 db->dbm_pagbno = db->dbm_blkno; 167 168 (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) 169 170 { 170 171 err: … … 206 207 db->dbm_pagbno = db->dbm_blkno; 207 208 (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) 209 210 { 210 211 db->dbm_flags |= _DBM_IOERR; … … 245 246 db->dbm_pagbno = db->dbm_blkno; 246 247 (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) 248 249 { 249 250 db->dbm_flags |= _DBM_IOERR; … … 251 252 } 252 253 (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) 254 255 { 255 256 db->dbm_flags |= _DBM_IOERR; … … 284 285 db->dbm_pagbno = db->dbm_blkptr; 285 286 (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) 287 288 memset(db->dbm_pagbuf, 0, PBLKSIZ); 288 289 #ifdef DEBUG … … 323 324 db->dbm_pagbno = db->dbm_blkno; 324 325 (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) 326 327 memset(db->dbm_pagbuf, 0, PBLKSIZ); 327 328 #ifdef DEBUG … … 348 349 db->dbm_dirbno = b; 349 350 (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) 351 352 memset(db->dbm_dirbuf, 0, DBLKSIZ); 352 353 } … … 369 370 db->dbm_dirbno = b; 370 371 (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) 372 373 memset(db->dbm_dirbuf, 0, DBLKSIZ); 373 374 } … … 375 376 db->dbm_dirbno = b; 376 377 (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) 378 379 db->dbm_flags |= _DBM_IOERR; 379 380 } -
Singular/links/pipeLink.cc
r84299e r55cb6b 27 27 #include "lists.h" 28 28 #include "pipeLink.h" 29 #include <Singular/si_signals.h> 29 30 30 31 typedef struct … … 53 54 { 54 55 /* close unnecessary pipe descriptors for a clean environment */ 55 close(pc[1]);close(cp[0]);56 si_close(pc[1]); si_close(cp[0]); 56 57 /* 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 ); 59 60 int r=system(l->name); 60 close(pc[0]);61 close(cp[1]);61 si_close(pc[0]); 62 si_close(cp[1]); 62 63 exit(r); 63 64 /* never reached*/ … … 66 67 { 67 68 d->pid=pid; 68 close(pc[0]);close(cp[1]);69 si_close(pc[0]); si_close(cp[1]); 69 70 d->f_read=fdopen(cp[0],"r"); 70 71 d->fd_read=cp[0]; … … 176 177 //Print("test fd %d\n",d->fd_read); 177 178 /* check with select: chars waiting: no -> not ready */ 178 s=s elect(d->fd_read+1, &mask, NULL, NULL, &wt);179 s=si_select(d->fd_read+1, &mask, NULL, NULL, &wt); 179 180 } 180 181 switch (s) -
Singular/links/s_buff.cc
r84299e r55cb6b 11 11 #include <omalloc/omalloc.h> 12 12 #include <Singular/links/s_buff.h> 13 #include <Singular/si_signals.h> 13 14 //struct s_buff_s 14 15 //{ … … 43 44 { 44 45 SSI_BLOCK_CHLD; 45 int fd= open(n,O_RDONLY);46 int fd=si_open(n,O_RDONLY); 46 47 SSI_UNBLOCK_CHLD; 47 48 return s_open(fd); … … 54 55 SSI_BLOCK_CHLD; 55 56 omFreeSize(F->buff,S_BUFF_LEN); 56 int r= close(F->fd);57 int r=si_close(F->fd); 57 58 omFreeSize(F,sizeof(*F)); 58 59 F=NULL; … … 74 75 memset(F->buff,0,S_BUFF_LEN); /*debug*/ 75 76 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); 77 78 SSI_UNBLOCK_CHLD; 78 79 if (r<=0) -
Singular/links/semaphore.c
r84299e r55cb6b 7 7 8 8 #include <kernel/mod2.h> 9 #include <Singular/si_signals.h> 9 10 10 11 #ifdef HAVE_SIMPLEIPC … … 66 67 { 67 68 if ((id<0) || (id >= SIPC_MAX_SEMAPHORES) || (semaphore[id]==NULL)) return -1; 68 s em_wait(semaphore[id]);69 si_sem_wait(semaphore[id]); 69 70 return 1; 70 71 } … … 73 74 { 74 75 if ((id<0) || (id >= SIPC_MAX_SEMAPHORES) || (semaphore[id]==NULL)) return -1; 75 return !s em_trywait(semaphore[id]);76 return !si_sem_trywait(semaphore[id]); 76 77 } 77 78 -
Singular/links/silink.cc
r84299e r55cb6b 31 31 #include <Singular/links/ssiLink.h> 32 32 #include <Singular/links/pipeLink.h> 33 #include <Singular/si_signals.h> 33 34 #include "feOpt.h" 34 35 … … 159 160 { 160 161 struct stat buf; 161 if ( lstat(l->name,&buf)==0) return "yes";162 if (si_lstat(l->name,&buf)==0) return "yes"; 162 163 else return "no"; 163 164 } -
Singular/links/ssiLink.cc
r84299e r55cb6b 25 25 #include "config.h" 26 26 #include <kernel/mod2.h> 27 #include <Singular/si_signals.h> 27 28 28 29 #include <omalloc/omalloc.h> … … 198 199 { 199 200 mpz_t tmp; 200 201 mpz_init_set_si(tmp,nn); 201 202 fputs("8 ",d->f_write); 202 203 mpz_out_str (d->f_write,32, tmp); 203 204 fputc(' ',d->f_write); 204 205 mpz_clear(tmp); 205 206 } 206 207 #endif … … 490 491 mpz_init(((number_dummy)n)->z); 491 492 mpz_init(((number_dummy)n)->n); 492 493 493 s_readmpz_base (d->f_read,((number_dummy)n)->z, 32); 494 s_readmpz_base (d->f_read,((number_dummy)n)->n, 32); 494 495 ((number_dummy)n)->s=sub_type-5; 495 496 return n; … … 499 500 number n=(number)omAlloc0(sizeof(snumber_dummy)); 500 501 mpz_init(((number_dummy)n)->z); 501 502 s_readmpz_base (d->f_read,((number_dummy)n)->z, 32); 502 503 ((number_dummy)n)->s=sub_type=3; /*subtype-5*/ 503 504 return n; … … 832 833 ssiToBeClosed->next=NULL; 833 834 SSI_BLOCK_CHLD; 834 close(pc[1]);close(cp[0]);835 si_close(pc[1]); si_close(cp[0]); 835 836 d->f_write=fdopen(cp[1],"w"); 836 837 SSI_UNBLOCK_CHLD; … … 869 870 d->pid=pid; 870 871 SSI_BLOCK_CHLD; 871 close(pc[0]);close(cp[1]);872 si_close(pc[0]); si_close(cp[1]); 872 873 d->f_write=fdopen(pc[1],"w"); 873 874 SSI_UNBLOCK_CHLD; … … 919 920 Print("waiting on port %d\n", portno);mflush(); 920 921 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); 922 923 if(newsockfd < 0) 923 924 { … … 933 934 d->f_write = fdopen(newsockfd, "w"); 934 935 SI_LINK_SET_RW_OPEN_P(l); 935 close(sockfd);936 si_close(sockfd); 936 937 } 937 938 // no ssi-Link on stdin or stdout … … 981 982 char* cli_host = (char*)omAlloc(256); 982 983 char* path = (char*)omAlloc(1024); 983 int r = s scanf(l->name,"%255[^:]:%s",cli_host,path);984 int r = si_sscanf(l->name,"%255[^:]:%s",cli_host,path); 984 985 if(r == 0) 985 986 { … … 1008 1009 omFree(ser_host); 1009 1010 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); 1011 1012 if(newsockfd < 0) 1012 1013 { … … 1022 1023 SSI_BLOCK_CHLD; 1023 1024 d->f_write = fdopen(newsockfd, "w"); 1024 close(sockfd);1025 si_close(sockfd); 1025 1026 SSI_UNBLOCK_CHLD; 1026 1027 SI_LINK_SET_RW_OPEN_P(l); … … 1038 1039 struct hostent *server; 1039 1040 1040 s scanf(l->name,"%255[^:]:%d",host,&portno);1041 si_sscanf(l->name,"%255[^:]:%d",host,&portno); 1041 1042 //Print("connect to host %s, port %d\n",host,portno);mflush(); 1042 1043 if (portno!=0) … … 1052 1053 server->h_length); 1053 1054 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) 1055 1056 { Werror("ERROR connecting(errno=%d)",errno); return TRUE; } 1056 1057 //PrintS("connected\n");mflush(); … … 1162 1163 if (d->r!=NULL) rKill(d->r); 1163 1164 if ((d->pid!=0) 1164 && ( waitpid(d->pid,NULL,WNOHANG)==0))1165 && (si_waitpid(d->pid,NULL,WNOHANG)==0)) 1165 1166 { 1166 1167 struct timespec t; … … 1168 1169 t.tv_nsec=50000000; // <=50 ms 1169 1170 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)) 1171 1172 { 1172 1173 kill(d->pid,15); … … 1174 1175 t.tv_nsec=10000000; // <=10 ms 1175 1176 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)) 1177 1178 { 1178 1179 kill(d->pid,9); // just to be sure 1179 waitpid(d->pid,NULL,0);1180 si_waitpid(d->pid,NULL,0); 1180 1181 } 1181 1182 } … … 1300 1301 case 19: res->rtyp=BIGINTMAT_CMD; 1301 1302 res->data=ssiReadBigintmat(d); 1302 1303 break; 1303 1304 case 20: ssiReadBlackbox(res,l); 1304 1305 break; … … 1498 1499 //Print("test fd %d\n",d->fd_read); 1499 1500 /* check with select: chars waiting: no -> not ready */ 1500 switch (s elect(d->fd_read+1, &mask, NULL, NULL, &wt))1501 switch (si_select(d->fd_read+1, &mask, NULL, NULL, &wt)) 1501 1502 { 1502 1503 case 0: /* not ready */ return "not ready"; … … 1669 1670 #endif 1670 1671 #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); 1672 1673 #else 1673 1674 SSI_BLOCK_CHLD; 1674 s = s elect(max_fd, &mask, NULL, NULL, wt_ptr);1675 s = si_select(max_fd, &mask, NULL, NULL, wt_ptr); 1675 1676 SSI_UNBLOCK_CHLD; 1676 1677 #endif … … 1848 1849 struct sockaddr_in cli_addr; 1849 1850 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); 1851 1852 if(newsockfd < 0) 1852 1853 { … … 1894 1895 { 1895 1896 ssiReserved_P=0; 1896 close(ssiReserved_sockfd);1897 si_close(ssiReserved_sockfd); 1897 1898 } 1898 1899 return l; … … 1919 1920 loop 1920 1921 { 1921 kidpid = waitpid(-1, &status, WNOHANG);1922 kidpid = si_waitpid(-1, &status, WNOHANG); 1922 1923 if (kidpid==-1) 1923 1924 { -
Singular/misc_ip.cc
r84299e r55cb6b 15 15 #include "config.h" 16 16 #include <kernel/mod2.h> 17 #include <Singular/si_signals.h> 17 18 18 19 #ifdef HAVE_FACTORY … … 1027 1028 int singular_fstat(int fd, struct stat *buf) 1028 1029 { 1029 return fstat(fd,buf);1030 return si_fstat(fd,buf); 1030 1031 } 1031 1032 -
Singular/sdb.cc
r84299e r55cb6b 17 17 #include <Singular/ipid.h> 18 18 #include <Singular/sdb.h> 19 #include <Singular/si_signals.h> 19 20 20 21 #ifdef HAVE_SDB … … 137 138 PrintS("cannot get the procedure body\n"); 138 139 fclose(fp); 139 unlink(filename);140 si_unlink(filename); 140 141 omFree(filename); 141 142 return; … … 149 150 if (pid!=0) 150 151 { 151 wait(&pid);152 si_wait(&pid); 152 153 } 153 154 else if(pid==0) … … 189 190 } 190 191 } 191 unlink(filename);192 si_unlink(filename); 192 193 omFree(filename); 193 194 } -
factory/algext.cc
rc60380d r55cb6b 864 864 equal= true; // modular image did not add any new information 865 865 TIMING_START (alg_termination) 866 #ifdef HAVE_NTL 866 867 #ifdef HAVE_FLINT 867 868 if (equal && tmp.isUnivariate() && f.isUnivariate() && g.isUnivariate() … … 889 890 } 890 891 else 892 #endif 891 893 #endif 892 894 if(equal && fdivides( tmp, f ) && fdivides( tmp, g )) // trial division -
factory/algext.h
rc60380d r55cb6b 1 #ifndef ALGEXT_H2 #define ALGEXT_H1 #ifndef CF_ALGEXT_H 2 #define CF_ALGEXT_H 3 3 4 4 // #include "config.h" -
factory/facMul.h
rc60380d r55cb6b 18 18 #include "fac_util.h" 19 19 20 #ifdef HAVE_NTL 20 21 /// multiplication of univariate polys over a finite field using NTL, if we are 21 22 /// in GF factory's default multiplication is used. … … 166 167 ); 167 168 #endif 169 #endif 168 170 169 171 #endif -
findexec/feFopen.cc
r84299e r55cb6b 5 5 #include <sys/stat.h> 6 6 #include <unistd.h> 7 #include <errno.h> 7 8 8 9 #include "config.h" … … 97 98 { 98 99 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) 100 106 && (S_ISREG(statbuf.st_mode))) 101 107 f = myfopen(path,mode); -
kernel/tgb.cc
r84299e r55cb6b 1469 1469 1470 1470 #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));} 1471 1475 // BOOLEAN corr=lenS_correct(c->strat); 1472 1476 int sugar; … … 1484 1488 assume (c->array_lengths >= c->n); 1485 1489 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); 1490 1494 ENLARGE (c->lengths, int); 1491 1495 #ifndef HAVE_BOOST 1492 1496 #ifndef USE_STDVECBOOL 1493 1497 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); 1498 1502 //if (c->weighted_lengths!=NULL) { 1499 ENLARGE (c->weighted_lengths, wlen_type);1503 ENLARGE_ALIGN (c->weighted_lengths, wlen_type); 1500 1504 //} 1501 //ENLARGE (c->S->m,poly);1505 //ENLARGE_ALIGN(c->S->m,poly); 1502 1506 } 1503 1507 pEnlargeSet (&c->S->m, c->n - 1, 1); … … 1550 1554 1551 1555 #undef ENLARGE 1556 #undef ENLARGE_ALIGN 1552 1557 if(p_GetComp (h, currRing) <= c->syz_comp) 1553 1558 { … … 3287 3292 h = omalloc (n * sizeof (int)); 3288 3293 lengths = (int *) h; 3289 weighted_lengths = (wlen_type *) om alloc(n * sizeof (wlen_type));3290 gcd_of_terms = (poly *) om alloc (n * sizeof (poly));3294 weighted_lengths = (wlen_type *) omAllocAligned (n * sizeof (wlen_type)); 3295 gcd_of_terms = (poly *) omAlloc (n * sizeof (poly)); 3291 3296 3292 3297 short_Exps = (long *) omalloc (n * sizeof (long)); -
libpolys/coeffs/ffields.cc
r84299e r55cb6b 22 22 #include <string.h> 23 23 #include <math.h> 24 #include <errno.h> 24 25 25 26 BOOLEAN nfGreaterZero (number k, const coeffs r); … … 225 226 { 226 227 assume(i==1); 227 228 228 229 if( i == 1 ) 229 230 return (number)1; … … 655 656 /*this field is already set*/ return; 656 657 int i=0; 657 658 while ((fftable[i]!=c) && (fftable[i]!=0)) 658 659 while ((fftable[i]!=c) && (fftable[i]!=0)) 659 660 i++; 660 661 661 662 if (fftable[i]==0) 662 663 { … … 693 694 } 694 695 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 696 703 nfReadMipo(buf); 697 704 r->m_nfCharQ1=r->m_nfCharQ-1; … … 829 836 830 837 const int P = n_NumberOfParameters(r); 831 838 832 839 for( int i = 1; i <= P; i++ ) 833 if (p[i-1] != NULL) 840 if (p[i-1] != NULL) 834 841 omFree( (ADDRESS)p[i-1] ); 835 836 omFreeSize((ADDRESS)p, P * sizeof(char*)); 842 843 omFreeSize((ADDRESS)p, P * sizeof(char*)); 837 844 } 838 845 … … 865 872 //r->cfRePart = ndCopy; 866 873 //r->cfImPart = ndReturn0; 867 874 868 875 r->cfWriteLong = nfWriteLong; 869 876 r->cfInit_bigint = nlModP; … … 884 891 // debug stuff 885 892 r->cfCoeffWrite=nfCoeffWrite; 886 893 887 894 r->cfParDeg = nfParDeg; 888 895 … … 890 897 r->cfDBTest=nfDBTest; 891 898 #endif 892 899 893 900 // the variables: 894 901 r->nNULL = (number)0; … … 900 907 901 908 const char * name = p->GFPar_name; 902 909 903 910 r->m_nfCharQ = 0; 904 911 r->m_nfCharP = p->GFChar; … … 913 920 assume( pParameterNames != NULL ); 914 921 assume( pParameterNames[0] != NULL ); 915 922 916 923 r->pParameterNames = pParameterNames; 917 924 // NOTE: r->m_nfParameter was replaced by n_ParameterNames(r)[0] … … 937 944 } 938 945 939 const double check= log ((double) (p->GFChar)); 946 const double check= log ((double) (p->GFChar)); 940 947 941 948 if( (p->GFDegree * check) > sixteenlog2 ) … … 950 957 951 958 nfReadTable(c, r); 952 959 953 960 if( r->m_nfPlus1Table == NULL ) 954 961 { … … 958 965 return TRUE; 959 966 } 960 961 967 968 962 969 assume (r -> m_nfCharQ > 0); 963 970 964 r->ch = r->m_nfCharP; 971 r->ch = r->m_nfCharP; 965 972 assume( r->m_nfPlus1Table != NULL ); 966 973 967 974 return FALSE; 968 975 969 976 } 970 977 … … 981 988 char *s=StringEndS(); PrintS(s); omFree(s); 982 989 } 983 else PrintS("// minpoly : ...\n"); 990 else PrintS("// minpoly : ...\n"); 984 991 } 985 992 -
libpolys/polys/mod_raw.cc
r84299e r55cb6b 16 16 #include <ctype.h> 17 17 #include <sys/stat.h> 18 #include <errno.h> 18 19 19 20 … … 39 40 char* si_bultin_libs[]={ SI_FOREACH_BUILTIN(SI_BUILTIN_LIBSTR) NULL }; 40 41 41 #undef SI_BUILTIN_LIBSTR 42 #undef SI_BUILTIN_LIBSTR 42 43 43 44 lib_types type_of_LIB(char *newlib, char *libnamebuf) … … 45 46 const unsigned char mach_o[]={0xfe,0xed,0xfa,0xce,0}; 46 47 const unsigned char mach_O[]={0xce,0xfa,0xed,0xfe,0}; 47 48 48 49 const unsigned char mach_o64[]={0xfe,0xed,0xfa,0xcf,0}; 49 50 const unsigned char mach_O64[]={0xcf,0xfa,0xed,0xfe,0}; 50 51 51 52 int i=0; 52 53 while(si_bultin_libs[i]!=NULL) … … 62 63 struct stat sb; 63 64 int nbytes = 0; 64 //int ret;65 int ret; 65 66 lib_types LT=LT_NONE; 66 67 67 68 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)); 69 74 70 75 if (fp==NULL)
Note: See TracChangeset
for help on using the changeset viewer.