restartaftergc(tmp);
#endif
#endif
-
if (newfd<0) {
#ifdef DEBUG
perror(NULL);
exit(-1);
#endif
#endif
-
}
#ifdef TASK
fcntl(newfd, F_SETFL, fcntl(fd, F_GETFL)|O_NONBLOCK);
addreadfd(newfd);
flagorand(VAR(___this___),0,0xFFFFFFFE);
#endif
-
return newfd;
}
-
void CALL02(___Socket______nativeWrite_____AR_B, struct ___Socket___ * ___this___, struct ArrayObject * ___b___) {
int fd=VAR(___this___)->___fd___;
int length=VAR(___b___)->___length___;
int CALL02(___Socket______nativeRead_____AR_B, struct ___Socket___ * ___this___, struct ArrayObject * ___b___) {
int fd=VAR(___this___)->___fd___;
int length=VAR(___b___)->___length___;
- char * charstr=((char *)& VAR(___b___)->___length___)+sizeof(int);
+
+ char * charstr=malloc(length);
+
#ifdef THREADS
#ifdef PRECISE_GC
struct listitem *tmp=stopforgc((struct garbagelist *)___params___);
restartaftergc(tmp);
#endif
#endif
-
+
+ {
+ int i;
+ for(i=0;i<byteread;i++) {
+ (((char *)& VAR(___b___)->___length___)+sizeof(int))[i]=charstr[i];
+ }
+ free(charstr);
+ }
+
+
if (byteread<0) {
printf("ERROR IN NATIVEREAD\n");
}