Explorar o código

previous commit of trimming __IPC_64 wasnt quite correct ... rework __IPC_64 so that it will compile and it is correct

Mike Frysinger %!s(int64=19) %!d(string=hai) anos
pai
achega
ba4c380d51
Modificáronse 2 ficheiros con 18 adicións e 10 borrados
  1. 9 5
      libc/misc/sysvipc/msgq.c
  2. 9 5
      libc/misc/sysvipc/shm.c

+ 9 - 5
libc/misc/sysvipc/msgq.c

@@ -6,14 +6,18 @@
 #ifdef L_msgctl
 
 #ifdef __NR_msgctl
-_syscall3(int, msgctl, int, msqid, int, cmd, struct msqid_ds *, buf);
-#else
+#define __NR___libc_msgctl __NR_msgctl
+_syscall3(int, __libc_msgctl, int, msqid, int, cmd, struct msqid_ds *, buf);
+#endif
 /* Message queue control operation.  */
-int msgctl (int msqid, int cmd, struct msqid_ds *buf)
+int msgctl(int msqid, int cmd, struct msqid_ds *buf)
 {
-    return __syscall_ipc(IPCOP_msgctl ,msqid ,cmd | __IPC_64 ,0 ,buf);
-}
+#ifdef __NR_msgctl
+	return __libc_msgctl(msqid, cmd | __IPC_64, buf);
+#else
+    return __syscall_ipc(IPCOP_msgctl, msqid, cmd | __IPC_64, 0, buf);
 #endif
+}
 #endif
 
 

+ 9 - 5
libc/misc/sysvipc/shm.c

@@ -48,13 +48,17 @@ void * shmat (int shmid, const void *shmaddr, int shmflg)
 #ifdef L_shmctl
 /* Provide operations to control over shared memory segments.  */
 #ifdef __NR_shmctl
-_syscall3(int, shmctl, int, shmid, int, cmd, struct shmid_ds *, buf);
-#else
-int shmctl (int shmid, int cmd, struct shmid_ds *buf)
+#define __NR___libc_shmctl __NR_shmctl
+_syscall3(int, __libc_shmctl, int, shmid, int, cmd, struct shmid_ds *, buf);
+#endif
+int shmctl(int shmid, int cmd, struct shmid_ds *buf)
 {
-    return __syscall_ipc(IPCOP_shmctl, shmid, cmd | __IPC_64 , 0, buf);
-}
+#ifdef __NR_shmctl
+	return __libc_shmctl(shmid, cmd | __IPC_64, buf);
+#else
+    return __syscall_ipc(IPCOP_shmctl, shmid, cmd | __IPC_64, 0, buf);
 #endif
+}
 #endif