[Feature][ZXW-88]merge P50 version

Only Configure: No
Affected branch: master
Affected module: unknown
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I34667719d9e0e7e29e8e4368848601cde0a48408
diff --git a/ap/os/linux/linux-3.4.x/fs/open.c b/ap/os/linux/linux-3.4.x/fs/open.c
old mode 100644
new mode 100755
index cf1d34f..ece5fe5
--- a/ap/os/linux/linux-3.4.x/fs/open.c
+++ b/ap/os/linux/linux-3.4.x/fs/open.c
@@ -33,6 +33,10 @@
 
 #include "internal.h"
 
+#ifdef CONFIG_SYSVIPC_CROSS_SHM
+#include <../ipc/shm_ctrl.h>
+#endif
+
 int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
 	struct file *filp)
 {
@@ -977,7 +981,9 @@
 	int lookup = build_open_flags(flags, mode, &op);
 	char *tmp = getname(filename);
 	int fd = PTR_ERR(tmp);
-
+#ifdef CONFIG_SYSVIPC_CROSS_SHM
+	char *ptr = NULL;
+#endif	
 	if (!IS_ERR(tmp)) {
 		fd = get_unused_fd_flags(flags);
 		if (fd >= 0) {
@@ -988,6 +994,16 @@
 			} else {
 				fsnotify_open(f);
 				fd_install(fd, f);
+#ifdef CONFIG_SYSVIPC_CROSS_SHM
+				ptr = strrchr(tmp, '/');
+				if (ptr)
+				{
+					if (strncmp(ptr + 1, "remote-", strlen("remote-"))== 0)
+					{
+						f->shm_flags =  SHM_REMOTE_POSIX_YES;
+					}
+				}
+#endif
 			}
 		}
 		putname(tmp);