diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-06-10 18:13:03 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-06-10 18:13:03 +0000 |
commit | a9dc123d70ff797d53263df6806d48a3a8def394 (patch) | |
tree | f0eb57d3ce64f26bfdae3a326bdc8d04faf779f9 /nuttx/include/unistd.h | |
parent | 3a72b47c0c54a63a0abfc3bfd8510ed7f2fc10b9 (diff) | |
download | px4-nuttx-a9dc123d70ff797d53263df6806d48a3a8def394.tar.gz px4-nuttx-a9dc123d70ff797d53263df6806d48a3a8def394.tar.bz2 px4-nuttx-a9dc123d70ff797d53263df6806d48a3a8def394.zip |
Add getopt
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@286 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/unistd.h')
-rw-r--r-- | nuttx/include/unistd.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/nuttx/include/unistd.h b/nuttx/include/unistd.h index 4e843c5eb..03f617b6c 100644 --- a/nuttx/include/unistd.h +++ b/nuttx/include/unistd.h @@ -97,7 +97,7 @@ #define fdatasync(f) fsync(f) /************************************************************ - * Global Function Prototypes + * Global Variables ************************************************************/ #undef EXTERN @@ -108,6 +108,16 @@ extern "C" { #define EXTERN extern #endif +/* Used by getopt (obviously NOT thread safe!) */ + +EXTERN char *optarg; /* Optional argument following option */ +EXTERN int optind; /* Index into argv */ +EXTERN int optopt; /* unrecognized option character */ + +/************************************************************ + * Global Function Prototypes + ************************************************************/ + /* Task Control Interfaces */ EXTERN pid_t getpid(void); @@ -131,6 +141,10 @@ EXTERN int write(int fd, const void *buf, unsigned int nbytes); EXTERN int unlink(const char *pathname); EXTERN int rmdir(const char *pathname); +/* Other */ + +EXTERN int getopt(int argc, char *const argv[], const char *optstring); + #undef EXTERN #if defined(__cplusplus) } |