write(fd, (char*)&buffer, (1024 > len ? len : 1024));
write(fd, (char*)&buffer, (size_t)(1024 > len ? len : 1024));
long new_lseek(int fd, long offset, int origin){ 	long cur_pos=0;	long end_pos=0;	long seek_pos=0;	if(origin == SEEK_CUR)      {	      	if(offset < 1)							  	    	return(lseek(fd, offset, SEEK_CUR));		cur_pos = lseek(fd, 0, SEEK_CUR);		if(cur_pos < 0)			return(cur_pos);	  }										 	end_pos = lseek(fd, 0, SEEK_END);	if(end_pos < 0)		return(end_pos);	if(origin == SEEK_SET)		seek_pos = offset;	else if(origin == SEEK_CUR)		seek_pos = cur_pos + offset;	else if(origin == SEEK_END)		seek_pos = end_pos + offset; 	else	  {	  	assert(0);		return(-1);	  } 	/* the seek position desired is before the	 * end of the file.  We don't need	 * to do anything special except the seek.	 */ 	if(seek_pos <= end_pos) 		return(lseek(fd, seek_pos, SEEK_SET)); 		 	  /* the seek position is beyond the end of the 	   * file.  Write zero's to the end. 	   *	   * we are already at the end of the file so	   * we just need to "write()" zeros for the	   * difference between seek_pos-end_pos and	   * then seek to the position to finish	   * the call 	   */ 	  {  	 	char buffer[1024];	   	long len = seek_pos-end_pos;	   	memset(&buffer, 0, 1024);	   	while(len > 0)	      {	        write(fd, (char*)&buffer, (1024 > len ? len : 1024));		    len -= 1024;		  }		return(lseek(fd, seek_pos, SEEK_SET));	  }		}