aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authordavem <davem>1996-02-25 06:46:41 +0000
committerdavem <davem>1996-02-25 06:46:41 +0000
commitd4e5767dab7e1c498747a726247f558d25b3b7e7 (patch)
treeebe1a22e9eb086ae2d30a5720af879c551cbc3e7 /ipc
parent67329859a68295798591af0a6ce52d22865282d2 (diff)
downloadnetdev-vger-cvs-d4e5767dab7e1c498747a726247f558d25b3b7e7.tar.gz
Merge to 1.3.68
Diffstat (limited to 'ipc')
-rw-r--r--ipc/msg.c31
-rw-r--r--ipc/util.c3
2 files changed, 16 insertions, 18 deletions
diff --git a/ipc/msg.c b/ipc/msg.c
index aad0973ec..fc3c4ed5d 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -6,7 +6,7 @@
*
*/
-#include <linux/autoconf.h>
+#include <linux/config.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/msg.h>
@@ -78,7 +78,7 @@ static int real_msgsnd (int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg
if (msq->msg_perm.seq != (unsigned int) msqid / MSGMNI)
return -EIDRM;
/*
- * Non-root processes may send to kerneld!
+ * Non-root processes may receive from kerneld!
* i.e. no permission check if called from the kernel
* otoh we don't want user level non-root snoopers...
*/
@@ -102,7 +102,8 @@ static int real_msgsnd (int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg
}
/* allocate message header and text space*/
- msgh = (struct msg *) kmalloc (sizeof(*msgh) + msgsz, GFP_USER);
+ msgh = (struct msg *) kmalloc (sizeof(*msgh) + msgsz,
+ (intr_count ? GFP_ATOMIC : GFP_USER));
if (!msgh)
return -ENOMEM;
msgh->msg_spot = (char *) (msgh + 1);
@@ -190,7 +191,7 @@ static int real_msgrcv (int msqid, struct msgbuf *msgp, size_t msgsz, long msgty
return -EIDRM;
if ((msgflg & IPC_KERNELD) == 0)
/*
- * Non-root processes may recieve from kerneld!
+ * Non-root processes may receive from kerneld!
* i.e. no permission check if called from the kernel
* otoh we don't want user level non-root snoopers...
*/
@@ -554,7 +555,7 @@ asmlinkage int sys_msgctl (int msqid, int cmd, struct msqid_ds *buf)
/*
* We do perhaps need a "flush" for waiting processes,
* so that if they are terminated, a call from do_exit
- * will minimize the possibility of orphaned recieved
+ * will minimize the possibility of orphaned received
* messages in the queue. For now we just make sure
* that the queue is shut down whenever kerneld dies.
*/
@@ -605,6 +606,13 @@ int kerneld_send(int msgtype, int ret_size, int msgsz,
struct kerneld_msg kmsp = { msgtype, 0, (char *)text };
int msgflg = S_IRUSR | S_IWUSR | IPC_KERNELD | MSG_NOERROR;
+ if (kerneld_msqid == -1)
+ return -ENODEV;
+
+ /* Do not wait for an answer at interrupt-time! */
+ if (intr_count)
+ ret_size &= ~KERNELD_WAIT;
+
msgsz += sizeof(long);
if (ret_size & KERNELD_WAIT) {
if (++id <= 0)
@@ -612,22 +620,9 @@ int kerneld_send(int msgtype, int ret_size, int msgsz,
kmsp.id = id;
}
- if (kerneld_msqid == -1)
- return -ENODEV;
-
status = real_msgsnd(kerneld_msqid, (struct msgbuf *)&kmsp, msgsz, msgflg);
if ((status >= 0) && (ret_size & KERNELD_WAIT)) {
ret_size &= ~KERNELD_WAIT;
- if (intr_count) {
- /*
- * Do not wait for an answer at interrupt-time!
- * OK, so fake it...
- * If the kerneld request failed in user-space
- * we will find out eventually, and retry again!
- */
- return 0; /* i.e. say that it worked... */
- }
- /* else */
kmsp.text = (char *)ret_val;
status = real_msgrcv(kerneld_msqid, (struct msgbuf *)&kmsp,
sizeof(long) + ((ret_val)?ret_size:0),
diff --git a/ipc/util.c b/ipc/util.c
index c2d3dc883..89a7c3359 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -118,4 +118,7 @@ asmlinkage int sys_shmctl (int shmid, int cmd, struct shmid_ds *buf)
return -ENOSYS;
}
+void kerneld_exit(void)
+{
+}
#endif /* CONFIG_SYSVIPC */