diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-29 10:59:41 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-29 10:59:41 -0600 |
commit | 0ed665a96d477c8c6824463e11d394ec74ae8914 (patch) | |
tree | a563c6ef46bcf98dfcb21e9caff9b517806b3d50 | |
parent | 214cf002b143826313a81d1b6fc0caacf457d86f (diff) | |
download | px4-nuttx-0ed665a96d477c8c6824463e11d394ec74ae8914.tar.gz px4-nuttx-0ed665a96d477c8c6824463e11d394ec74ae8914.tar.bz2 px4-nuttx-0ed665a96d477c8c6824463e11d394ec74ae8914.zip |
Add some comments
-rw-r--r-- | nuttx/libc/Kconfig | 4 | ||||
-rw-r--r-- | nuttx/libc/misc/lib_ioctl.c | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/nuttx/libc/Kconfig b/nuttx/libc/Kconfig index 2c31a1983..b49b92e31 100644 --- a/nuttx/libc/Kconfig +++ b/nuttx/libc/Kconfig @@ -74,6 +74,10 @@ config LIBC_IOCTL_VARIADIC compatibility if you are porting code from other platforms that use the variadic ioctl() function. + WARNING: Use of this option could cause subtle system errors is + the third argument is omitted or if the sizeof the thread argument + is anything other than sizeof (unsigned long). + config LIB_RAND_ORDER int "Order of the random number generate" default 1 diff --git a/nuttx/libc/misc/lib_ioctl.c b/nuttx/libc/misc/lib_ioctl.c index 9ef09fcd9..65932c12d 100644 --- a/nuttx/libc/misc/lib_ioctl.c +++ b/nuttx/libc/misc/lib_ioctl.c @@ -87,10 +87,14 @@ int ioctl(int fd, int req, ...) va_list ap; unsigned long arg; - /* Get the unsigned long argument */ + /* Get the unsigned long argument. + * + * REVISIT: This could cause of the crash down the road if the actual size + * of the argument is anything other than sizeof(unsigned long); + */ va_start(ap, req); - arg = va_arg(ap, unsigned long ); + arg = va_arg(ap, unsigned long); va_end(ap); /* Then let fs_ioctl() to the real work */ |