Changeset bdda8c2 in git
- Timestamp:
- Apr 9, 2013, 4:39:42 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '1d362c315e551a5b527ab0759f8839cf0e94f3a5')
- Children:
- 2d5ff537ab672bcbb2ca73df6830672f38b1ea63
- Parents:
- bc0d32def5d3461a77eed40c1e1a3d254811858a
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/cntrlc.cc
rbc0d32 rbdda8c2 143 143 fprintf(stderr, "Unable to init signal %d ... exiting...\n", sig); 144 144 } 145 #ifdef HAVE_SIGINTERRUPT 146 siginterrupt(sig, 0); 145 si_siginterrupt(sig, 0); 147 146 /*system calls will be restarted if interrupted by the specified 148 147 * signal sig. This is the default behavior in Linux. 149 148 */ 150 #endif151 149 #else 152 150 struct sigaction new_action,old_action; … … 159 157 new_action.sa_flags = SA_RESTART; 160 158 161 int r=si gaction (sig, &new_action, &old_action);159 int r=si_sigaction (sig, &new_action, &old_action); 162 160 si_hdl_typ retval=(si_hdl_typ)old_action.sa_handler; 163 161 if (r == -1) … … 503 501 if (pid == 0) 504 502 { 505 close (0);dup2 (in_fd[0],0); /* set the stdin to the in pipe */506 close (1);dup2 (out_fd[1],1); /* set the stdout to the out pipe */507 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 */ 508 506 509 507 execvp (args[0], args); /* exec gdb */ … … 520 518 FD_SET (out_fd[0], &fdset); 521 519 522 write (in_fd[1], "backtrace\n", 10);523 write (in_fd[1], "p si_stop_stack_trace_x = 0\n", 28);524 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); 525 523 526 524 index = 0; … … 533 531 tv.tv_usec = 0; 534 532 535 sel = s elect (FD_SETSIZE, &readset, NULL, NULL, &tv);533 sel = si_select (FD_SETSIZE, &readset, NULL, NULL, &tv); 536 534 if (sel == -1) 537 535 break; … … 539 537 if ((sel > 0) && (FD_ISSET (out_fd[0], &readset))) 540 538 { 541 if ( read (out_fd[0], &c, 1))539 if (si_read (out_fd[0], &c, 1)) 542 540 { 543 541 switch (state) … … 570 568 } 571 569 572 close (in_fd[0]);573 close (in_fd[1]);574 close (out_fd[0]);575 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]); 576 574 m2_end(0); 577 575 } -
Singular/fehelp.cc
rbc0d32 rbdda8c2 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
rbc0d32 rbdda8c2 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/links/semaphore.c
rbc0d32 rbdda8c2 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
rbc0d32 rbdda8c2 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
rbc0d32 rbdda8c2 199 199 { 200 200 mpz_t tmp; 201 201 mpz_init_set_si(tmp,nn); 202 202 fputs("8 ",d->f_write); 203 203 mpz_out_str (d->f_write,32, tmp); 204 204 fputc(' ',d->f_write); 205 205 mpz_clear(tmp); 206 206 } 207 207 #endif … … 491 491 mpz_init(((number_dummy)n)->z); 492 492 mpz_init(((number_dummy)n)->n); 493 494 493 s_readmpz_base (d->f_read,((number_dummy)n)->z, 32); 494 s_readmpz_base (d->f_read,((number_dummy)n)->n, 32); 495 495 ((number_dummy)n)->s=sub_type-5; 496 496 return n; … … 500 500 number n=(number)omAlloc0(sizeof(snumber_dummy)); 501 501 mpz_init(((number_dummy)n)->z); 502 502 s_readmpz_base (d->f_read,((number_dummy)n)->z, 32); 503 503 ((number_dummy)n)->s=sub_type=3; /*subtype-5*/ 504 504 return n; … … 982 982 char* cli_host = (char*)omAlloc(256); 983 983 char* path = (char*)omAlloc(1024); 984 int r = s scanf(l->name,"%255[^:]:%s",cli_host,path);984 int r = si_sscanf(l->name,"%255[^:]:%s",cli_host,path); 985 985 if(r == 0) 986 986 { … … 1039 1039 struct hostent *server; 1040 1040 1041 s scanf(l->name,"%255[^:]:%d",host,&portno);1041 si_sscanf(l->name,"%255[^:]:%d",host,&portno); 1042 1042 //Print("connect to host %s, port %d\n",host,portno);mflush(); 1043 1043 if (portno!=0) … … 1301 1301 case 19: res->rtyp=BIGINTMAT_CMD; 1302 1302 res->data=ssiReadBigintmat(d); 1303 1303 break; 1304 1304 case 20: ssiReadBlackbox(res,l); 1305 1305 break; -
Singular/misc_ip.cc
rbc0d32 rbdda8c2 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 -
findexec/feFopen.cc
rbc0d32 rbdda8c2 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); -
libpolys/coeffs/ffields.cc
rbc0d32 rbdda8c2 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
rbc0d32 rbdda8c2 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.