1 /* vi: set sw=4 ts=4: */
3 * some system calls possibly missing from libc
5 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
6 * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 /* Kernel headers before 2.1.mumble need this on the Alpha to get
30 #include <sys/syscall.h>
31 #if __GNU_LIBRARY__ < 5
32 /* This is needed for libc5 */
33 #include <asm/unistd.h>
37 int sysfs( int option, unsigned int fs_index, char * buf)
39 return(syscall(__NR_sysfs, option, fs_index, buf));
42 int pivot_root(const char * new_root,const char * put_old)
44 #ifndef __NR_pivot_root
45 #warning This kernel does not support the pivot_root syscall
46 #warning -> The pivot_root system call is being stubbed out...
47 /* BusyBox was compiled against a kernel that did not support
48 * the pivot_root system call. To make this application work,
49 * you will need to recompile with a kernel supporting the
50 * pivot_root system call.
52 bb_error_msg("\n\nTo make this application work, you will need to recompile\n"
53 "BusyBox with a kernel supporting the pivot_root system call.\n");
57 return(syscall(__NR_pivot_root, new_root, put_old));
63 #if __GNU_LIBRARY__ < 5 || ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1))
65 /* These syscalls are not included as part of libc5 */
66 int bdflush(int func, int data)
68 return(syscall(__NR_bdflush, func, data));
72 # define __NR_klogctl __NR_syslog
73 int klogctl(int type, char *b, int len)
75 return(syscall(__NR_klogctl, type, b, len));
80 int umount2(const char * special_file, int flags)
82 #ifndef __NR_pivot_root
83 #warning This kernel does not support the umount2 syscall
84 #warning -> The umount2 system call is being stubbed out...
85 /* BusyBox was compiled against a kernel that did not support
86 * the umount2 system call. To make this application work,
87 * you will need to recompile with a kernel supporting the
88 * umount2 system call.
90 bb_error_msg("\n\nTo make this application work, you will need to recompile\n"
91 "BusyBox with a kernel supporting the umount2 system call.\n");
95 return(syscall(__NR_umount2, special_file, flags));
100 #endif /* __GNU_LIBRARY__ < 5 */
106 c-file-style: "linux"