summaryrefslogtreecommitdiff
path: root/nuttx/include/unistd.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-20 16:51:12 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-20 16:51:12 +0000
commit360b2b7ab8fd7cf337f02e260346a0f0ecbb8064 (patch)
tree7e83b806156983fa5af8a32715d849762b8c7346 /nuttx/include/unistd.h
parentd913f00d3b4bcbebc12dfa7ea017bacd17464b88 (diff)
downloadpx4-nuttx-360b2b7ab8fd7cf337f02e260346a0f0ecbb8064.tar.gz
px4-nuttx-360b2b7ab8fd7cf337f02e260346a0f0ecbb8064.tar.bz2
px4-nuttx-360b2b7ab8fd7cf337f02e260346a0f0ecbb8064.zip
Restructure header files for POSIX compliance; eliminate compile warnings
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@107 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/unistd.h')
-rw-r--r--nuttx/include/unistd.h54
1 files changed, 51 insertions, 3 deletions
diff --git a/nuttx/include/unistd.h b/nuttx/include/unistd.h
index faf50e3a3..164b5368e 100644
--- a/nuttx/include/unistd.h
+++ b/nuttx/include/unistd.h
@@ -53,6 +53,49 @@
#define ATEXIT_MAX 1
+/* Values for seeking */
+
+#define SEEK_SET 0 /* From the start of the file */
+#define SEEK_CUR 1 /* From the current file offset */
+#define SEEK_END 2 /* From the end of the file */
+
+/* Bit values for the second argument to access */
+
+#define F_OK 0 /* Test existence */
+#define R_OK 1 /* Test read permission */
+#define W_OK 2 /* Test write permission */
+#define X_OK 4 /* Test execute permission */
+
+/* POSIX feature set macros */
+
+#define POSIX_VERSION
+#undef _POSIX_SAVED_IDS
+#undef _POSIX_JOB_CONTROL
+#define _POSIX_REALTIME_SIGNALS 1
+#define _POSIX_MESSAGE_PASSING 1
+#undef _POSIX_MAPPED_FILES
+#undef _POSIX_SHARED_MEMORY_OBJECTS
+#define _POSIX_PRIORITY_SCHEDULING 1
+#define _POSIX_TIMERS
+#undef _POSIX_MEMLOCK
+#undef _POSIX_MEMLOCK_RANGE
+#undef _POSIX_FSYNC
+#define _POSIX_SYNCHRONIZED_IO
+#undef _POSIX_ASYNCHRONOUS_IO
+#undef _POSIX_PRIORITIZED_IO
+
+/* Execution time constants (not supported) */
+
+#undef _POSIX_CHOWN_RESTRICTED
+#undef _POSIX_NO_TRUNC
+#undef _POSIX_VDISABLE
+
+#define _POSIX_SYNC_IO
+#undef _POSIX_ASYNC_IO
+#undef _POSIX_PRIO_IO
+
+#define fsync(f)
+
/************************************************************
* Global Function Prototypes
************************************************************/
@@ -70,12 +113,17 @@ extern "C" {
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 dup(int fildes);
-EXTERN int dup2(int fildes1, int fildes2);
+EXTERN int close(int fd);
+EXTERN int dup(int fildes);
+EXTERN int dup2(int fildes1, int fildes2);
+EXTERN off_t lseek(int fd, off_t offset, int whence);
+EXTERN int read(int fd, void *buf, unsigned int nbytes);
+EXTERN int unlink(const char *path);
+EXTERN int write(int fd, const void *buf, unsigned int nbytes);
#undef EXTERN
#if defined(__cplusplus)