mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org,
	Blaisorblade <blaisorblade_spam@yahoo.it>,
	Chris Wedgwood <cw@f00f.org>
Subject: [PATCH] UML - unistd.h cleanup
Date: Wed, 24 Nov 2004 18:06:31 -0500	[thread overview]
Message-ID: <200411242306.iAON6Vbn005403@ccure.user-mode-linux.org> (raw)

>From Chris Wedgewood - this removes unnecessary cruft from unistd.h

Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: 2.6.9/include/asm-um/unistd.h
===================================================================
--- 2.6.9.orig/include/asm-um/unistd.h	2004-11-14 21:50:38.000000000 -0500
+++ 2.6.9/include/asm-um/unistd.h	2004-11-14 21:54:06.000000000 -0500
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2000, 2001  Jeff Dike (jdike@karaya.com)
+ * Copyright (C) 2000 - 2004  Jeff Dike (jdike@karaya.com)
  * Licensed under the GPL
  */
 
@@ -41,105 +41,29 @@
 #include <linux/compiler.h>
 #include <linux/types.h>
 
-#define KERNEL_CALL(ret_t, sys, args...)	\
-	mm_segment_t fs = get_fs();		\
-	ret_t ret;				\
-	set_fs(KERNEL_DS);			\
-	ret = sys(args);			\
-	set_fs(fs);				\
-	if (ret >= 0)				\
-		return ret;			\
-	errno = -(long)ret;			\
-	return -1;
-
-static inline long open(const char *pathname, int flags, int mode) 
-{
-	KERNEL_CALL(int, sys_open, pathname, flags, mode)
-}
-
-static inline long dup(unsigned int fd)
-{
-	KERNEL_CALL(int, sys_dup, fd);
-}
-
-static inline long close(unsigned int fd)
-{
-	KERNEL_CALL(int, sys_close, fd);
-}
-
-static inline int execve(const char *filename, char *const argv[], 
+static inline int execve(const char *filename, char *const argv[],
 			 char *const envp[])
 {
-	KERNEL_CALL(int, um_execve, filename, argv, envp);
-}
+	mm_segment_t fs;
+	int ret;
 
-static inline long waitpid(pid_t pid, unsigned int *status, int options)
-{
-	KERNEL_CALL(pid_t, sys_wait4, pid, status, options, NULL)
-}
+	fs = get_fs();
+	set_fs(KERNEL_DS);
+	ret = um_execve(filename, argv, envp);
+	set_fs(fs);
 
-static inline pid_t setsid(void)
-{
-	KERNEL_CALL(pid_t, sys_setsid)
-}
-
-static inline off_t lseek(unsigned int fd, off_t offset, unsigned int whence)
-{
-	KERNEL_CALL(long, sys_lseek, fd, offset, whence)
-}
+	if (ret >= 0)
+		return ret;
 
-static inline int read(unsigned int fd, char * buf, int len)
-{
-	KERNEL_CALL(int, sys_read, fd, buf, len)
-}
-
-static inline int write(unsigned int fd, char * buf, int len)
-{
-	KERNEL_CALL(int, sys_write, fd, buf, len)
+	errno = -(long)ret;
+	return -1;
 }
+  
+int sys_execve(char *file, char **argv, char **env);
 
-long sys_mmap2(unsigned long addr, unsigned long len,
-		unsigned long prot, unsigned long flags,
-		unsigned long fd, unsigned long pgoff);
-long sys_execve(char *file, char **argv, char **env);
-long sys_clone(unsigned long clone_flags, unsigned long newsp,
-		int *parent_tid, int *child_tid);
-long sys_fork(void);
-long sys_vfork(void);
-long sys_pipe(unsigned long *fildes);
-struct sigaction;
-asmlinkage long sys_rt_sigaction(int sig,
-				const struct sigaction __user *act,
-				struct sigaction __user *oact,
-				size_t sigsetsize);
-
-#endif
-
-/* Save the value of __KERNEL_SYSCALLS__, undefine it, include the underlying
- * arch's unistd.h for the system call numbers, and restore the old 
- * __KERNEL_SYSCALLS__.
- */
-
-#ifdef __KERNEL_SYSCALLS__
-#define __SAVE_KERNEL_SYSCALLS__ __KERNEL_SYSCALLS__
-#endif
+#endif /* __KERNEL_SYSCALLS__ */
 
 #undef __KERNEL_SYSCALLS__
 #include "asm/arch/unistd.h"
 
-#ifdef __KERNEL_SYSCALLS__
-#define __KERNEL_SYSCALLS__ __SAVE_KERNEL_SYSCALLS__
-#endif
-
-#endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
+#endif /* _UM_UNISTD_H_*/


                 reply	other threads:[~2004-11-25  0:30 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=200411242306.iAON6Vbn005403@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=akpm@osdl.org \
    --cc=blaisorblade_spam@yahoo.it \
    --cc=cw@f00f.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®