mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
fs: Remove the unused nx_[v]ioctl to prefer file_[v]ioctl for kernel
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
06d0dbc927
commit
aa31648c9f
+16
-57
@@ -128,28 +128,6 @@ int file_vioctl(FAR struct file *filep, int req, va_list ap)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: nx_vioctl
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
static int nx_vioctl(int fd, int req, va_list ap)
|
|
||||||
{
|
|
||||||
FAR struct file *filep;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Get the file structure corresponding to the file descriptor. */
|
|
||||||
|
|
||||||
ret = fs_getfilep(fd, &filep);
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Let file_vioctl() do the real work. */
|
|
||||||
|
|
||||||
return file_vioctl(filep, req, ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -186,37 +164,6 @@ int file_ioctl(FAR struct file *filep, int req, ...)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: nx_ioctl
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* nx_ioctl() is similar to the standard 'ioctl' interface except that is
|
|
||||||
* not a cancellation point and it does not modify the errno variable.
|
|
||||||
*
|
|
||||||
* nx_ioctl() is an internal NuttX interface and should not be called from
|
|
||||||
* applications.
|
|
||||||
*
|
|
||||||
* Returned Value:
|
|
||||||
* Returns a non-negative number on success; A negated errno value is
|
|
||||||
* returned on any failure (see comments ioctl() for a list of appropriate
|
|
||||||
* errno values).
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
int nx_ioctl(int fd, int req, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Let nx_vioctl() do the real work. */
|
|
||||||
|
|
||||||
va_start(ap, req);
|
|
||||||
ret = nx_vioctl(fd, req, ap);
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ioctl
|
* Name: ioctl
|
||||||
*
|
*
|
||||||
@@ -247,20 +194,32 @@ int nx_ioctl(int fd, int req, ...)
|
|||||||
|
|
||||||
int ioctl(int fd, int req, ...)
|
int ioctl(int fd, int req, ...)
|
||||||
{
|
{
|
||||||
|
FAR struct file *filep;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Let nx_vioctl() do the real work. */
|
/* Get the file structure corresponding to the file descriptor. */
|
||||||
|
|
||||||
|
ret = fs_getfilep(fd, &filep);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Let file_vioctl() do the real work. */
|
||||||
|
|
||||||
va_start(ap, req);
|
va_start(ap, req);
|
||||||
ret = nx_vioctl(fd, req, ap);
|
ret = file_vioctl(filep, req, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
set_errno(-ret);
|
goto err;
|
||||||
ret = ERROR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
err:
|
||||||
|
set_errno(-ret);
|
||||||
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,6 @@
|
|||||||
# define _NX_READ(f,b,s) nx_read(f,b,s)
|
# define _NX_READ(f,b,s) nx_read(f,b,s)
|
||||||
# define _NX_WRITE(f,b,s) nx_write(f,b,s)
|
# define _NX_WRITE(f,b,s) nx_write(f,b,s)
|
||||||
# define _NX_SEEK(f,o,w) nx_seek(f,o,w)
|
# define _NX_SEEK(f,o,w) nx_seek(f,o,w)
|
||||||
# define _NX_IOCTL(f,r,a) nx_ioctl(f,r,a)
|
|
||||||
# define _NX_STAT(p,s) nx_stat(p,s,1)
|
# define _NX_STAT(p,s) nx_stat(p,s,1)
|
||||||
# define _NX_GETERRNO(r) (-(r))
|
# define _NX_GETERRNO(r) (-(r))
|
||||||
# define _NX_SETERRNO(r) set_errno(-(r))
|
# define _NX_SETERRNO(r) set_errno(-(r))
|
||||||
@@ -84,7 +83,6 @@
|
|||||||
# define _NX_READ(f,b,s) read(f,b,s)
|
# define _NX_READ(f,b,s) read(f,b,s)
|
||||||
# define _NX_WRITE(f,b,s) write(f,b,s)
|
# define _NX_WRITE(f,b,s) write(f,b,s)
|
||||||
# define _NX_SEEK(f,o,w) lseek(f,o,w)
|
# define _NX_SEEK(f,o,w) lseek(f,o,w)
|
||||||
# define _NX_IOCTL(f,r,a) ioctl(f,r,a)
|
|
||||||
# define _NX_STAT(p,s) stat(p,s)
|
# define _NX_STAT(p,s) stat(p,s)
|
||||||
# define _NX_GETERRNO(r) errno
|
# define _NX_GETERRNO(r) errno
|
||||||
# define _NX_SETERRNO(r) ((void)(r))
|
# define _NX_SETERRNO(r) ((void)(r))
|
||||||
@@ -1295,25 +1293,6 @@ int file_munmap(FAR void *start, size_t length);
|
|||||||
|
|
||||||
int file_ioctl(FAR struct file *filep, int req, ...);
|
int file_ioctl(FAR struct file *filep, int req, ...);
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: nx_ioctl
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* nx_ioctl() is similar to the standard 'ioctl' interface except that is
|
|
||||||
* not a cancellation point and it does not modify the errno variable.
|
|
||||||
*
|
|
||||||
* nx_ioctl() is an internal NuttX interface and should not be called from
|
|
||||||
* applications.
|
|
||||||
*
|
|
||||||
* Returned Value:
|
|
||||||
* Returns a non-negative number on success; A negated errno value is
|
|
||||||
* returned on any failure (see comments ioctl() for a list of appropriate
|
|
||||||
* errno values).
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
int nx_ioctl(int fd, int req, ...);
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: file_fcntl
|
* Name: file_fcntl
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user