Created px4_access to handle check of virtual files

uORBManager_posix.cpp did a stat to see if a file exists but the
file is actually a virtual file. Using stat was incorrect because
it required a stat buffer that was never used. The POSIX access
function is a better choice so I created a px4_access version to
handle virtual files.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-06-03 16:22:14 -07:00
parent 9882b78383
commit f985a48fbc
3 changed files with 15 additions and 5 deletions
+2
View File
@@ -67,6 +67,7 @@ typedef struct pollfd px4_pollfd_struct_t;
#define px4_read _GLOBAL read
#define px4_poll _GLOBAL poll
#define px4_fsync _GLOBAL fsync
#define px4_access _GLOBAL access
#elif defined(__PX4_POSIX)
@@ -96,6 +97,7 @@ __EXPORT ssize_t px4_write(int fd, const void *buffer, size_t buflen);
__EXPORT int px4_ioctl(int fd, int cmd, unsigned long arg);
__EXPORT int px4_poll(px4_pollfd_struct_t *fds, nfds_t nfds, int timeout);
__EXPORT int px4_fsync(int fd);
__EXPORT int px4_access(const char *pathname, int mode);
__END_DECLS
#else