Re: [PATCH] fix shmat

From: Randy.Dunlap
Date: Mon Feb 23 2004 - 13:30:20 EST


On Mon, 23 Feb 2004 19:15:04 +0100 Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> wrote:

| From the bitkeeper commit message queue:
|
| >
| > sys_shmat() need to be declared asmlinkage. This causes breakage when we
| > actually get the proper prototypes into caller's scope.
| >
| >
| Why? sys_shmat is not a system call. Or at least there is a comment just
| before the implementation that this is not a syscall.
| I think either the asmlinkage or the comment are wrong:
| /*
| * Fix shmaddr, allocate descriptor, map shm, add attach descriptor to
| lists.
| *
| * NOTE! Despite the name, this is NOT a direct system call entrypoint. The
|
| > * "raddr" thing points to kernel space, and there has to be a wrapper around
| > * this.
| > */
| >-long sys_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
| >+asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
| > {
| > struct shmid_kernel *shp;
| > unsigned long addr;
| >
|
| I'd propose to remove the asmlinkage and to move the prototype (without
| asmlinkage) back from syscalls.h to shm.h - what do you think?

It's not a syscall AFAICT.
It's not listed in any .S files, like most syscalls are.
However, it is listed in kernel/sys.c as a "cond_syscall",
which I'm guessing is incorrect.

I'd like to rename it so that it doesn't begin with "sys_".

--
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/