mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
This commit corrects a problem with NSH: NSH was calling the OS internal function ramdisk_register() in violation of the portable POSIX interface. This commit solves the problem by introducing a new boardctl() function BOARDIOC_MKRD which moves the RAM disk creation into the OS.
Squashed commit of the following:
drivers/: Run tools/nxstyle against all drivers/*.c.
boards/boardctl.c: Add new boardctl() command, BOARDIOC_MKRD, that can be used to create a RAM disk. This will replace the illegal call to ramdisk_register() currently used by NSH.
drivers/mkrd.c: Add wrapper around ramdisk_register() for creating a proper ramdisk.
This commit is contained in:
+4
-2
@@ -86,7 +86,8 @@ static const struct file_operations devnull_fops =
|
||||
* Name: devnull_read
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
||||
static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
return 0; /* Return EOF */
|
||||
}
|
||||
@@ -95,7 +96,8 @@ static ssize_t devnull_read(FAR struct file *filep, FAR char *buffer, size_t len
|
||||
* Name: devnull_write
|
||||
****************************************************************************/
|
||||
|
||||
static ssize_t devnull_write(FAR struct file *filep, FAR const char *buffer, size_t len)
|
||||
static ssize_t devnull_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t len)
|
||||
{
|
||||
return len; /* Say that everything was written */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user