From: chrubis@suse.cz
To: Markos Chandras <markos.chandras@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 1/2] syscalls/getdents: Use getdents64 if SYS_getdents is not defined
Date: Wed, 13 Mar 2013 19:23:23 +0100 [thread overview]
Message-ID: <20130313182323.GA4633@rei> (raw)
In-Reply-To: <CAG2jQ8h+u3Ade6ONcde=jBLSipJtF1vzP9q7zE-m3qX-LM1fKQ@mail.gmail.com>
Hi!
> The problem is that for arches that don't have SYS_getdents defined,
> you will not be able to compile LTP on them so you really need to
> hide this codepath from them.
>
> A similar commit that changes the codepath based on whether a
> particular __NR_XX is defined is this
> https://github.com/linux-test-project/ltp/commit/75201f160b9aa49af70d8f46fb1f087e63d603dd
>
> I don't see an easy way to determine if __NR_XX is defined or not
> during runtime.
There is code that tries to address this issue in
testcases/kernel/include/linux_syscall_numbers.h
which defines macro ltp_syscall() that turns undefined
syscall numbers into ENOSYS.
The idea is to:
1) include sys/syscall.h to get the definitions system definitons
2) if your system headers are older (i.e. particular __NR_xxx is not defined)
definitions from arch.in files are used
3) if __NR_xxx is not defined, there are stubs at the end of the header
that defines the __NR_xxx to 0 which is then used by the ltp_syscall()
macro to return -1 and set errno to ENOSYS
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2013-03-13 18:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 14:01 [LTP] [PATCH 1/2] syscalls/getdents: Use getdents64 if SYS_getdents is not defined Markos Chandras
2013-03-13 17:20 ` Mike Frysinger
2013-03-13 17:21 ` Markos Chandras
2013-03-13 17:58 ` Jan Stancek
2013-03-13 18:03 ` Markos Chandras
2013-03-13 18:23 ` chrubis [this message]
[not found] ` <CAG2jQ8hbT_8h8KR0V2=7qzwdSy8cqzOWb_oHt4JJ5Y22yFEeDg@mail.gmail.com>
[not found] ` <CAG2jQ8j23+74_JZbrkM55aKg4YG+V-g4G1+NsS4fLGy=efRDjQ@mail.gmail.com>
2013-03-14 16:29 ` 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=20130313182323.GA4633@rei \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=markos.chandras@gmail.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