aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-05 03:14:39 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-05 03:14:39 +0000
commite76c3b08e105147e3cef7e8d38d65da2fac6b2e1 (patch)
tree87f705b9e4e4e48700ac61e9538c637ae2b395a7 /libbb
parent3c0364f3911ec9f43e1c8c96ec2c8e30b1b52c47 (diff)
downloadbusybox-w32-e76c3b08e105147e3cef7e8d38d65da2fac6b2e1.tar.gz
busybox-w32-e76c3b08e105147e3cef7e8d38d65da2fac6b2e1.tar.bz2
busybox-w32-e76c3b08e105147e3cef7e8d38d65da2fac6b2e1.zip
A number of cleanups. Now compiles with libc5, glibc, and uClibc. Fix a few
shadowed variables. Move (almost) all syscalls to libbb/syscalls.c, so I can handle them sanely and all at once. -Erik
Diffstat (limited to 'libbb')
-rw-r--r--libbb/libbb.h1
-rw-r--r--libbb/syscalls.c72
2 files changed, 61 insertions, 12 deletions
diff --git a/libbb/libbb.h b/libbb/libbb.h
index d850befea..d0896ab86 100644
--- a/libbb/libbb.h
+++ b/libbb/libbb.h
@@ -211,5 +211,6 @@ enum {
211}; 211};
212 212
213int ask_confirmation(void); 213int ask_confirmation(void);
214int klogctl(int type, char * b, int len);
214 215
215#endif /* __LIBBB_H__ */ 216#endif /* __LIBBB_H__ */
diff --git a/libbb/syscalls.c b/libbb/syscalls.c
index 021154602..efca39902 100644
--- a/libbb/syscalls.c
+++ b/libbb/syscalls.c
@@ -32,18 +32,63 @@
32 32
33#include "libbb.h" 33#include "libbb.h"
34 34
35_syscall3(int, sysfs, int, option, unsigned int, fs_index, char *, buf);
35 36
36_syscall1(int, sysinfo, struct sysinfo *, info); 37#ifndef __NR_pivot_root
38#warning This kernel does not support the pivot_root syscall
39#warning -> The pivot_root system call is being stubbed out...
40int pivot_root(const char * new_root,const char * put_old)
41{
42 /* BusyBox was compiled against a kernel that did not support
43 * the pivot_root system call. To make this application work,
44 * you will need to recompile with a kernel supporting the
45 * pivot_root system call.
46 */
47 fprintf(stderr, "\n\nTo make this application work, you will need to recompile\n");
48 fprintf(stderr, "with a kernel supporting the pivot_root system call. -Erik\n\n");
49 errno=ENOSYS;
50 return -1;
51}
52#else
53_syscall2(int,pivot_root,const char *,new_root,const char *,put_old)
54#endif
55
56
57
58
59#if __GNU_LIBRARY__ < 5
60/* These syscalls are not included as part of libc5 */
61_syscall2(int, bdflush, int, func, int, data);
62_syscall1(int, delete_module, const char *, name)
63
64#ifndef __NR_query_module
65#warning This kernel does not support the query_module syscall
66#warning -> The query_module system call is being stubbed out...
67int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret)
68{
69 /* BusyBox was compiled against a kernel that did not support
70 * the query_module system call. To make this application work,
71 * you will need to recompile with a kernel supporting the
72 * query_module system call.
73 */
74 fprintf(stderr, "\n\nTo make this application work, you will need to recompile\n");
75 fprintf(stderr, "with a kernel supporting the query_module system call. -Erik\n\n");
76 errno=ENOSYS;
77 return -1;
78}
79#else
80_syscall5(int, query_module, const char *, name, int, which,
81 void *, buf, size_t, bufsize, size_t*, ret);
82#endif
37 83
38/* Include our own version of <sys/mount.h>, since libc5 doesn't 84#ifndef __alpha__
39 * know about umount2 */ 85# define __NR_klogctl __NR_syslog
40extern _syscall1(int, umount, const char *, special_file); 86 _syscall3(int, klogctl, int, type, char *, b, int, len);
41extern _syscall5(int, mount, const char *, special_file, const char *, dir, 87#endif
42 const char *, fstype, unsigned long int, rwflag, const void *, data);
43 88
44#ifndef __NR_umount2 89#ifndef __NR_umount2
45# warning This kernel does not support the umount2 syscall 90# warning This kernel does not support the umount2 syscall
46# warning The umount2 system call is being stubbed out... 91# warning -> The umount2 system call is being stubbed out...
47int umount2(const char * special_file, int flags) 92int umount2(const char * special_file, int flags)
48{ 93{
49 /* BusyBox was compiled against a kernel that did not support 94 /* BusyBox was compiled against a kernel that did not support
@@ -57,14 +102,17 @@ int umount2(const char * special_file, int flags)
57 return -1; 102 return -1;
58} 103}
59# else 104# else
60extern _syscall2(int, umount2, const char *, special_file, int, flags); 105_syscall2(int, umount2, const char *, special_file, int, flags);
61#endif 106#endif
62 107
63#ifndef __NR_query_module 108
64static const int __NR_query_module = 167; 109#endif /* __GNU_LIBRARY__ < 5 */
110
111
112#if 0
113_syscall1(int, sysinfo, struct sysinfo *, info);
65#endif 114#endif
66_syscall5(int, query_module, const char *, name, int, which, 115
67 void *, buf, size_t, bufsize, size_t*, ret);
68 116
69/* END CODE */ 117/* END CODE */
70/* 118/*