From: Cyril Hrubis <chrubis@suse.cz>
To: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] syscalls/getrandom: remove reference to '<linux/random.h>'
Date: Mon, 13 Jul 2015 12:07:29 +0200 [thread overview]
Message-ID: <20150713100728.GA2900@rei.suse.de> (raw)
In-Reply-To: <1436407199-12492-1-git-send-email-wangxg.fnst@cn.fujitsu.com>
Hi!
> Given that we use ltp_syscall() to call getrandom(2) and already
> have "GRND_RANDOM, GRND_NONBLOCK" defined in lapi/getrandom.h, indeed
> we don't need to include '<linux/random.h>'. Also including
> '<linux/random.h>'' will result in some compilation errors in older
> linux distribution, for example, in RHEL5.11GA, there will be such
> errors:
> In file included from getrandom01.c:29:
> /usr/include/linux/random.h:38: error: expected specifier-qualifier-list before ???__u32???
> /usr/include/linux/random.h:42: error: expected specifier-qualifier-list before ???__u32???
> This patch will also fix these compilation errors.
This is not correct.
The lapi/getrandom.h defines these as fallback definitions only if they
are not defined allready. And we really want to use the defines from the
system if they are available to ensure that they are correct.
The system header on older distros likely misses to include
linux/types.h to get the kernel types defined.
What about moving the #include <linux/random.h> to start of
lapi/getrandom.h and including <linux/types.h> there as well if needed
(would require configure check).
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2015-07-13 10:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-09 1:59 [LTP] [PATCH] syscalls/getrandom: remove reference to '<linux/random.h>' Xiaoguang Wang
2015-07-13 10:07 ` Cyril Hrubis [this message]
[not found] ` <1721921160.16296939.1436785318844.JavaMail.zimbra@redhat.com>
2015-07-13 11:12 ` Cyril Hrubis
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=20150713100728.GA2900@rei.suse.de \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=wangxg.fnst@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