From a9dc123d70ff797d53263df6806d48a3a8def394 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 10 Jun 2007 18:13:03 +0000 Subject: Add getopt git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@286 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/include/unistd.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'nuttx/include/unistd.h') 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) } -- cgit v1.2.3