linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add dummy definition of O_CLOEXEC
@ 2014-09-30  7:41 Thomas De Schampheleire
  2014-10-01 20:48 ` Lucas De Marchi
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas De Schampheleire @ 2014-09-30  7:41 UTC (permalink / raw)
  To: linux-modules; +Cc: Robert Yang

From: Robert Yang <liezhi.yang@windriver.com>

O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have
it, we need check before use.

This patch is much more like a workaround, since it may need fcntl() use
FD_CLOEXEC to replace.

This problem was reported by "Ting Liu <b28495@freescale.com>"

[Thomas De Schampheleire <thomas.de.schampheleire@gmail.com:
 - move dummy definition from libkmod-internal.h to missing.h
 - update commit title]
---
 libkmod/missing.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libkmod/missing.h b/libkmod/missing.h
index 4c0d136..e123e98 100644
--- a/libkmod/missing.h
+++ b/libkmod/missing.h
@@ -19,6 +19,10 @@
 # define __NR_finit_module -1
 #endif
 
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
 #ifndef HAVE_FINIT_MODULE
 #include <errno.h>
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-10-07  7:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30  7:41 [PATCH] Add dummy definition of O_CLOEXEC Thomas De Schampheleire
2014-10-01 20:48 ` Lucas De Marchi
2014-10-01 20:56   ` Marco d'Itri
2014-10-02  5:31   ` Thomas De Schampheleire
2014-10-02 12:07     ` Lucas De Marchi
2014-10-02 13:29       ` Thomas De Schampheleire
2014-10-02 17:55         ` Lucas De Marchi
2014-10-03 10:27           ` Thomas De Schampheleire
2014-10-06 22:42             ` Lucas De Marchi
2014-10-07  7:09               ` Thomas De Schampheleire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).