[LTP] [PATCH v2 1/3] syscalls: new test writev07

Cui Bixuan cuibixuan@huawei.com
Thu Dec 1 07:36:58 CET 2016


On 2016/10/7 16:11, Jan Stancek wrote:
> +				off_after);
> +
> +		SAFE_CLOSE(fd);
> +		return;
> +	}
> +
> +	/* writev() wrote more bytes than bytes preceding invalid iovec */
> +	tst_res(TINFO, "writev() has written %ld bytes", TEST_RETURN);
> +	if (TEST_RETURN > (long) wr_iovec[0].iov_base) {
Hi, why TEST_RETURN(the return of writev) compare with wr_iovec[0].iov_base(the address) here?

I run it in armv7 (with printf("TEST_RETURN:%ld, wr_iovec[0].iov_base:%ld\n", TEST_RETURN, (long) wr_iovec[0].iov_base) for debug):

# ./writev07
tst_test.c:760: INFO: Timeout per run is 0h 05m 00s
writev07.c:60: INFO: starting test with initial file offset: 0
writev07.c:104: INFO: writev() has written 64 bytes
writev07.c:106: FAIL: writev wrote more than expected
TEST_RETURN:64, wr_iovec[0].iov_base:-1092708152
writev07.c:60: INFO: starting test with initial file offset: 65
writev07.c:104: INFO: writev() has written 64 bytes
writev07.c:106: FAIL: writev wrote more than expected
TEST_RETURN:64, wr_iovec[0].iov_base:-1092708152
writev07.c:60: INFO: starting test with initial file offset: 4096
writev07.c:104: INFO: writev() has written 64 bytes
writev07.c:106: FAIL: writev wrote more than expected
TEST_RETURN:64, wr_iovec[0].iov_base:-1092708152
writev07.c:60: INFO: starting test with initial file offset: 4097
writev07.c:104: INFO: writev() has written 64 bytes
writev07.c:106: FAIL: writev wrote more than expected
TEST_RETURN:64, wr_iovec[0].iov_base:-1092708144

So the case fail at all time.

Thanks,
Cui Bixuan

> +		tst_res(TFAIL, "writev wrote more than expected");
> +		SAFE_CLOSE(fd);
> +		return;
> +	}
> +
> +	/* file content matches written bytes */
> +	SAFE_LSEEK(fd, initial_file_offset, SEEK_SET);
> +	SAFE_READ(1, fd, tmp, TEST_RETURN);



More information about the ltp mailing list