[LTP] [PATCH] syscalls/openat2: New tests
Viresh Kumar
viresh.kumar@linaro.org
Mon Mar 2 10:07:18 CET 2020
On 02-03-20, 09:46, Cyril Hrubis wrote:
> Hmm, I guess that it makes sense to add the pointer to how to the tcase
> structure and allocate exact size for the E2BIG case. That should work
> fine, right?
We need to hack it a bit more to initialize rest of the memory as
well. This is what I did before I dropped the idea.
+static void setup(void)
+{
+ uint *temp;
+
+ openat2_supported_by_kernel();
+
+ temp = (uint *)(how + 1);
+ *temp = 0xDEAD;
+}
+
static void run(unsigned int n)
{
struct tcase *tc = &tcases[n];
@@ -60,10 +70,10 @@ static void run(unsigned int n)
static struct tst_test test = {
.tcnt = ARRAY_SIZE(tcases),
.test = run,
- .setup = openat2_supported_by_kernel,
+ .setup = setup,
.needs_tmpdir = 1,
.bufs = (struct tst_buffers []) {
- {&how, .size = sizeof(*how)},
+ {&how, .size = 2 * sizeof(*how)},
{},
}
};
--
viresh
More information about the ltp
mailing list