+int yaffs_write(int fd, const void *buf, unsigned int nbyte)
+{
+ return yaffsfs_do_write(fd, buf, nbyte, 0, 0);
+}
+
+int yaffs_pwrite(int fd, const void *buf, unsigned int nbyte, unsigned int offset)
+{
+ return yaffsfs_do_write(fd, buf, nbyte, 1, offset);
+}
+
+
+int yaffs_truncate(const YCHAR *path,off_t newSize)
+{
+ yaffs_Object *obj = NULL;
+ int result = YAFFS_FAIL;
+
+ yaffsfs_Lock();
+
+ obj = yaffsfs_FindObject(NULL,path,0);
+ if(obj)
+ obj = yaffs_GetEquivalentObject(obj);
+
+ if(!obj)
+ yaffsfs_SetError(-ENOENT);
+ else if(obj->variantType != YAFFS_OBJECT_TYPE_FILE)
+ yaffsfs_SetError(-EISDIR);
+ else if(obj->myDev->readOnly)
+ yaffsfs_SetError(-EINVAL);
+ else
+ result = yaffs_ResizeFile(obj,newSize);
+
+ yaffsfs_Unlock();
+
+
+ return (result) ? 0 : -1;
+}
+
+int yaffs_ftruncate(int fd, off_t newSize)