public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] build ipc/utils.c conditional on CONFIG_SYSVIPC
Date: Mon, 23 Feb 2004 15:24:23 +0100	[thread overview]
Message-ID: <20040223142423.GA9114@lst.de> (raw)

except for two tiny little stubs everything depends on CONFIG_SYSVIPC.
Thus move the stubs to the proper place (sem.h) and get rid of the
ifdefs in that file.

Also fix up fork.c to use sem.h insted of it's own externs.


--- 1.8/include/linux/sem.h	Sat Jul  5 08:52:29 2003
+++ edited/include/linux/sem.h	Mon Feb 23 13:39:22 2004
@@ -140,8 +140,18 @@
 asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops,
 			unsigned nsops, const struct timespec __user *timeout);
 
+#ifdef CONFIG_SYSVIPC
+int copy_semundo(unsigned long clone_flags, struct task_struct *p);
 void exit_sem(struct task_struct *p);
+#else
+static inline void exit_sem(struct task_struct *p)
+{
+}
+static inline int copy_semundo(unsigned long clone_flags, struct task_struct *p)
+{
+	return 0;
+}
 
+#endif /* CONFIG_SYSVIPC */
 #endif /* __KERNEL__ */
-
 #endif /* _LINUX_SEM_H */
--- 1.3/ipc/Makefile	Sat Dec 14 13:38:56 2002
+++ edited/ipc/Makefile	Mon Feb 23 13:40:45 2004
@@ -2,6 +2,4 @@
 # Makefile for the linux ipc.
 #
 
-obj-y   := util.o
-
-obj-$(CONFIG_SYSVIPC) += msg.o sem.o shm.o
+obj-$(CONFIG_SYSVIPC) += util.o msg.o sem.o shm.o 
--- 1.16/ipc/util.c	Mon Feb 23 06:24:11 2004
+++ edited/ipc/util.c	Mon Feb 23 13:40:30 2004
@@ -12,7 +12,6 @@
  *            Mingming Cao <cmm@us.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/shm.h>
 #include <linux/init.h>
@@ -25,8 +24,6 @@
 #include <linux/rcupdate.h>
 #include <linux/workqueue.h>
 
-#if defined(CONFIG_SYSVIPC)
-
 #include "util.h"
 
 /**
@@ -531,20 +528,3 @@
 }
 
 #endif /* __ia64__ */
-
-#else
-/*
- * Dummy functions when SYSV IPC isn't configured
- */
-
-int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
-{
-	return 0;
-}
-
-void exit_sem(struct task_struct *tsk)
-{
-	return;
-}
-
-#endif /* CONFIG_SYSVIPC */
--- 1.156/kernel/fork.c	Thu Feb 19 04:42:38 2004
+++ edited/kernel/fork.c	Mon Feb 23 13:39:31 2004
@@ -30,6 +30,7 @@
 #include <linux/futex.h>
 #include <linux/ptrace.h>
 #include <linux/mount.h>
+#include <linux/sem.h>
 
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
@@ -37,9 +38,6 @@
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
-
-extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
-extern void exit_sem(struct task_struct *tsk);
 
 /* The idle threads do not count..
  * Protected by write_lock_irq(&tasklist_lock)

                 reply	other threads:[~2004-02-23 14:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040223142423.GA9114@lst.de \
    --to=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox