9
0
Fork 0

Fix read()/write() prototype

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@820 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2008-08-13 00:32:32 +00:00
parent cd1bcdcb3c
commit 4662009294
6 changed files with 29 additions and 25 deletions

View File

@ -402,4 +402,6 @@
* Removed duplicate getenv() implementation in /lib
* Correct detection of End-of-File in fgets
* Implement sh and crude script handler in NSH
* Fix prototype of read() and write(). Need to use ssize_t and size_t, not
int and unsigned int.

View File

@ -1036,6 +1036,8 @@ nuttx-0.3.13 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
* Removed duplicate getenv() implementation in /lib
* Correct detection of End-of-File in fgets
* Implement sh and crude script handler in NSH
* Fix prototype of read() and write(). Need to use ssize_t and size_t, not
int and unsigned int.
pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>

View File

@ -5917,18 +5917,18 @@ interface of the same name.
<ul><pre>
#include &lt;unistd.h&gt;
int close(int fd);
int dup(int fildes);
int dup2(int fildes1, int fildes2);
off_t lseek(int fd, off_t offset, int whence);
int read(int fd, void *buf, unsigned int nbytes);
int unlink(const char *path);
int write(int fd, const void *buf, unsigned int nbytes);
int close(int fd);
int dup(int fildes);
int dup2(int fildes1, int fildes2);
off_t lseek(int fd, off_t offset, int whence);
ssize_t read(int fd, void *buf, size_t nbytes);
int unlink(const char *path);
ssize_t write(int fd, const void *buf, size_t nbytes);
</pre></ul>
<ul><pre>
#include &lt;sys/ioctl.h&gt;
int ioctl(int fd, int req, unsigned long arg);
int ioctl(int fd, int req, unsigned long arg);
</pre></ul>
<h2><a name="directoryoperations">2.11.3 Directory Operations</a></h2>

View File

@ -53,7 +53,7 @@
* Global Functions
****************************************************************************/
int read(int fd, FAR void *buf, unsigned int nbytes)
ssize_t read(int fd, FAR void *buf, size_t nbytes)
{
FAR struct filelist *list;
int ret = EBADF;

View File

@ -58,7 +58,7 @@
* Global Functions
****************************************************************************/
/********************************************************************************************
/***************************************************************************
* Function: write
*
* Description:
@ -108,7 +108,7 @@
*
********************************************************************************************/
int write(int fd, FAR const void *buf, unsigned int nbytes)
ssize_t write(int fd, FAR const void *buf, size_t nbytes)
{
#if CONFIG_NFILE_DESCRIPTORS > 0
FAR struct filelist *list;

View File

@ -120,32 +120,32 @@ EXTERN int optopt; /* unrecognized option character */
/* Task Control Interfaces */
EXTERN pid_t getpid(void);
EXTERN void _exit(int status) noreturn_function;
EXTERN pid_t getpid(void);
EXTERN void _exit(int status) noreturn_function;
EXTERN unsigned int sleep(unsigned int seconds);
EXTERN void usleep(unsigned long usec);
EXTERN void usleep(unsigned long usec);
/* File descriptor operations */
EXTERN int close(int fd);
EXTERN int dup(int fd);
EXTERN int dup2(int fd1, int fd2);
EXTERN int fsync(int fd);
EXTERN off_t lseek(int fd, off_t offset, int whence);
EXTERN int read(int fd, FAR void *buf, unsigned int nbytes);
EXTERN int write(int fd, FAR const void *buf, unsigned int nbytes);
EXTERN int close(int fd);
EXTERN int dup(int fd);
EXTERN int dup2(int fd1, int fd2);
EXTERN int fsync(int fd);
EXTERN off_t lseek(int fd, off_t offset, int whence);
EXTERN ssize_t read(int fd, FAR void *buf, size_t nbytes);
EXTERN ssize_t write(int fd, FAR const void *buf, size_t nbytes);
/* Special devices */
EXTERN int pipe(int filedes[2]);
EXTERN int pipe(int filedes[2]);
/* File path operations */
EXTERN int unlink(FAR const char *pathname);
EXTERN int rmdir(FAR const char *pathname);
EXTERN int unlink(FAR const char *pathname);
EXTERN int rmdir(FAR const char *pathname);
/* Other */
EXTERN int getopt(int argc, FAR char *const argv[], FAR const char *optstring);
EXTERN int getopt(int argc, FAR char *const argv[], FAR const char *optstring);
#undef EXTERN
#if defined(__cplusplus)