Re:Android phone will run Debian Linux soon (like some Pixel...
by Jyaif on Tuesday March 11, 2025 @05:03PM
(#43336971)
> Android's fopen() function is indeed an abstraction over the Linux fopen() system call
Yikes, `fopen` is not a system call...
Re:Android phone will run Debian Linux soon (like some Pixel...
by AdelaideSimone on Wednesday March 12, 2025 @01:42PM
(#43345753)
What exactly is it you're "right" about? How do you think any libc wrapper or direct syscall works? Syscalls are filtered for security reasons on many platforms, including Android. I mean, a syscall is literally an API itself to get a kernel's internals to do something for you.
What you're suggesting is, as someone else said, non-sensical. Phrased without invincible ignorance, it's equivalent to saying, "Android prevents you from creating a new OS kernel to supplant its own control over hardware access," which is true of basically any OS. How helpful or secure would it be if you could make 0 guarantees about how your hardware is used?
You can do direct hardware access through drivers that are integrated/interfaced with the kernel somehow, but this still is not an entirely arbitrary access, and is still going through the kernel in a way.
Yes, Android's fopen() function is indeed an abstraction over the Linux fopen() system call. Android's implementation is part of the Bionic C library, which is Android's custom implementation of the standard C library (libc).
When you call fopen() in Android:
1. You're directly using Bionic's implementation of this standard C library function 2. Bionic ultimately relies on the underlying Linux kernel for actual file operations 3. The function provides the same basic functionality as the standard C library fopen() on other Linux systems
The Bionic library was specifically designed for Android to be more lightweight and optimized for mobile devices compared to the traditional glibc used in most Linux distributions. It maintains the same interface as standard C library functions like fopen() while providing platform-specific optimizations for Android's environment.