include: posix: unistd: Fix prototypes and dependency

For read/write/lseek, use size_t and off_t types, as mandated by
POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html

Also, prototypes of unistd.h functions should not depend on
CONFIG_POSIX_FS, as (many) of them deal with generic I/O, not with
files in filesystem per se.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
Paul Sokolovsky 2018-10-08 18:48:22 +03:00 committed by Anas Nashif
commit 7f9127578b
2 changed files with 7 additions and 7 deletions

View file

@ -151,7 +151,7 @@ int close(int fd)
*
* See IEEE 1003.1
*/
ssize_t write(int fd, char *buffer, unsigned int count)
ssize_t write(int fd, const void *buffer, size_t count)
{
ssize_t rc;
struct fs_file_t *ptr = NULL;
@ -175,7 +175,7 @@ ssize_t write(int fd, char *buffer, unsigned int count)
*
* See IEEE 1003.1
*/
ssize_t read(int fd, char *buffer, unsigned int count)
ssize_t read(int fd, void *buffer, size_t count)
{
ssize_t rc;
struct fs_file_t *ptr = NULL;
@ -199,7 +199,7 @@ ssize_t read(int fd, char *buffer, unsigned int count)
*
* See IEEE 1003.1
*/
int lseek(int fd, int offset, int whence)
off_t lseek(int fd, off_t offset, int whence)
{
int rc;
struct fs_file_t *ptr = NULL;