+
+ return retVal;
+}
+
+
+int yaffs_set_wince_times(int fd,
+ const unsigned *wctime,
+ const unsigned *watime,
+ const unsigned *wmtime)
+{
+ yaffs_Object *obj;
+ int result;
+ int retVal = -1;
+
+ yaffsfs_Lock();
+ obj = yaffsfs_GetHandleObject(fd);
+
+ if(obj){
+
+ if(wctime){
+ obj->win_ctime[0] = wctime[0];
+ obj->win_ctime[1] = wctime[1];
+ }
+ if(watime){
+ obj->win_atime[0] = watime[0];
+ obj->win_atime[1] = watime[1];
+ }
+ if(wmtime){
+ obj->win_mtime[0] = wmtime[0];
+ obj->win_mtime[1] = wmtime[1];
+ }
+
+ obj->dirty = 1;
+ result = yaffs_FlushFile(obj,0,0);
+ retVal = 0;
+ } else
+ // bad handle
+ yaffsfs_SetError(-EBADF);
+
+ yaffsfs_Unlock();
+
+ return retVal;
+}
+
+#endif
+
+
+static int yaffsfs_DoChMod(yaffs_Object *obj,mode_t mode)
+{
+ int result = -1;
+
+ if(obj)
+ obj = yaffs_GetEquivalentObject(obj);
+
+ if(obj) {
+ obj->yst_mode = mode;
+ obj->dirty = 1;
+ result = yaffs_FlushFile(obj,0,0);
+ }
+
+ return result == YAFFS_OK ? 0 : -1;
+}
+
+
+int yaffs_access(const YCHAR *path, int amode)
+{
+ yaffs_Object *obj;
+
+ int retval = 0;
+
+ yaffsfs_Lock();
+ obj = yaffsfs_FindObject(NULL,path,0);
+
+ if(obj) {
+ int access_ok = 1;
+
+ if((amode & R_OK) && !(obj->yst_mode & S_IREAD))
+ access_ok = 0;
+ if((amode & W_OK) && !(obj->yst_mode & S_IWRITE))
+ access_ok = 0;
+ if((amode & X_OK) && !(obj->yst_mode & S_IEXEC))
+ access_ok = 0;
+
+ if(!access_ok) {
+ yaffsfs_SetError(-EACCES);
+ retval = -1;
+ }
+ } else {
+ // todo error not found
+ yaffsfs_SetError(-ENOENT);
+ retval = -1;
+ }
+
+ yaffsfs_Unlock();