diff options
| -rw-r--r-- | libbb/syscalls.c | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/libbb/syscalls.c b/libbb/syscalls.c index 9e89dbd39..7f7e0f55d 100644 --- a/libbb/syscalls.c +++ b/libbb/syscalls.c | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | #include <sys/syscall.h> | 29 | #include <sys/syscall.h> |
| 30 | #include "libbb.h" | 30 | #include "libbb.h" |
| 31 | 31 | ||
| 32 | int sysfs( int option, unsigned int fs_index, char * buf) | 32 | int sysfs(int option, unsigned int fs_index, char * buf) |
| 33 | { | 33 | { |
| 34 | return(syscall(__NR_sysfs, option, fs_index, buf)); | 34 | return(syscall(__NR_sysfs, option, fs_index, buf)); |
| 35 | } | 35 | } |
| @@ -39,37 +39,37 @@ int pivot_root(const char * new_root,const char * put_old) | |||
| 39 | #ifndef __NR_pivot_root | 39 | #ifndef __NR_pivot_root |
| 40 | #warning This kernel does not support the pivot_root syscall | 40 | #warning This kernel does not support the pivot_root syscall |
| 41 | #warning -> The pivot_root system call is being stubbed out... | 41 | #warning -> The pivot_root system call is being stubbed out... |
| 42 | /* BusyBox was compiled against a kernel that did not support | 42 | /* BusyBox was compiled against a kernel that did not support |
| 43 | * the pivot_root system call. To make this application work, | 43 | * the pivot_root system call. To make this application work, |
| 44 | * you will need to recompile with a kernel supporting the | 44 | * you will need to recompile with a kernel supporting the |
| 45 | * pivot_root system call. | 45 | * pivot_root system call. |
| 46 | */ | 46 | */ |
| 47 | bb_error_msg("\n\nTo make this application work, you will need to recompile\n" | 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"); | 48 | "BusyBox with a kernel supporting the pivot_root system call.\n"); |
| 49 | errno=ENOSYS; | 49 | errno = ENOSYS; |
| 50 | return -1; | 50 | return -1; |
| 51 | #else | 51 | #else |
| 52 | return(syscall(__NR_pivot_root, new_root, put_old)); | 52 | return(syscall(__NR_pivot_root, new_root, put_old)); |
| 53 | #endif | 53 | #endif /* __NR_pivot_root */ |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | 56 | ||
| 57 | 57 | /* These syscalls are not included in ancient glibc versions, | |
| 58 | /* These syscalls are not included in ancient glibc versions */ | 58 | so we have to define them ourselves, whee ! */ |
| 59 | #if ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)) | 59 | #if ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)) |
| 60 | 60 | ||
| 61 | int bdflush(int func, int data) | 61 | int bdflush(int func, int data) |
| 62 | { | 62 | { |
| 63 | return(syscall(__NR_bdflush, func, data)); | 63 | return(syscall(__NR_bdflush, func, data)); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | #ifndef __alpha__ | 66 | #ifndef __alpha__ |
| 67 | # define __NR_klogctl __NR_syslog | 67 | # define __NR_klogctl __NR_syslog |
| 68 | int klogctl(int type, char *b, int len) | 68 | int klogctl(int type, char *b, int len) |
| 69 | { | 69 | { |
| 70 | return(syscall(__NR_klogctl, type, b, len)); | 70 | return(syscall(__NR_klogctl, type, b, len)); |
| 71 | } | 71 | } |
| 72 | #endif | 72 | #endif /* __alpha__ */ |
| 73 | 73 | ||
| 74 | 74 | ||
| 75 | int umount2(const char * special_file, int flags) | 75 | int umount2(const char * special_file, int flags) |
| @@ -77,22 +77,21 @@ int umount2(const char * special_file, int flags) | |||
| 77 | #ifndef __NR_pivot_root | 77 | #ifndef __NR_pivot_root |
| 78 | #warning This kernel does not support the umount2 syscall | 78 | #warning This kernel does not support the umount2 syscall |
| 79 | #warning -> The umount2 system call is being stubbed out... | 79 | #warning -> The umount2 system call is being stubbed out... |
| 80 | /* BusyBox was compiled against a kernel that did not support | 80 | /* BusyBox was compiled against a kernel that did not support |
| 81 | * the umount2 system call. To make this application work, | 81 | * the umount2 system call. To make this application work, |
| 82 | * you will need to recompile with a kernel supporting the | 82 | * you will need to recompile with a kernel supporting the |
| 83 | * umount2 system call. | 83 | * umount2 system call. |
| 84 | */ | 84 | */ |
| 85 | bb_error_msg("\n\nTo make this application work, you will need to recompile\n" | 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"); | 86 | "BusyBox with a kernel supporting the umount2 system call.\n"); |
| 87 | errno=ENOSYS; | 87 | errno = ENOSYS; |
| 88 | return -1; | 88 | return -1; |
| 89 | #else | 89 | #else |
| 90 | return(syscall(__NR_umount2, special_file, flags)); | 90 | return(syscall(__NR_umount2, special_file, flags)); |
| 91 | #endif | 91 | #endif /* __NR_pivot_root */ |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | 94 | #endif /* old glibc check */ | |
| 95 | #endif | ||
| 96 | 95 | ||
| 97 | 96 | ||
| 98 | /* END CODE */ | 97 | /* END CODE */ |
