Skip to content

Commit

Permalink
add getopt() stub
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Nov 23, 2024
1 parent e59f85a commit 486b72c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libc/include/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ extern char *optarg;
/* int open(const char* pathname,int flags, ...); */
int close(int fd);
ssize_t read(int fd, void *buf, size_t len) __attribute__ ((weak));;
int getopt(int argc, char *argv[], const char *optstring);

#endif
2 changes: 2 additions & 0 deletions src/libc/src/unistd.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ char *optarg = NULL;
int close(int fd) { return 0; }
ssize_t read(int fd, void *buf, size_t len) { return 0; }
int getpid(void) { return 0; }

int getopt(int argc, char *argv[], const char *optstring) { return -1; }

0 comments on commit 486b72c

Please sign in to comment.