📄 lseek_r.c
字号:
#include <reent.h>#include <errno.h>#include <devices.h>#include <ioctl.h>#include <sysdefs.h>#include <iface.h>_off_t _lseek_r (struct _reent *ptr, int fd, _off_t pos, int whence){#ifdef HAS_MMCstruct IOCTLSEEKSTRUCT { _off_t * pos; int * whence;} IOCTL_SEEKER;int idx; // look thru device table for this device. if ((idx = find_device (ptr, DEVICE_TYPE(fd))) == -1) return -1; // call function if defined. if (device_table_list [idx].item->ioctl) { IOCTL_SEEKER.pos = &pos; IOCTL_SEEKER.whence = &whence; return device_table_list [idx].item->ioctl (ptr, fd, IOCTL_MMC_SEEK, &IOCTL_SEEKER); }#endif ptr->_errno = EBADF; return -1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -