History log of /external/ltp/testcases/kernel/syscalls/pwritev/pwritev01.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d044f17e25edcb535bea35d98e8a931a667959cd 14-Sep-2017 Cyril Hrubis <chrubis@suse.cz> Smash size_t and off_t printf() formatting mistakes

This fixes bunch of warnings when LTP is compiled for 32bit where size_t
and ssize_t are 32bit but off_t is 64 bit.

Here is a simple guide how to print size_t and off_t:

* size_t -> %zu
* ssize_t -> %zi or %zd
* off_t -> %li + cast to (long)

Common mistake is to print the st_size from struct stat with %zu but
st_size is defined as off_t. Also don't forget that sizeof(foo) returns
size_t.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/testcases/kernel/syscalls/pwritev/pwritev01.c
a5bf5254ca94e0164af76d409224ea0764632d22 14-Mar-2017 Cyril Hrubis <chrubis@suse.cz> tst_test.c: set the test id automatically

Use the argv[0] to set the tst_test->tid automatically since we fail to
update it commonly and we end up with wrong tid due to copy&paste.

Now it's initialized in the test setup based on argv[0]. If argv[0] is a
path we take last element in it.

This patch is based on v1 by Li Wang but I've omitted moving the
parse_opts() up in the setup() since the setup() function expects
that tst_test sturcture is non-NULL and may segfault if that is not
true.

Signed-off-by: Li Wang <liwang@redhat.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Petr Vorel <pvorel@suse.cz>
/external/ltp/testcases/kernel/syscalls/pwritev/pwritev01.c
e1c49edf1e9a7de95250c6aa6b122723531934ec 14-Feb-2017 Cyril Hrubis <chrubis@suse.cz> syscalls: Make use of SAFE_MACROS in cleanup

Convert newlib tests to use SAFE_MACROS() in cleanup where possible.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Jan Stancek <jstancek@redhat.com>
/external/ltp/testcases/kernel/syscalls/pwritev/pwritev01.c
7c0ec1d1b35b211643a113449ff1933d0ccc4ba9 02-Jan-2017 Cyril Hrubis <chrubis@suse.cz> safe_macros: Move SAFE_PREAD() and SAFE_PWRITE() to separate header

This fixes numerous "implicit function declaration" on slightly older
distributions where pwrite() and pread() needs to defined either of
_XOPEN_SOURCE or _GNU_SOURCE.

Adding a separate header for these two functions seems to be the only
reasonable solution since:

o These functions has to be inlined in the header because the prototype
contains off_t whose size depends on compile time settings

o Defining _GNU_SOURCE in the safe macros header is not a solution
either since it has to be defined before we include any libc headers
in order to take any effect

The first solution I had in mind was to add fallback prototypes for
these two functions, but that would allow the testwrites to use these
functions without defining the corresponding macro which may possibly
break the glibc redirection magic.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Jan Stancek <jstancek@redhat.com>
/external/ltp/testcases/kernel/syscalls/pwritev/pwritev01.c
6e3be087869e24ca55858480c342914f0c57d26b 11-Apr-2016 Xiao Yang <yangx.jy@cn.fujitsu.com> syscalls/pwritev: convert to new test API

pwritev01
- convert to new test API

pwritev02
- convert to new test API
- add test for ESPIPE

pwritev(2) fails if fd is associated with a pipe and set errno to ESPIPE.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
/external/ltp/testcases/kernel/syscalls/pwritev/pwritev01.c
4ca27ac2a238a6c593bd103a019698b37f6f89b3 03-Dec-2015 Xiao Yang <yangx.jy@cn.fujitsu.com> pwritev/pwritev01.c: add new testcase

Test pwritev(2) with some basic functions.
Pwritev(2) should succeed to write the expected content of data and
the file offset is not changed after writing the file.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/testcases/kernel/syscalls/pwritev/pwritev01.c