nuttx/include/sys
Ansh Rai 54b0066a69 libs/libc: Fix divide-by-zero in stat() with large filesystem block sizes
blksize_t is currently defined as int16_t, which overflows when a
filesystem reports a block size larger than 32767 bytes. This causes
st_blksize to become zero, leading to an integer divide-by-zero when
st_blocks is calculated in stat().

Widen blksize_t to int32_t to support larger filesystem block sizes.

Update nuttx_blksize_t in include/nuttx/fs/hostfs.h to keep it
consistent with include/sys/types.h.

struct geometry.geo_sectorsize (include/nuttx/fs/ioctl.h) is also
typed blksize_t, so every debug print of that field using a 16-bit
format specifier is updated to PRId32 to match the new width:
drivers/misc/ramdisk.c, drivers/mmcsd/mmcsd_spi.c, drivers/mtd/ftl.c,
fs/driver/fs_blockmerge.c, drivers/mtd/smart.c,
drivers/usbhost/usbhost_storage.c, drivers/mmcsd/mmcsd_sdio.c,
arch/arm/src/s32k1xx/s32k1xx_eeeprom.c,
arch/arm/src/lc823450/lc823450_mmcl.c.

Signed-off-by: Ansh Rai <anshrai331@gmail.com>
Signed-off-by: root <root@LAPTOP-9C7LKDC5.localdomain>
2026-07-16 23:37:22 +08:00
..
boardctl.h !boards/boardctl: Remove BOARDIOC_INIT 2026-05-26 09:57:29 +08:00
custom_file.h
endian.h !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-19 16:21:28 +08:00
epoll.h !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-19 16:21:28 +08:00
eventfd.h
fcntl.h fcntl: add sys/fcntl.h header file 2024-12-20 11:46:14 -03:00
file.h
gmon.h
inotify.h
ioctl.h sys/ioctl: extend the IOCTL defintion that compatible with linux kernel 2026-01-14 09:39:51 +08:00
ipc.h
mman.h
mount.h !include/fcntl.h: align open flags with Linux values 2026-06-30 13:43:44 +08:00
msg.h
param.h arm: systick: fix off-by-one in SysTick RELOAD programming 2026-01-26 19:34:00 +08:00
pciio.h
poll.h fs/poll: remove poll_fdsetup 2025-05-26 18:49:45 +08:00
prctl.h proctl: add PR_SET_DUMPABLE support 2024-12-20 11:46:14 -03:00
queue.h
random.h
resource.h sys/resouce: add RLIM_NLIMITS definition 2026-01-15 16:08:23 -03:00
select.h
sem.h sem: add sys/sem.h header file 2024-12-20 11:46:14 -03:00
sendfile.h
shm.h
signal.h signal: add include/sys/signal.h to the signal 2024-12-20 11:46:14 -03:00
signalfd.h
socket.h net: make the sendmsg param type consistent with posix specification 2026-01-16 21:11:39 +08:00
sockio.h
stat.h
statfs.h
statvfs.h
syscall.h
syscall_lookup.h arch, sched/signal: Fix compilation with ENABLE_PARTIAL_SIGNALS=y 2026-06-16 17:07:32 +08:00
sysinfo.h
sysmacros.h
time.h syscall/adjtime: fix minior issue about adjtime and add clock_adjtime to syscall 2025-12-30 10:22:09 -03:00
timerfd.h fs/timerfd: implement TFD_TIMER_CANCEL_ON_SET to detect clock changes 2026-01-30 17:20:24 +08:00
times.h
timex.h sched/clock: support using CLOCKFD to call clock_adjtime 2025-12-30 10:22:09 -03:00
tree.h
types.h libs/libc: Fix divide-by-zero in stat() with large filesystem block sizes 2026-07-16 23:37:22 +08:00
uio.h
un.h
utsname.h
vfs.h
video_controls.h
videoio.h style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
wait.h sys/wait: add WCOREDUMP defintion 2026-01-15 23:16:27 +08:00