syscalls/getrandom: add configure check for linux/random.h
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 syscalls/getrandom: add configure check for linux/random.h
For simplicity, I think we should just verify whether 'linux/random.h' is valid, here if it's valid, that means such codes will be compiled correctly.
#include <linux/random.h>
int main(void)
{
getrandom(NULL, 100, 0);
return 0;
}
--- m4/ltp-linuxrandom.m4 | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
m4/ltp-linuxrandom.m4 +17 -3
@@ -16,6 +16,20 @@ dnl dnl LTP_CHECK_LINUXRANDOM dnl ---------------------------- dnl -AC_DEFUN([LTP_CHECK_LINUXRANDOM],[ -AC_CHECK_HEADERS(linux/random.h, [], [], [])] -) + +AC_DEFUN([LTP_CHECK_LINUXRANDOM],[dnl + AC_MSG_CHECKING([for linux/random.h]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ + +#include <linux/random.h> +int main(void) { + return 0; +}])],[has_linux_random_h="yes"]) + +if test "x$has_linux_random_h" = xyes; then + AC_DEFINE(HAVE_LINUX_RANDOM_H,1,[Define to 1 if having a valid linux/random.h]) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi +])
Signature · 13 lines
1.8.2.1 ------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
----- Original Message -----
Quoted 9 lines
From: "Xiaoguang Wang" <[email protected]>
To: [email protected]
Sent: Wednesday, 22 July, 2015 4:40:23 AM
Subject: [LTP] [PATCH] syscalls/getrandom: add configure check forlinux/random.hFor simplicity, I think we should just verify whether '
linux/random.h' is valid, here if it's valid, that means such codes will be compiled correctly.
Quoted 7 lines
#include <
linux/random.h>
int main(void)
{
getrandom(NULL, 100, 0);
return 0;
}Signed-off-by Xiaoguang Wang <[email protected]>
I added paragraph about autoconf behaviour before 2.64, removed getrandom() call from commit message and pushed.
Thank you,
Jan
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
hi,
Quoted 22 lines · Jan Stancek
----- Original Message -----
Quoted 9 lines
From: "Xiaoguang Wang" <[email protected]>
To: [email protected]
Sent: Wednesday, 22 July, 2015 4:40:23 AM
Subject: [LTP] [PATCH] syscalls/getrandom: add configure check forlinux/random.hFor simplicity, I think we should just verify whether '
linux/random.h' is valid, here if it's valid, that means such codes will be compiled correctly.Quoted 7 lines
#include <
linux/random.h>
int main(void)
{
getrandom(NULL, 100, 0);
return 0;
}Signed-off-by Xiaoguang Wang <[email protected]>
Quoted 2 lines
I added paragraph about autoconf behaviour before 2.64, removed
getrandom()call from commit message and pushed.
OK, that would be better, thanks!
Regards,
Xiaoguang Wang
Quoted 5 lines
Thank you,
Jan
.
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list