diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-11 11:52:24 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-11 11:52:24 -0600 |
commit | e614814eb45be55922eaa60747177a53163c2bd7 (patch) | |
tree | 32cd35ac62a5ce276cee4faedbd3d9544c6a971a /nuttx/include/unistd.h | |
parent | 3da8039196142eec07174a38f11c460ab22f952d (diff) | |
download | px4-nuttx-e614814eb45be55922eaa60747177a53163c2bd7.tar.gz px4-nuttx-e614814eb45be55922eaa60747177a53163c2bd7.tar.bz2 px4-nuttx-e614814eb45be55922eaa60747177a53163c2bd7.zip |
From Lorenz Meier: The implementation of access() as vararg macro has the issue that any function call with the same name (even in a C++ class) will match with it and result in a compile error. I have replaced it with a small function, and tried to have decent documentation as well. This resolves the compile issue, and shouldn’t have negative side effects for users of the function.
Diffstat (limited to 'nuttx/include/unistd.h')
-rw-r--r-- | nuttx/include/unistd.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/nuttx/include/unistd.h b/nuttx/include/unistd.h index 5108faa51..3fbf5698d 100644 --- a/nuttx/include/unistd.h +++ b/nuttx/include/unistd.h @@ -167,8 +167,9 @@ FAR char *getcwd(FAR char *buf, size_t size); /* File path operations */ -int unlink(FAR const char *pathname); +int access(FAR const char *path, int amode); int rmdir(FAR const char *pathname); +int unlink(FAR const char *pathname); /* Execution of programs from files */ @@ -190,8 +191,6 @@ FAR char **getoptargp(void); /* Optional argument following option */ int *getoptindp(void); /* Index into argv */ int *getoptoptp(void); /* unrecognized option character */ -#define access(...) (0) - #undef EXTERN #if defined(__cplusplus) } |