From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/fstatat01: fix test on x86_64 arch
Date: Wed, 09 Mar 2016 12:47:11 +0300 [thread overview]
Message-ID: <56DFF11F.9080505@oracle.com> (raw)
In-Reply-To: <166755113.7189444.1457515127024.JavaMail.zimbra@redhat.com>
Hi,
On 03/09/2016 12:18 PM, Jan Stancek wrote:
> ...
> -/* TODO (garrcoop): properly port to fstatat64. */
> -#if (defined __NR_fstatat64) && (__NR_fstatat64 != 0)
> -struct stat64 statbuf;
> -#else
> -struct stat statbuf;
> -#endif
> -
> -/*
> - * XXX (garrcoop): NO NO NO NO NO NO NO NO NO ... use
> linux_syscall_numbers.h!
> - */
> -/* __NR_fstatat64 and __NR_fstatat64 if not defined are ALWAYS stubbed by
> - * linux_syscall_numbers.h Need to check for 0 to avoid testing with stubs
> */
> -#if (defined __NR_fstatat64) && (__NR_fstatat64 != 0)
> -int myfstatat(int dirfd, const char *filename, struct stat64 *statbuf,
> - int flags)
> +#if !defined(HAVE_FSTATAT)
> +#if (defined __NR_fstatat64) && (__NR_fstatat64 > 0)
> +static struct stat64 statbuf;
> +int fstatat(int dirfd, const char *filename, struct stat64 *statbuf, int
> flags)
> {
> return ltp_syscall(__NR_fstatat64, dirfd, filename, statbuf, flags);
> }
> -#elif (defined __NR_newfstatat) && (__NR_newfstatat != 0)
> -int myfstatat(int dirfd, const char *filename, struct stat *statbuf, int
> flags)
> +#else
> Shouldn't we check that __NR_newfstatat is defined? There seem to be architectures,
> that don't define both fstatat64 and newfstatat.
It seems unnecessary... it should be defined in linux_syscall_numbers.h
whether
it is supported or not. In the last case __NR_newfstatat is defined as
__LTP_NR_INVALID_SYSCALL,eventually we'll get TCONF for ltp_syscall(-1,
...).
Thanks,
Alexey
>
> Regards,
> Jan
>
>> +static struct stat statbuf;
>> +int fstatat(int dirfd, const char *filename, struct stat *statbuf, int
>> flags)
>> {
>> return ltp_syscall(__NR_newfstatat, dirfd, filename, statbuf, flags);
>> }
>> +#endif
>> #else
>> -/* stub - will never run */
>> -int myfstatat(int dirfd, const char *filename, struct stat *statbuf, int
>> flags)
>> -{
>> - return ltp_syscall(0, dirfd, filename, statbuf, flags);
>> -}
>> +static struct stat statbuf;
>> #endif
>>
>> int main(int ac, char **av)
>> @@ -104,8 +92,7 @@ int main(int ac, char **av)
>> tst_count = 0;
>>
>> for (i = 0; i < TST_TOTAL; i++) {
>> - TEST(myfstatat
>> - (fds[i], filenames[i], &statbuf, flags[i]));
>> + TEST(fstatat(fds[i], filenames[i], &statbuf, flags[i]));
>>
>> if (TEST_ERRNO == expected_errno[i]) {
>> tst_resm(TPASS | TTERRNO,
>> --
>> 1.7.1
>>
>>
>> --
>> Mailing list info: http://lists.linux.it/listinfo/ltp
>>
next prev parent reply other threads:[~2016-03-09 9:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-09 8:23 [LTP] [PATCH] syscalls/fstatat01: fix test on x86_64 arch Alexey Kodanev
2016-03-09 9:18 ` Jan Stancek
2016-03-09 9:47 ` Alexey Kodanev [this message]
2016-03-09 9:49 ` Jan Stancek
2016-03-09 10:14 ` Alexey Kodanev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56DFF11F.9080505@oracle.com \
--to=alexey.kodanev@oracle.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox