Re: [PATCH] add syscalls.h

From: Andrew Morton
Date: Mon Feb 02 2004 - 01:43:28 EST


"Randy.Dunlap" <rddunlap@xxxxxxxx> wrote:
>
> | Date: Tue, 27 Jan 2004 16:46:15 -0800
> | From: Andrew Morton <akpm@xxxxxxxx>
> | Subject: Re: NGROUPS 2.6.2rc2
> |
> |
> [snip]
> | rant. We have soooo many syscalls declared in .c files. We had a bug due
> | to this a while back. Problem is, we have no anointed header in which to
> | place them. include/linux/syscalls.h would suit. And unistd.h for
> | arch-specific syscalls. But that's not appropriate to this patch.
>
>
> I am working on this. Is anyone else?
>
> I have parts 2.6.1-non-arch* ready for testing, I believe,
> except that it will likely require more changes/additions.
>
> I have begun on 2.6.1-arch* but still have a ways to go.
>
> Caveats:
> I have only patched 2.6.1. I will update patches for 2.6.2-rc-current.
> I have only tested by building allmodconfig on P4.
> Have not test-booted yet.
>
> Patch files for 2.6.1 are here:

Looks sane to me.

+ * syscalls.h - Linux syscall interfaces (non-arch-specific)
...
+#include <linux/aio_abi.h>
+#include <linux/sched.h>
+#include <linux/socket.h>
+#include <linux/sysctl.h>
+#include <linux/time.h>
+#include <linux/posix-timers.h>
+#include <linux/uio.h>
+
+#include <asm/signal.h>
+#include <asm/stat.h>

I'd be inclined to lose the includes and just add forward decls for
structs. Of course, you'll need the includes for typedefs.

+extern asmlinkage long sys_unlink(const char __user *pathname);
+extern asmlinkage long sys_chmod(const char __user *filename, mode_t mode);
+extern asmlinkage long sys_fchmod(unsigned int fd, mode_t mode);

Maybe lose the `extern' too. It's just a waste of space. I normally put
it in for consistency if the surrounding code is done that way, but for a
new header file, why bother?

-
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/