If the GNU stat utility is available on your target platforms, then you can invoke it in a way that doesn't make use of the statfs call to detect the mount-point and then search it in the output of mount, e.g. on Linux:
$ mount | grep -F `stat -c %m /boot/grub` | cut -d' ' -f5
ext2
I verified that this invocation of stat only makes use of standard system calls (see CONFORMING TO in the man page of stat(2)):
$ strace stat -c %m /boot/grub/ |& fgrep stat
execve("/usr/bin/stat", ["stat", "-c", "%m", "/boot/grub/"], [/* 65 vars */]) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=218501, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=130224, ...}) = 0
fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=456632, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=14608, ...}) = 0
fstat(3, {st_mode=S_IFREG|0755, st_size=138696, ...}) = 0
statfs("/sys/fs/selinux", 0x7ffe62882ff0) = -1 ENOENT (No such file or directory)
statfs("/selinux", 0x7ffe62882ff0) = -1 ENOENT (No such file or directory)
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=5152256, ...}) = 0
lstat("/boot/grub/", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat("/boot", {st_mode=S_IFDIR|0755, st_size=3072, ...}) = 0
lstat("/boot/grub", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
stat("/boot/grub", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
stat("..", {st_mode=S_IFDIR|0755, st_size=3072, ...}) = 0
stat("..", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/boot", {st_mode=S_IFDIR|0755, st_size=3072, ...}) = 0
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0