| Is disk mounted? Is this some kind of liveusb version of linux you're working on? lstat is a system call,
meaning it is implemented by the linux kernel. If this is a module you are working on
then lstat might not be available since your module will be running in kernel space
(I know nothing about programming modules). In any case, in order fuor /sbin/init to
be present on the virtual filesystem, the filesystem has to be mounted. If you need
to check for /sbin/init before it's mounted, you might be able to get the bootloader
to do that for you or something. If you cannot get by with your program starting
later in the boot process (i.e. after the filesystem is mounted) and the bootloader
can't help you, than you'll have to search for /sbin/init using direct reads from the
device, which if you are writing a filesystem you should have an idea how to do that.
Good luck! |