public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
Cc: ltp-list <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH] readdir/readdir03.c: add new error number testes
Date: Tue, 6 May 2014 13:00:48 +0200	[thread overview]
Message-ID: <20140506110048.GC6403@rei.Home> (raw)
In-Reply-To: <1399373430.3177.55.camel@G08JYZSD130126>

Hi!
> > > +char *TCID = "readdir03";
> > > +
> > > +#if !defined __x86_64__
> > 
> > Why is the test disabled on x86_64? What about other 64 bit
> > architectures?
> > 
> 
> In syscall.h __NR_readdir only appears on NONE x86_64. It will fail when
> I make on x86_64:
> readdir03.c:122:15: error: ???__NR_readdir??? undeclared (first use in this
> function)
>   TEST(syscall(__NR_readdir, *test->fd, test->dirp, test->count));

We have testcases/kernel/include/linux_syscall_numbers.h and
ltp_syscall() to solve this problem.

Once this header is included, the syscall number will always be defined
and ltp_syscall() will return -1 and set errno to ENOSYS if syscall
wasn't implemented on the particular arch.

> > > +static void readdir_verify(const struct test_case_t *test)
> > > +{
> > > +	TEST(syscall(__NR_readdir, *test->fd, test->dirp, test->count));
> > 
> > So you are using raw readdir() syscall (man 2 readdir) instead of the
> > glibc readdir() (man 3 readdir).
> > 
> > Are you aware that the rest of the readdir testcases use the glibc
> > readdir()?
> > 
> 
> Yes, I am aware that.
> Could I create a new directory to do that or others?

Not necessarily. At least add a note about this in the comment at the
start of the testcase, and maybe we should start the test numbers at 21.

Moreover if you expect to create more than one testcase (which I expect
because the current one does not cover much) you should put the
old_linux_dirent structure definition into a header.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2014-05-06 11:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01 11:12 [LTP] [PATCH] readdir/readdir03.c: add new error number testes Zeng Linggang
2014-05-05 16:32 ` chrubis
     [not found]   ` <1399373430.3177.55.camel@G08JYZSD130126>
2014-05-06 11:00     ` chrubis [this message]
     [not found]       ` <1399427555.2397.8.camel@G08JYZSD130126>
2014-05-07  9:09         ` chrubis
     [not found]           ` <1399459901.2397.18.camel@G08JYZSD130126>
2014-05-07 12:58             ` [LTP] [PATCH v2 2/2] readdir/readdir21.c: " chrubis

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=20140506110048.GC6403@rei.Home \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=zenglg.jy@cn.fujitsu.com \
    /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