5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25 */
26
27 /* LINTLIBRARY */
28 /* PROTOLIB1 */
29
30 #define __EXTENSIONS__
31
32 #include <aio.h>
33 #include <alloca.h>
34 #include <attr.h>
35 #include <atomic.h>
36 #include <ctype.h>
37 #include <deflt.h>
38 #include <dirent.h>
39 #include <dlfcn.h>
40 #include <door.h>
41 #include <err.h>
42 #include <sys/errno.h>
43 #include <euc.h>
44 #include <fcntl.h>
176 const char *__progname;
177
178 /*
179 * POSIX versions of standard libc routines; these aren't extracted
180 * from the headers above since we cannot #define _POSIX_C_SOURCE.
181 */
182 int __posix_readdir_r(DIR * _RESTRICT_KYWD, struct dirent * _RESTRICT_KYWD,
183 struct dirent ** _RESTRICT_KYWD);
184 int __posix_getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
185 int __posix_getgrnam_r(const char *, struct group *, char *, size_t,
186 struct group **);
187 int __posix_getpwuid_r(uid_t, struct passwd *, char *, size_t,
188 struct passwd **);
189 int __posix_getpwnam_r(const char *, struct passwd *, char *, size_t,
190 struct passwd **);
191 int __posix_sigwait(const sigset_t * _RESTRICT_KYWD, int * _RESTRICT_KYWD);
192 char *__posix_asctime_r(const struct tm *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
193 char *__posix_ctime_r(const time_t *, char *);
194 int __posix_ttyname_r(int, char *, size_t);
195 int __posix_getlogin_r(char *, int);
196
197 /*
198 * XPG4 versions of standard libc routines; these aren't extracted
199 * from the headers above since we cannot #define _XPG4_2.
200 */
201 int __xpg4_putmsg(int, const struct strbuf *, const struct strbuf *, int);
202 int __xpg4_putpmsg(int, const struct strbuf *, const struct strbuf *, int, int);
203
204 /*
205 * These aren't extracted from the headers above because:
206 * - We cannot #define _STRPTIME_DONTZERO
207 * - We cannot #define _XPG5
208 */
209 char *__strptime_dontzero(const char *, const char *, struct tm *);
210 long __sysconf_xpg5(int);
211 wchar_t *__wcstok_xpg5(wchar_t *_RESTRICT_KYWD,
212 const wchar_t *_RESTRICT_KYWD, wchar_t **_RESTRICT_KYWD);
213 size_t __wcsftime_xpg5(wchar_t *_RESTRICT_KYWD, size_t,
214 const wchar_t *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD);
215 wint_t __fgetwc_xpg5(__FILE *);
457 const char *getexecname(void);
458
459 /* getgrnam.c */
460 struct group *getgrnam(const char *name);
461 struct group *getgrgid(gid_t gid);
462 struct group *fgetgrent_r(FILE *, struct group *, char *, int);
463 struct group *getgrent_r(struct group *, char *, int);
464 struct group *getgrgid_r(gid_t, struct group *, char *, int);
465 struct group *getgrnam_r(const char *, struct group *, char *, int);
466
467 /* gethostid.c */
468 long gethostid(void);
469
470 /* gethz.c */
471 int gethz(void);
472
473 /* getisax.c */
474 uint_t getisax(uint32_t *, uint_t);
475
476 /* getlogin.c */
477 char *getlogin(void);
478 char *getlogin_r(char *, int);
479
480 /* getmntent.c */
481 int getmntany(FILE *fd, struct mnttab *mgetp, struct mnttab *mrefp);
482 int getmntent(FILE *fd, struct mnttab *mp);
483
484 /* getnetgrent.c */
485 int setnetgrent(const char *grp);
486 int endnetgrent(void);
487 int getnetgrent(char **machinep, char **namep, char **domainp);
488
489 /* getopt.c */
490 int getopt(int argc, char *const *argv, const char *opts);
491
492 /* getopt_long.c */
493 int getopt_clip(int argc, char *const *argv, const char *optstring,
494 const struct option *long_options, int *long_index);
495 int getopt_long(int argc, char *const *argv, const char *optstring,
496 const struct option *long_options, int *long_index);
497 int getopt_long_only(int argc, char *const *argv, const char *optstring,
|
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25 * Copyright (c) 2013 Gary Mills
26 */
27
28 /* LINTLIBRARY */
29 /* PROTOLIB1 */
30
31 #define __EXTENSIONS__
32
33 #include <aio.h>
34 #include <alloca.h>
35 #include <attr.h>
36 #include <atomic.h>
37 #include <ctype.h>
38 #include <deflt.h>
39 #include <dirent.h>
40 #include <dlfcn.h>
41 #include <door.h>
42 #include <err.h>
43 #include <sys/errno.h>
44 #include <euc.h>
45 #include <fcntl.h>
177 const char *__progname;
178
179 /*
180 * POSIX versions of standard libc routines; these aren't extracted
181 * from the headers above since we cannot #define _POSIX_C_SOURCE.
182 */
183 int __posix_readdir_r(DIR * _RESTRICT_KYWD, struct dirent * _RESTRICT_KYWD,
184 struct dirent ** _RESTRICT_KYWD);
185 int __posix_getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
186 int __posix_getgrnam_r(const char *, struct group *, char *, size_t,
187 struct group **);
188 int __posix_getpwuid_r(uid_t, struct passwd *, char *, size_t,
189 struct passwd **);
190 int __posix_getpwnam_r(const char *, struct passwd *, char *, size_t,
191 struct passwd **);
192 int __posix_sigwait(const sigset_t * _RESTRICT_KYWD, int * _RESTRICT_KYWD);
193 char *__posix_asctime_r(const struct tm *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
194 char *__posix_ctime_r(const time_t *, char *);
195 int __posix_ttyname_r(int, char *, size_t);
196 int __posix_getlogin_r(char *, int);
197 int __posix_getloginx_r(char *, int);
198
199 /*
200 * XPG4 versions of standard libc routines; these aren't extracted
201 * from the headers above since we cannot #define _XPG4_2.
202 */
203 int __xpg4_putmsg(int, const struct strbuf *, const struct strbuf *, int);
204 int __xpg4_putpmsg(int, const struct strbuf *, const struct strbuf *, int, int);
205
206 /*
207 * These aren't extracted from the headers above because:
208 * - We cannot #define _STRPTIME_DONTZERO
209 * - We cannot #define _XPG5
210 */
211 char *__strptime_dontzero(const char *, const char *, struct tm *);
212 long __sysconf_xpg5(int);
213 wchar_t *__wcstok_xpg5(wchar_t *_RESTRICT_KYWD,
214 const wchar_t *_RESTRICT_KYWD, wchar_t **_RESTRICT_KYWD);
215 size_t __wcsftime_xpg5(wchar_t *_RESTRICT_KYWD, size_t,
216 const wchar_t *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD);
217 wint_t __fgetwc_xpg5(__FILE *);
459 const char *getexecname(void);
460
461 /* getgrnam.c */
462 struct group *getgrnam(const char *name);
463 struct group *getgrgid(gid_t gid);
464 struct group *fgetgrent_r(FILE *, struct group *, char *, int);
465 struct group *getgrent_r(struct group *, char *, int);
466 struct group *getgrgid_r(gid_t, struct group *, char *, int);
467 struct group *getgrnam_r(const char *, struct group *, char *, int);
468
469 /* gethostid.c */
470 long gethostid(void);
471
472 /* gethz.c */
473 int gethz(void);
474
475 /* getisax.c */
476 uint_t getisax(uint32_t *, uint_t);
477
478 /* getlogin.c */
479 char *getloginx(void);
480 char *getloginx_r(char *, int);
481 #ifdef getlogin
482 #undef getlogin
483 #endif /* getlogin */
484 char *getlogin(void);
485 #ifdef getlogin_r
486 #undef getlogin_r
487 #endif /* getlogin_r */
488 char *getlogin_r(char *, int);
489
490 /* getmntent.c */
491 int getmntany(FILE *fd, struct mnttab *mgetp, struct mnttab *mrefp);
492 int getmntent(FILE *fd, struct mnttab *mp);
493
494 /* getnetgrent.c */
495 int setnetgrent(const char *grp);
496 int endnetgrent(void);
497 int getnetgrent(char **machinep, char **namep, char **domainp);
498
499 /* getopt.c */
500 int getopt(int argc, char *const *argv, const char *opts);
501
502 /* getopt_long.c */
503 int getopt_clip(int argc, char *const *argv, const char *optstring,
504 const struct option *long_options, int *long_index);
505 int getopt_long(int argc, char *const *argv, const char *optstring,
506 const struct option *long_options, int *long_index);
507 int getopt_long_only(int argc, char *const *argv, const char *optstring,
|