00001 00008 #include "sceptre.h" 00009 #include "device.h" 00010 #include <reent.h> 00011 #include <errno.h> 00012 //#include <ioctl.h> 00013 //#include <sysdefs.h> 00014 //#include <iface.h> 00015 00016 00028 _off_t _lseek_r (struct _reent *p_reent, int fd, _off_t pos, int whence) 00029 { 00030 /* TODO: convert for Sceptre 00031 00032 struct IOCTLSEEKSTRUCT 00033 { 00034 _off_t * pos; 00035 int * whence; 00036 } 00037 IOCTL_SEEKER; 00038 int idx; 00039 00040 // Look through device table for this device. 00041 if ((idx = device_find(ptr,DEVICE_TYPE(fd)))==-1) return -1; 00042 00043 // Call function if defined. 00044 if (device_table_list[idx].p_item->ioctl!=0) 00045 { 00046 IOCTL_SEEKER.pos = &pos; 00047 IOCTL_SEEKER.whence = &whence; 00048 return device_table_list [idx].p_item->ioctl(ptr,fd,IOCTL_MMC_SEEK,&IOCTL_SEEKER); 00049 }*/ 00050 00051 p_reent->_errno = EBADF; 00052 return -1; 00053 } 00054