vfs/fs_truncate.c:Add socket judgment to return correct errno.
@@ -51,6 +51,7 @@ static int sock_file_ioctl(FAR struct file *filep, int cmd,
unsigned long arg);
static int sock_file_poll(FAR struct file *filep, struct pollfd *fds,
bool setup);
+static int sock_file_truncate(FAR struct file *filep, off_t length);
/****************************************************************************
* Private Data
@@ -65,7 +66,7 @@ static const struct file_operations g_sock_fileops =
NULL, /* seek */
sock_file_ioctl, /* ioctl */
NULL, /* mmap */
- NULL, /* truncate */
+ sock_file_truncate, /* truncate */
sock_file_poll /* poll */
};
@@ -140,6 +141,11 @@ static int sock_file_poll(FAR struct file *filep, FAR struct pollfd *fds,
return psock_poll(filep->f_priv, fds, setup);
}
+static int sock_file_truncate(FAR struct file *filep, off_t length)
+{
+ return -EINVAL;
+}
+
/****************************************************************************
* Public Functions
****************************************************************************/
