Skip to contentSkip to conversation

syscalls/recvmsg02: Add header file lapi/socket.h

PATCH New Xiao Yang 2 participants 4 messages Mar 2, 2016 – Mar 3, 2016

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

PATCH 1/1 syscalls/recvmsg02: Add header file lapi/socket.h

Compilation failed on RHEL5.11GA because SOCK_CLOEXEC is not included in sys/socket.h on RHEL5.11GA, so fix it.

---
 include/lapi/socket.h                         | 26 ++++++++++++++++++++++++++
 testcases/kernel/syscalls/recvmsg/recvmsg02.c |  6 ++++++
 2 files changed, 32 insertions(+)
 create mode 100644 include/lapi/socket.h
include/lapi/socket.h new file +26 -0
new file mode 100644
index 0000000..ecad9bd
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 20156 Fujitsu Ltd.
+* Author: Xiao Yang <[email protected]>
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License as
+* published by the Free Software Foundation; either version 2 of
+* the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it would be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program.
+*/
+
+#ifndef __LAPI_SOCKET_H__
+#define __LAPI_SOCKET_H__
+
+#ifndef SOCK_CLOEXEC
+# define SOCK_CLOEXEC 02000000
+#endif
+
+#endif /* __LAPI_SOCKET_H__ */
testcases/kernel/syscalls/recvmsg/recvmsg02.c +6 -0
index 5c15524..e921f79 100644
@@ -34,6 +34,7 @@
 
 #include "test.h"
 #include "safe_macros.h"
+#include "lapi/socket.h"
 
 const char *TCID = "recvmsg02";
 int TST_TOTAL = 1;
@@ -102,6 +103,11 @@ int main(int argc, char *argv[])
 {
 	int lc;
 
+	if ((tst_kvercmp(2, 6, 27)) < 0) {
+		tst_brkm(TCONF, NULL, "This test can only run on kernels"
+			 "that are 2.6.27 and higher");
+	}
+
 	tst_parse_opts(argc, argv, NULL, NULL);
 
 	for (lc = 0; TEST_LOOPING(lc); ++lc)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 syscalls/recvmsg02: Add header file lapi/socket.h

Hi!

Quoted 2 lines

Compilation failed on RHEL5.11GA because SOCK_CLOEXEC is not included in sys/socket.h on RHEL5.11GA, so fix it.

Pushed, thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#2 lore raw

PATCH 1/1 lapi/socket.h: fix typo

---
 include/lapi/socket.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/lapi/socket.h +2 -2
index ecad9bd..9826310 100644
@@ -1,6 +1,6 @@
 /*
-* Copyright (c) 20156 Fujitsu Ltd.
-* Author: Xiao Yang <[email protected]>
+* Copyright (c) 2016 Fujitsu Ltd.
+* Author: Xiao Yang <[email protected]>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
Signature · 1 line
1.8.3.1