Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
b15d45bf
Commit
b15d45bf
authored
Jul 18, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://lsm.bkbits.net/linus-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
faaab2cf
853ac978
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
49 deletions
+55
-49
include/linux/msg.h
include/linux/msg.h
+29
-0
include/linux/shm.h
include/linux/shm.h
+13
-0
ipc/msg.c
ipc/msg.c
+4
-30
ipc/sem.c
ipc/sem.c
+4
-3
ipc/shm.c
ipc/shm.c
+5
-16
No files found.
include/linux/msg.h
View file @
b15d45bf
...
@@ -63,6 +63,35 @@ struct msginfo {
...
@@ -63,6 +63,35 @@ struct msginfo {
#ifdef __KERNEL__
#ifdef __KERNEL__
/* one msg_msg structure for each message */
struct
msg_msg
{
struct
list_head
m_list
;
long
m_type
;
int
m_ts
;
/* message text size */
struct
msg_msgseg
*
next
;
/* the actual message follows immediately */
};
#define DATALEN_MSG (PAGE_SIZE-sizeof(struct msg_msg))
#define DATALEN_SEG (PAGE_SIZE-sizeof(struct msg_msgseg))
/* one msq_queue structure for each present queue on the system */
struct
msg_queue
{
struct
kern_ipc_perm
q_perm
;
time_t
q_stime
;
/* last msgsnd time */
time_t
q_rtime
;
/* last msgrcv time */
time_t
q_ctime
;
/* last change time */
unsigned
long
q_cbytes
;
/* current number of bytes on queue */
unsigned
long
q_qnum
;
/* number of messages in queue */
unsigned
long
q_qbytes
;
/* max number of bytes on queue */
pid_t
q_lspid
;
/* pid of last msgsnd */
pid_t
q_lrpid
;
/* last receive pid */
struct
list_head
q_messages
;
struct
list_head
q_receivers
;
struct
list_head
q_senders
;
};
asmlinkage
long
sys_msgget
(
key_t
key
,
int
msgflg
);
asmlinkage
long
sys_msgget
(
key_t
key
,
int
msgflg
);
asmlinkage
long
sys_msgsnd
(
int
msqid
,
struct
msgbuf
*
msgp
,
size_t
msgsz
,
int
msgflg
);
asmlinkage
long
sys_msgsnd
(
int
msqid
,
struct
msgbuf
*
msgp
,
size_t
msgsz
,
int
msgflg
);
asmlinkage
long
sys_msgrcv
(
int
msqid
,
struct
msgbuf
*
msgp
,
size_t
msgsz
,
long
msgtyp
,
int
msgflg
);
asmlinkage
long
sys_msgrcv
(
int
msqid
,
struct
msgbuf
*
msgp
,
size_t
msgsz
,
long
msgtyp
,
int
msgflg
);
...
...
include/linux/shm.h
View file @
b15d45bf
...
@@ -71,6 +71,19 @@ struct shm_info {
...
@@ -71,6 +71,19 @@ struct shm_info {
};
};
#ifdef __KERNEL__
#ifdef __KERNEL__
struct
shmid_kernel
/* private to the kernel */
{
struct
kern_ipc_perm
shm_perm
;
struct
file
*
shm_file
;
int
id
;
unsigned
long
shm_nattch
;
unsigned
long
shm_segsz
;
time_t
shm_atim
;
time_t
shm_dtim
;
time_t
shm_ctim
;
pid_t
shm_cprid
;
pid_t
shm_lprid
;
};
/* shm_mode upper byte flags */
/* shm_mode upper byte flags */
#define SHM_DEST 01000
/* segment will be destroyed on last detach */
#define SHM_DEST 01000
/* segment will be destroyed on last detach */
...
...
ipc/msg.c
View file @
b15d45bf
...
@@ -52,34 +52,6 @@ struct msg_msgseg {
...
@@ -52,34 +52,6 @@ struct msg_msgseg {
struct
msg_msgseg
*
next
;
struct
msg_msgseg
*
next
;
/* the next part of the message follows immediately */
/* the next part of the message follows immediately */
};
};
/* one msg_msg structure for each message */
struct
msg_msg
{
struct
list_head
m_list
;
long
m_type
;
int
m_ts
;
/* message text size */
struct
msg_msgseg
*
next
;
/* the actual message follows immediately */
};
#define DATALEN_MSG (PAGE_SIZE-sizeof(struct msg_msg))
#define DATALEN_SEG (PAGE_SIZE-sizeof(struct msg_msgseg))
/* one msq_queue structure for each present queue on the system */
struct
msg_queue
{
struct
kern_ipc_perm
q_perm
;
time_t
q_stime
;
/* last msgsnd time */
time_t
q_rtime
;
/* last msgrcv time */
time_t
q_ctime
;
/* last change time */
unsigned
long
q_cbytes
;
/* current number of bytes on queue */
unsigned
long
q_qnum
;
/* number of messages in queue */
unsigned
long
q_qbytes
;
/* max number of bytes on queue */
pid_t
q_lspid
;
/* pid of last msgsnd */
pid_t
q_lrpid
;
/* last receive pid */
struct
list_head
q_messages
;
struct
list_head
q_receivers
;
struct
list_head
q_senders
;
};
#define SEARCH_ANY 1
#define SEARCH_ANY 1
#define SEARCH_EQUAL 2
#define SEARCH_EQUAL 2
...
@@ -122,13 +94,15 @@ static int newque (key_t key, int msgflg)
...
@@ -122,13 +94,15 @@ static int newque (key_t key, int msgflg)
msq
=
(
struct
msg_queue
*
)
kmalloc
(
sizeof
(
*
msq
),
GFP_KERNEL
);
msq
=
(
struct
msg_queue
*
)
kmalloc
(
sizeof
(
*
msq
),
GFP_KERNEL
);
if
(
!
msq
)
if
(
!
msq
)
return
-
ENOMEM
;
return
-
ENOMEM
;
msq
->
q_perm
.
mode
=
(
msgflg
&
S_IRWXUGO
);
msq
->
q_perm
.
key
=
key
;
id
=
ipc_addid
(
&
msg_ids
,
&
msq
->
q_perm
,
msg_ctlmni
);
id
=
ipc_addid
(
&
msg_ids
,
&
msq
->
q_perm
,
msg_ctlmni
);
if
(
id
==
-
1
)
{
if
(
id
==
-
1
)
{
kfree
(
msq
);
kfree
(
msq
);
return
-
ENOSPC
;
return
-
ENOSPC
;
}
}
msq
->
q_perm
.
mode
=
(
msgflg
&
S_IRWXUGO
);
msq
->
q_perm
.
key
=
key
;
msq
->
q_stime
=
msq
->
q_rtime
=
0
;
msq
->
q_stime
=
msq
->
q_rtime
=
0
;
msq
->
q_ctime
=
CURRENT_TIME
;
msq
->
q_ctime
=
CURRENT_TIME
;
...
...
ipc/sem.c
View file @
b15d45bf
...
@@ -129,6 +129,10 @@ static int newary (key_t key, int nsems, int semflg)
...
@@ -129,6 +129,10 @@ static int newary (key_t key, int nsems, int semflg)
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
memset
(
sma
,
0
,
size
);
memset
(
sma
,
0
,
size
);
sma
->
sem_perm
.
mode
=
(
semflg
&
S_IRWXUGO
);
sma
->
sem_perm
.
key
=
key
;
id
=
ipc_addid
(
&
sem_ids
,
&
sma
->
sem_perm
,
sc_semmni
);
id
=
ipc_addid
(
&
sem_ids
,
&
sma
->
sem_perm
,
sc_semmni
);
if
(
id
==
-
1
)
{
if
(
id
==
-
1
)
{
ipc_free
(
sma
,
size
);
ipc_free
(
sma
,
size
);
...
@@ -136,9 +140,6 @@ static int newary (key_t key, int nsems, int semflg)
...
@@ -136,9 +140,6 @@ static int newary (key_t key, int nsems, int semflg)
}
}
used_sems
+=
nsems
;
used_sems
+=
nsems
;
sma
->
sem_perm
.
mode
=
(
semflg
&
S_IRWXUGO
);
sma
->
sem_perm
.
key
=
key
;
sma
->
sem_base
=
(
struct
sem
*
)
&
sma
[
1
];
sma
->
sem_base
=
(
struct
sem
*
)
&
sma
[
1
];
/* sma->sem_pending = NULL; */
/* sma->sem_pending = NULL; */
sma
->
sem_pending_last
=
&
sma
->
sem_pending
;
sma
->
sem_pending_last
=
&
sma
->
sem_pending
;
...
...
ipc/shm.c
View file @
b15d45bf
...
@@ -28,20 +28,6 @@
...
@@ -28,20 +28,6 @@
#include "util.h"
#include "util.h"
struct
shmid_kernel
/* private to the kernel */
{
struct
kern_ipc_perm
shm_perm
;
struct
file
*
shm_file
;
int
id
;
unsigned
long
shm_nattch
;
unsigned
long
shm_segsz
;
time_t
shm_atim
;
time_t
shm_dtim
;
time_t
shm_ctim
;
pid_t
shm_cprid
;
pid_t
shm_lprid
;
};
#define shm_flags shm_perm.mode
#define shm_flags shm_perm.mode
static
struct
file_operations
shm_file_operations
;
static
struct
file_operations
shm_file_operations
;
...
@@ -193,6 +179,10 @@ static int newseg (key_t key, int shmflg, size_t size)
...
@@ -193,6 +179,10 @@ static int newseg (key_t key, int shmflg, size_t size)
shp
=
(
struct
shmid_kernel
*
)
kmalloc
(
sizeof
(
*
shp
),
GFP_USER
);
shp
=
(
struct
shmid_kernel
*
)
kmalloc
(
sizeof
(
*
shp
),
GFP_USER
);
if
(
!
shp
)
if
(
!
shp
)
return
-
ENOMEM
;
return
-
ENOMEM
;
shp
->
shm_perm
.
key
=
key
;
shp
->
shm_flags
=
(
shmflg
&
S_IRWXUGO
);
sprintf
(
name
,
"SYSV%08x"
,
key
);
sprintf
(
name
,
"SYSV%08x"
,
key
);
file
=
shmem_file_setup
(
name
,
size
);
file
=
shmem_file_setup
(
name
,
size
);
error
=
PTR_ERR
(
file
);
error
=
PTR_ERR
(
file
);
...
@@ -203,8 +193,7 @@ static int newseg (key_t key, int shmflg, size_t size)
...
@@ -203,8 +193,7 @@ static int newseg (key_t key, int shmflg, size_t size)
id
=
shm_addid
(
shp
);
id
=
shm_addid
(
shp
);
if
(
id
==
-
1
)
if
(
id
==
-
1
)
goto
no_id
;
goto
no_id
;
shp
->
shm_perm
.
key
=
key
;
shp
->
shm_flags
=
(
shmflg
&
S_IRWXUGO
);
shp
->
shm_cprid
=
current
->
pid
;
shp
->
shm_cprid
=
current
->
pid
;
shp
->
shm_lprid
=
0
;
shp
->
shm_lprid
=
0
;
shp
->
shm_atim
=
shp
->
shm_dtim
=
0
;
shp
->
shm_atim
=
shp
->
shm_dtim
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment