1 /* vi: set sw=4 ts=4: */
3 * some system calls possibly missing from libc
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 /* Kernel headers before 2.1.mumble need this on the Alpha to get
29 #include <sys/syscall.h>
32 int sysfs( int option, unsigned int fs_index, char * buf)
34 return(syscall(__NR_sysfs, option, fs_index, buf));
37 int pivot_root(const char * new_root,const char * put_old)
39 #ifndef __NR_pivot_root
40 #warning This kernel does not support the pivot_root syscall
41 #warning -> The pivot_root system call is being stubbed out...
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.
47 bb_error_msg("\n\nTo make this application work, you will need to recompile\n"
48 "BusyBox with a kernel supporting the pivot_root system call.\n");
52 return(syscall(__NR_pivot_root, new_root, put_old));
58 /* These syscalls are not included in ancient glibc versions */
59 #if ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1))
61 int bdflush(int func, int data)
63 return(syscall(__NR_bdflush, func, data));
67 # define __NR_klogctl __NR_syslog
68 int klogctl(int type, char *b, int len)
70 return(syscall(__NR_klogctl, type, b, len));
75 int umount2(const char * special_file, int flags)
77 #ifndef __NR_pivot_root
78 #warning This kernel does not support the umount2 syscall
79 #warning -> The umount2 system call is being stubbed out...
80 /* BusyBox was compiled against a kernel that did not support
81 * the umount2 system call. To make this application work,
82 * you will need to recompile with a kernel supporting the
83 * umount2 system call.
85 bb_error_msg("\n\nTo make this application work, you will need to recompile\n"
86 "BusyBox with a kernel supporting the umount2 system call.\n");
90 return(syscall(__NR_umount2, special_file, flags));
101 c-file-style: "linux"