1From b39a62f6682463bcd47480348fac3dcd209a19a5 Mon Sep 17 00:00:00 2001 2From: Robert Yang <liezhi.yang@windriver.com> 3Date: Wed, 22 Jan 2014 01:06:40 -0500 4Subject: [PATCH] Add dummy definition of O_CLOEXEC 5 6O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have 7it, we need check before use. 8 9This patch is much more like a workaround, since it may need fcntl() use 10FD_CLOEXEC to replace. 11 12This problem was reported by "Ting Liu <b28495@freescale.com>" 13 14[Thomas De Schampheleire <thomas.de.schampheleire@gmail.com: 15 - move dummy definition from libkmod-internal.h to missing.h 16 - update commit title] 17 18[Vicente: Adapt this patch to version 19.] 19 20Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> 21Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com> 22 23Upstream-status: rejected, suggests to add in buildroot instead [1] 24 25[1] http://news.gmane.org/find-root.php?message_id=1412062906%2d27378%2d1%2dgit%2dsend%2demail%2dpatrickdepinguin%40gmail.com 26 27--- 28 shared/missing.h | 4 ++++ 29 1 files changed, 4 insertions(+), 0 deletions(-) 30 31diff --git a/shared/missing.h b/shared/missing.h 32index 4c0d136..e123e98 100644 33--- a/shared/missing.h 34+++ b/shared/missing.h 35@@ -19,6 +19,10 @@ 36 # define __NR_finit_module -1 37 #endif 38 39+#ifndef O_CLOEXEC 40+#define O_CLOEXEC 0 41+#endif 42+ 43 #ifndef HAVE_FINIT_MODULE 44 #include <errno.h> 45 46-- 471.7.1 48 49