Changeset 422af2b in mainline


Ignore:
Timestamp:
2012-05-12T21:48:24Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
68f57e1
Parents:
af42a2b
Message:

Properly wrap getopt* in libposix

Location:
uspace/lib/posix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/getopt.c

    raf42a2b r422af2b  
    4242    const char *opt_string, const struct option *long_opts, int *long_index)
    4343{
    44         return getopt_long(argc, argv, opt_string, long_opts, long_index);
     44        int rc = getopt_long(argc, argv, opt_string, long_opts, long_index);
     45        posix_optarg = (char *) optarg;
     46        return rc;
    4547}
    4648
     49int posix_getopt(int argc, char * const argv[], const char *opt_string)
     50{
     51        int rc = getopt(argc, argv, opt_string);
     52        posix_optarg = (char *) optarg;
     53        return rc;
     54}
  • uspace/lib/posix/unistd.h

    raf42a2b r422af2b  
    4545extern char *posix_optarg;
    4646extern int optind, opterr, optopt;
    47 extern int getopt(int, char * const [], const char *);
     47extern int posix_getopt(int, char * const [], const char *);
    4848
    4949/* Environment */
     
    143143
    144144#ifndef LIBPOSIX_INTERNAL
     145        #define getopt posix_getopt
    145146        #define optarg posix_optarg
    146147
Note: See TracChangeset for help on using the changeset viewer.