mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-25 08:47:16 +00:00
rt_device_write/read return data type as rt_ssize_t
rt_ssize_t can give negative error code, which follows the unix style correctly
This commit is contained in:
committed by
Man, Jianting (Meco)
parent
890c1c9264
commit
f58d3c5200
@@ -12,13 +12,13 @@
|
||||
|
||||
static struct rt_device zero_dev;
|
||||
|
||||
static rt_size_t zero_read (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size)
|
||||
static rt_ssize_t zero_read (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size)
|
||||
{
|
||||
rt_memset(buffer, 0, size);
|
||||
return size;
|
||||
}
|
||||
|
||||
static rt_size_t zero_write (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size)
|
||||
static rt_ssize_t zero_write (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size)
|
||||
{
|
||||
return size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user