4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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.
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]
23 * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2017 Nexenta Systems, Inc.
25 * Copyright 2013 OmniTI Computer Consulting, Inc. All rights reserved.
26 * Copyright (c) 2013 Gary Mills
27 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 * Copyright 2015 Circonus, Inc. All rights reserved.
29 * Copyright 2015 Joyent, Inc.
35 #define __EXTENSIONS__
47 #include <sys/errno.h>
76 #include <rpcsvc/ypclnt.h>
79 #include <semaphore.h>
86 #include <sys/ucred.h>
96 #include <sys/acctctl.h>
98 #include <sys/asynch.h>
99 #include <sys/byteorder.h>
100 #include <sys/cladm.h>
101 #include <sys/corectl.h>
103 #include <sys/epoll.h>
104 #include <sys/exacct.h>
105 #include <sys/fcntl.h>
106 #include <sys/file.h>
107 #include <sys/fs/namenode.h>
108 #include <sys/instance.h>
111 #include <sys/mkdev.h>
112 #include <sys/mman.h>
113 #include <sys/mnttab.h>
114 #include <sys/mount.h>
116 #include <sys/param.h>
117 #include <sys/priocntl.h>
118 #include <sys/procset.h>
119 #include <sys/processor.h>
120 #include <sys/pset.h>
121 #include <sys/rctl_impl.h>
125 #include <sys/signal.h>
126 #include <sys/stat.h>
127 #include <sys/statvfs.h>
128 #include <sys/strlog.h>
129 #include <sys/stropts.h>
130 #include <sys/syscall.h>
131 #include <sys/sysconfig.h>
132 #include <sys/syslog.h>
133 #include <sys/systeminfo.h>
134 #include <sys/task.h>
135 #include <sys/termio.h>
136 #include <sys/termios.h>
137 #include <sys/u8_textprep.h>
138 #include <sys/time.h>
139 #include <sys/timeb.h>
140 #include <sys/times.h>
141 #include <sys/types.h>
142 #include <sys/uadmin.h>
143 #include <sys/utsname.h>
144 #include <sys/vfstab.h>
145 #include <sys/sendfile.h>
146 #include <sys/zone.h>
150 #include <ucontext.h>
160 #include <schedctl.h>
164 #include <inttypes.h>
166 #include <stdio_ext.h>
168 #include <sys/sysi86.h>
171 #include <stack_unwind.h>
176 * This really comes from the crt*.s startup modules.
181 * This is a GNU/Linux/BSD compatibility interface,
182 * not declared in any header file.
184 const char *__progname;
187 * POSIX versions of standard libc routines; these aren't extracted
188 * from the headers above since we cannot #define _POSIX_C_SOURCE.
190 int __posix_readdir_r(DIR * _RESTRICT_KYWD, struct dirent * _RESTRICT_KYWD,
191 struct dirent ** _RESTRICT_KYWD);
192 int __posix_getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
193 int __posix_getgrnam_r(const char *, struct group *, char *, size_t,
195 int __posix_getpwuid_r(uid_t, struct passwd *, char *, size_t,
197 int __posix_getpwnam_r(const char *, struct passwd *, char *, size_t,
199 int __posix_sigwait(const sigset_t * _RESTRICT_KYWD, int * _RESTRICT_KYWD);
200 char *__posix_asctime_r(const struct tm *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
201 char *__posix_ctime_r(const time_t *, char *);
202 int __posix_ttyname_r(int, char *, size_t);
203 int __posix_getlogin_r(char *, int);
204 int __posix_getloginx_r(char *, int);
207 * XPG4 versions of standard libc routines; these aren't extracted
208 * from the headers above since we cannot #define _XPG4_2.
210 int __xpg4_putmsg(int, const struct strbuf *, const struct strbuf *, int);
211 int __xpg4_putpmsg(int, const struct strbuf *, const struct strbuf *, int, int);
214 * These aren't extracted from the headers above because:
215 * - We cannot #define _STRPTIME_DONTZERO
216 * - We cannot #define _XPG5
218 char *__strptime_dontzero(const char *, const char *, struct tm *);
219 long __sysconf_xpg5(int);
220 wchar_t *__wcstok_xpg5(wchar_t *_RESTRICT_KYWD,
221 const wchar_t *_RESTRICT_KYWD, wchar_t **_RESTRICT_KYWD);
222 size_t __wcsftime_xpg5(wchar_t *_RESTRICT_KYWD, size_t,
223 const wchar_t *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD);
224 wint_t __fgetwc_xpg5(__FILE *);
225 wint_t __getwc_xpg5(__FILE *);
226 wint_t __getwchar_xpg5(void);
227 wint_t __fputwc_xpg5(wint_t, __FILE *);
228 wint_t __putwc_xpg5(wint_t, __FILE *);
229 wint_t __putwchar_xpg5(wint_t);
230 wchar_t *__fgetws_xpg5(wchar_t *_RESTRICT_KYWD, int, __FILE *_RESTRICT_KYWD);
231 int __fputws_xpg5(const wchar_t *_RESTRICT_KYWD, __FILE *_RESTRICT_KYWD);
232 wint_t __ungetwc_xpg5(wint_t, __FILE *);
235 * /usr/src/lib/libc/port/gen routines
245 int _set_tab(const char *loc, int cat);
248 int _xftw(int ver, const char *path, int (*fn)(), int depth);
251 long a64l(const char *);
258 long labs(long int arg);
261 void _assert(const char *assertion, const char *filename, int line_num);
262 void __assert_c99(const char *assertion, const char *filename, int line_num,
263 const char *funcname);
266 int atexit(void(*func)());
267 void _exithandle(void);
270 double atof(const char *p);
273 int atoi(const char *p);
276 long atol(const char *p);
279 char *basename(char *s);
282 int bcmp(const void *s1, const void *s2, size_t len);
285 void bcopy(const void *s1, void *s2, size_t len);
288 void *bsearch(const void *ky, const void *bs, size_t nel,
289 size_t width, int (*compar)());
292 void bzero(void *sp, size_t len);
295 void *calloc(size_t num, size_t size);
298 int catclose(nl_catd catd);
301 char *catgets(nl_catd catd, int set_num, int msg_num, const char *s);
304 nl_catd catopen(const char *name, int mode);
307 speed_t cfgetispeed(const struct termios *termios_p);
310 speed_t cfgetospeed(const struct termios *termios_p);
313 void cfree(void *p, size_t num, size_t size);
316 int cfsetispeed(struct termios *termios_p, speed_t speed);
319 int cfsetospeed(struct termios *termios_p, speed_t speed);
322 int cftime(char *buf, char *format, const time_t *t);
323 int ascftime(char *buf, const char *format, const struct tm *tm);
329 int closedir(DIR *dirp);
332 size_t confstr(int name, char *buf, size_t length);
335 void setkey(const char *key);
336 void encrypt(char *block, int fake);
337 char *crypt(const char *key, const char *salt);
340 int csetlen(int cset);
341 int csetcol(int cset);
344 char *ctime(const time_t *t);
345 char *ctime_r(const time_t *, char *buf, int);
346 char *asctime(const struct tm *t);
347 char *asctime_r(const struct tm *, char *, int);
367 int daemon(int nochdir, int noclose);
370 int directio(int filedes, int advice);
373 char *dirname(char *s);
376 div_t div(int numer, int denom);
377 ldiv_t ldiv(long int numer, long int denom);
380 double drand48(void);
381 double erand48(unsigned short *xsubi);
382 long krand48(unsigned short *xsubi, unsigned int m);
385 void srand48(long seedval);
386 unsigned short *seed48(unsigned short seed16v[3]);
387 void lcong48(unsigned short param[7]);
388 long nrand48(unsigned short *xsubi);
389 long jrand48(unsigned short *xsubi);
393 int dup2(int fildes, int fildes2);
394 int dup3(int fildes, int fildes2, int flags);
397 char *ecvt(double value, int ndigit, int *_RESTRICT_KYWD decpt,
398 int *_RESTRICT_KYWDsign);
399 char *fcvt(double value, int ndigit, int *_RESTRICT_KYWD decpt,
400 int *_RESTRICT_KYWD sign);
403 uint16_t htole16(uint16_t);
404 uint32_t htole32(uint32_t);
405 uint64_t htole64(uint64_t);
406 uint16_t letoh16(uint16_t);
407 uint32_t letoh32(uint32_t);
408 uint64_t letoh64(uint64_t);
409 uint16_t le16toh(uint16_t);
410 uint32_t le32toh(uint32_t);
411 uint64_t le64toh(uint64_t);
412 uint16_t htobe16(uint16_t);
413 uint32_t htobe32(uint32_t);
414 uint64_t htobe64(uint64_t);
415 uint16_t betoh16(uint16_t);
416 uint32_t betoh32(uint32_t);
417 uint64_t betoh64(uint64_t);
418 uint16_t be16toh(uint16_t);
419 uint32_t be32toh(uint32_t);
420 uint64_t be64toh(uint64_t);
423 void _errfp(FILE *, int, const char *, ...);
424 void _verrfp(FILE *, int, const char *, va_list);
425 void _errxfp(FILE *, int, const char *, ...);
426 void _verrxfp(FILE *, int, const char *, va_list);
427 void _warnfp(FILE *, const char *, ...);
428 void _vwarnfp(FILE *, const char *, va_list);
429 void _warnxfp(FILE *, const char *, ...);
430 void _vwarnxfp(FILE *, const char *, va_list);
435 int euccol(const unsigned char *s);
436 int euclen(const unsigned char *s);
437 int eucscol(const unsigned char *s);
441 int execlp(const char *, const char *, ...);
442 int execvp(const char *name, char *const *argv);
445 int fattach(int fildes, const char *path);
448 int fdetach(const char *path);
454 int flock(int filedes, int operation);
457 int addseverity(int value, const char *string);
458 int fmtmsg(long class, const char *label, int severity, const char *text,
459 const char *action, const char *tag);
462 void freezero(void *, size_t);
465 int ftime(struct timeb *tp);
468 key_t ftok(const char *path, int id);
471 FTSENT *fts_children(FTS *, int);
472 int fts_close(FTS *);
473 FTS *fts_open(char * const *, int, int (*)(const FTSENT **, const FTSENT **));
474 FTSENT *fts_read(FTS *);
475 int fts_set(FTS *, FTSENT *, int);
478 char *gcvt(double number, int ndigit, char *buf);
481 char *getcwd(char *str, size_t size);
484 struct tm *getdate(const char *expression);
495 int getdtablesize(void);
498 char *getenv(const char *name);
501 const char *getexecname(void);
504 struct group *getgrnam(const char *name);
505 struct group *getgrgid(gid_t gid);
506 struct group *fgetgrent_r(FILE *, struct group *, char *, int);
507 struct group *getgrent_r(struct group *, char *, int);
508 struct group *getgrgid_r(gid_t, struct group *, char *, int);
509 struct group *getgrnam_r(const char *, struct group *, char *, int);
512 long gethostid(void);
518 uint_t getisax(uint32_t *, uint_t);
521 char *getloginx(void);
522 char *getloginx_r(char *, int);
525 #endif /* getlogin */
526 char *getlogin(void);
529 #endif /* getlogin_r */
530 char *getlogin_r(char *, int);
533 int getmntany(FILE *fd, struct mnttab *mgetp, struct mnttab *mrefp);
534 int getmntent(FILE *fd, struct mnttab *mp);
537 int setnetgrent(const char *grp);
538 int endnetgrent(void);
539 int getnetgrent(char **machinep, char **namep, char **domainp);
542 int getopt(int argc, char *const *argv, const char *opts);
545 int getopt_clip(int argc, char *const *argv, const char *optstring,
546 const struct option *long_options, int *long_index);
547 int getopt_long(int argc, char *const *argv, const char *optstring,
548 const struct option *long_options, int *long_index);
549 int getopt_long_only(int argc, char *const *argv, const char *optstring,
550 const struct option *long_options, int *long_index);
553 int getpagesize(void);
556 int getpw(uid_t uid, char *buf);
559 struct passwd *getpwnam(const char *name);
560 struct passwd *getpwuid(uid_t uid);
561 struct passwd *fgetpwent_r(FILE *, struct passwd *, char *, int);
562 struct passwd *getpwent_r(struct passwd *, char *, int);
563 struct passwd *getpwnam_r(const char *, struct passwd *, char *, int);
564 struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
567 int getrusage(int who, struct rusage *rusage);
570 int gettimeofday(struct timeval *_RESTRICT_KYWD tp, void *_RESTRICT_KYWD);
575 struct spwd *getspent(void);
576 struct spwd *getspent_r(struct spwd *, char *, int);
577 struct spwd *fgetspent(FILE *f);
578 struct spwd *fgetspent_r(FILE *, struct spwd *, char *, int);
579 struct spwd *getspnam(const char *name);
580 struct spwd *getspnam_r(const char *, struct spwd *, char *, int);
581 int putspent(const struct spwd *p, FILE *f);
584 int str2spwd(const char *, int, void *, char *, int);
587 int getsubopt(char **optionsp, char *const *tokens, char **valuep);
590 char *gettxt(const char *msg_id, const char *dflt_str);
593 char *getusershell(void);
594 void endusershell(void);
595 void setusershell(void);
598 struct utmp *getutent(void);
599 struct utmp *getutid(const struct utmp *entry);
600 struct utmp *getutline(const struct utmp *entry);
601 struct utmp *pututline(const struct utmp *entry);
604 int utmpname(const char *newfile);
605 void updwtmp(const char *file, struct utmp *ut);
606 void getutmp(const struct utmpx *utx, struct utmp *ut);
607 void getutmpx(const struct utmp *ut, struct utmpx *utx);
608 struct utmp *makeut(struct utmp *utmp);
611 struct utmpx *getutxent(void);
612 struct utmpx *getutxid(const struct utmpx *entry);
613 struct utmpx *getutxline(const struct utmpx *entry);
614 struct utmpx *pututxline(const struct utmpx *entry);
615 void setutxent(void);
616 void endutxent(void);
617 int utmpxname(const char *newfile);
618 void updwtmpx(const char *filex, struct utmpx *utx);
619 struct utmpx *makeutx(const struct utmpx *utmp);
620 struct utmpx *modutx(const struct utmpx *utp);
623 int getvfsspec(FILE *fd, struct vfstab *vp, char *special);
624 int getvfsfile(FILE *fd, struct vfstab *vp, char *mountp);
625 int getvfsany(FILE *fd, struct vfstab *vgetp, struct vfstab *vrefp);
626 int getvfsent(FILE *fd, struct vfstab *vp);
629 char *getwd(char *pathname);
632 void getwidth(eucwidth_t *eucstruct);
635 int hcreate(size_t size);
637 ENTRY *hsearch(ENTRY item, ACTION action);
640 size_t iconv(iconv_t cd, const char **_RESTRICT_KYWD inbuf,
641 size_t *_RESTRICT_KYWD inbytesleft, char **_RESTRICT_KYWD outbuf,
642 size_t *_RESTRICT_KYWD outbytesleft);
643 int iconv_close(iconv_t cd);
644 iconv_t iconv_open(const char *tocode, const char *fromcode);
647 intmax_t imaxabs(intmax_t j);
650 imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
653 char *index(const char *sp, int c);
656 int initgroups(const char *uname, gid_t agroup);
659 int innetgr(const char *group, const char *machine, const char *name,
663 void insque(void *elem, void *pred);
664 void remque(void *elem);
667 int isaexec(const char *, char *const *, char *const *);
670 int isastream(int fd);
676 int killpg(pid_t pgrp, int sig);
686 void * lfind(const void *ky, const void *bs, size_t *nelp,
687 size_t width, int (*compar)());
690 struct lconv *localeconv(void);
693 void * lsearch(const void *ky, void *bs, size_t *nelp,
694 size_t width, int (*compar)());
697 int madvise(caddr_t addr, size_t len, int advice);
700 void *malloc(size_t size);
701 void *realloc(void *old, size_t size);
702 void free(void *old);
705 size_t mbstowcs(wchar_t *_RESTRICT_KYWD pwcs, const char *_RESTRICT_KYWD s,
709 int mbtowc(wchar_t *_RESTRICT_KYWD wchar, const char *_RESTRICT_KYWD s,
711 int mblen(const char *s, size_t n);
714 void *memalign(size_t align, size_t nbytes);
717 void *memccpy(void *_RESTRICT_KYWDs, const void *_RESTRICT_KYWD s0, int c,
721 void *memchr(const void *sptr, int c1, size_t n);
724 int memcmp(const void *s1, const void *s2, size_t n);
727 void *memcpy(void *_RESTRICT_KYWD s, const void *_RESTRICT_KYWD s0, size_t n);
730 void *memmove(void *s, const void *s0, size_t n);
733 void *memset(void *sp1, int c, size_t n);
736 dev_t __makedev(const int version, const major_t majdev,
737 const minor_t mindev);
738 major_t __major(const int version, const dev_t devnum);
739 minor_t __minor(const int version, const dev_t devnum);
742 int mkfifo(const char *path, mode_t mode);
745 char *mktemp(char *as);
748 int mlock(caddr_t addr, size_t len);
751 int mlockall(int flags);
754 void monitor(int (*alowpc)(), int (*ahighpc)(), WORD *buffer,
755 size_t bufsize, size_t nfunc);
758 int msync(caddr_t addr, size_t len, int flags);
761 int munlock(caddr_t addr, size_t len);
764 int munlockall(void);
767 void dbm_setdefwrite(DBM *db);
768 int dbm_flush(DBM *db);
769 int dbm_flushpag(DBM *db);
770 DBM *dbm_open(const char *file, int flags, mode_t mode);
771 void dbm_close(DBM *db);
772 int dbm_close_status(DBM *db);
773 datum dbm_fetch(DBM *db, datum key);
774 int dbm_delete(DBM *db, datum key);
775 int dbm_store(DBM *db, datum key, datum dat, int replace);
776 datum dbm_firstkey(DBM *db);
777 datum dbm_nextkey(DBM *db);
778 datum dbm_do_nextkey(DBM *db, datum inkey);
783 int nftw(const char *path, int (*fn)(), int depth, int flags);
786 char *nl_langinfo(nl_item item);
789 DIR *opendir(const char *filename);
794 void perror(const char *s);
800 void psiginfo(const siginfo_t *sip, const char *s);
803 void psignal(int sig, const char *s);
806 char *ptsname(int fd);
807 int unlockpt(int fd);
811 int putenv(char *change);
812 int setenv(const char *envname, const char *envval, int overwrite);
813 int unsetenv(const char *name);
816 int putpwent(const struct passwd *p, FILE *f);
819 void qsort(void *base, size_t n, size_t size, int (*compar)());
825 void srand(unsigned x);
827 int rand_r(unsigned int *);
830 void srandom(unsigned x);
831 char *initstate(unsigned seed, char *arg_state, size_t n);
832 char *setstate(const char *arg_state);
836 int rctl_walk(int (*callback)(const char *, void *), void *walk_data);
837 hrtime_t rctlblk_get_firing_time(rctlblk_t *rblk);
838 uint_t rctlblk_get_global_action(rctlblk_t *rblk);
839 uint_t rctlblk_get_global_flags(rctlblk_t *rblk);
840 uint_t rctlblk_get_local_action(rctlblk_t *rblk, int *signalp);
841 uint_t rctlblk_get_local_flags(rctlblk_t *rblk);
842 id_t rctlblk_get_recipient_pid(rctlblk_t *rblk);
843 rctl_priv_t rctlblk_get_privilege(rctlblk_t *rblk);
844 rctl_qty_t rctlblk_get_value(rctlblk_t *rblk);
845 void rctlblk_set_local_action(rctlblk_t *rblk, uint_t action, int signal);
846 void rctlblk_set_local_flags(rctlblk_t *rblk, uint_t flags);
847 void rctlblk_set_privilege(rctlblk_t *rblk, rctl_priv_t priv);
848 void rctlblk_set_value(rctlblk_t *rblk, rctl_qty_t val);
849 size_t rctlblk_size(void);
852 struct dirent *readdir(DIR *dirp);
855 void *reallocarray(void *, size_t, size_t);
857 /* recallocarray.c */
858 void *recallocarray(void *, size_t, size_t, size_t);
861 char *realpath(const char *_RESTRICT_KYWD raw, char *_RESTRICT_KYWD canon);
864 char *re_comp(const char *sp);
865 int re_exec(const char *p1);
868 char *rindex(const char *sp, int c);
871 int remove(const char *filename);
872 int rename(const char *old, const char *new);
876 void rewinddir(DIR *dirp);
879 int alphasort(const struct dirent **, const struct dirent **);
880 int scandir(const char *dirname, struct dirent *(*namelist[]),
881 int (*select)(const struct dirent *),
882 int (*dcomp)(const struct dirent **, const struct dirent **));
885 int scrwidth(wchar_t c);
888 void seekdir(DIR *dirp, long loc);
891 int pselect(int nfds,
892 fd_set *_RESTRICT_KYWD readfds,
893 fd_set *_RESTRICT_KYWD writefds,
894 fd_set *_RESTRICT_KYWD errorfds,
895 const struct timespec *_RESTRICT_KYWD timeout,
896 const sigset_t *_RESTRICT_KYWD sigmask);
898 fd_set *_RESTRICT_KYWD readfds,
899 fd_set *_RESTRICT_KYWD writefds,
900 fd_set *_RESTRICT_KYWD errorfds,
901 struct timeval *_RESTRICT_KYWD timeout);
904 char *setlocale(int cat, const char *loc);
907 int getpriority(int which, id_t who);
908 int setpriority(int which, id_t who, int prio);
911 int settimeofday(struct timeval *tp, void *);
914 int sigflag(int sig, int flag, int on);
919 int sigsend(idtype_t idtype, id_t id, int sig);
922 int sigfillset(sigset_t *set);
923 int sigemptyset(sigset_t *set);
924 int sigaddset(sigset_t *set, int sig);
925 int sigdelset(sigset_t *set, int sig);
926 int sigismember(const sigset_t *set, int sig);
929 unsigned sleep(unsigned sleep_tm);
932 int (*ssignal(int sig, int (*fn)())) ();
933 int gsignal(int sig);
938 int str2sig(const char *s, int *sigp);
939 int sig2str(int i, char *s);
942 char *strcat(char *_RESTRICT_KYWD s1, const char *_RESTRICT_KYWD s2);
945 char *strchr(const char *sp, int c);
948 int strcmp(const char *s1, const char *s2);
951 char *strcpy(char *_RESTRICT_KYWD s1, const char *_RESTRICT_KYWD s2);
954 size_t strcspn(const char *string, const char *charset);
957 char *strdup(const char *s1);
960 char *strerror(int errnum);
961 int strerror_r(int errnum, char *strerrbuf, size_t buflen);
964 size_t strftime(char *_RESTRICT_KYWD s, size_t maxsize,
965 const char *_RESTRICT_KYWD format,
966 const struct tm *_RESTRICT_KYWD tm);
969 size_t strlen(const char *s);
972 char *strncat(char *_RESTRICT_KYWD s1, const char *_RESTRICT_KYWD s2, size_t n);
975 int strncmp(const char *s1, const char *s2, size_t n);
978 char *strncpy(char *_RESTRICT_KYWD s1, const char *_RESTRICT_KYWD s2, size_t n);
981 char *strpbrk(const char *string, const char *brkset);
984 char *strrchr(const char *sp, int c);
987 char *strsep(char **stringp, const char *delim);
990 size_t strspn(const char *string, const char *charset);
993 char *strstr(const char *as1, const char *as2);
996 double strtod(const char *_RESTRICT_KYWD cp, char **_RESTRICT_KYWD ptr);
997 float strtof(const char *_RESTRICT_KYWD cp, char **_RESTRICT_KYWD ptr);
998 long double strtold(const char *_RESTRICT_KYWD cp, char **_RESTRICT_KYWD ptr);
1001 intmax_t strtoimax(const char *_RESTRICT_KYWD nptr,
1002 char **_RESTRICT_KYWD endptr, int base);
1005 char *strtok(char *_RESTRICT_KYWD string, const char *_RESTRICT_KYWD sepset);
1006 char *strtok_r(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
1007 char **_RESTRICT_KYWD);
1010 long strtol(const char *_RESTRICT_KYWD str, char **_RESTRICT_KYWD nptr,
1014 long long strtonum(const char *, long long, long long, const char **);
1017 unsigned long strtoul(const char *_RESTRICT_KYWD str,
1018 char **_RESTRICT_KYWD nptr, int base);
1021 uintmax_t strtoumax(const char *_RESTRICT_KYWD nptr,
1022 char **_RESTRICT_KYWD endptr, int base);
1025 size_t strxfrm(char *_RESTRICT_KYWD s1, const char *_RESTRICT_KYWD s2,
1027 int strcoll(const char *s1, const char *s2);
1030 void swab(const char *_RESTRICT_KYWD from, char *_RESTRICT_KYWD to, ssize_t n);
1033 int swapctl(int cmd, void *arg);
1036 long sysconf(int name);
1040 void syslog(int pri, const char *fmt, ...);
1041 void vsyslog(int pri, const char *fmt, va_list ap);
1042 void openlog(const char *ident, int logstat, int logfac);
1043 void closelog(void);
1044 int setlogmask(int pmask);
1047 int tcdrain(int fildes);
1050 int tcflow(int fildes, int action);
1053 int tcflush(int fildes, int queue_selector);
1056 int tcgetattr(int fildes, struct termios *termios_p);
1059 pid_t tcgetpgrp(int fd);
1062 pid_t tcgetsid(int fd);
1065 int tcsendbreak(int fildes, int duration);
1068 int tcsetattr(int fildes, int optional_actions,
1069 const struct termios *termios_p);
1072 int tcsetpgrp(int fd, pid_t pgrp);
1078 long telldir(DIR *dirp);
1081 void *tfind(const void *ky, void *const *rtp, int (*compar)());
1084 struct tm *localtime(const time_t *timep);
1085 struct tm *localtime_r(const time_t *_RESTRICT_KYWD, struct tm *_RESTRICT_KYWD);
1086 struct tm *gmtime(const time_t *clock);
1087 struct tm *gmtime_r(const time_t *_RESTRICT_KYWD, struct tm *_RESTRICT_KYWD);
1088 double difftime(time_t time1, time_t time0);
1089 time_t mktime(struct tm *timeptr);
1090 void _ltzset(time_t tim);
1104 int ftruncate(int fildes, off_t len);
1105 int truncate(const char *path, off_t len);
1108 void *tsearch(const void *ky, void **rtp, int (*compar)());
1109 void *tdelete(const void *ky, void **rtp, int (*compar)());
1110 void twalk(const void *rt, void (*action)());
1113 char *ttyname(int f);
1114 char *_ttyname_dev(dev_t rdev, char *buffer, size_t buflen);
1115 char *ttyname_r(int, char *, int);
1121 unsigned ualarm(unsigned usecs, unsigned reload);
1125 long ulimit(int cmd, ...);
1128 int usleep(unsigned n);
1131 void *valloc(size_t size);
1134 pid_t wait(int *stat_loc);
1135 pid_t waitpid(pid_t pid, int *stat_loc, int options);
1136 pid_t wait3(int *status, int options, struct rusage *rp);
1137 pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage);
1140 size_t wcstombs(char *_RESTRICT_KYWD s, const wchar_t *_RESTRICT_KYWD pwcs,
1144 int wctomb(char *s, wchar_t wchar);
1149 int wisprint(wchar_t c);
1152 void _xgetwidth(void);
1155 * /usr/src/lib/libc/port/intl routines
1159 char *bindtextdomain(const char *domain, const char *binding);
1160 char *dcgettext(const char *domain, const char *msg_id, const int category);
1161 char *dgettext(const char *domain, const char *msg_id);
1162 char *gettext(const char *msg_id);
1163 char *textdomain(const char *domain);
1166 * /usr/src/lib/libc/port/print routines
1171 int fprintf(FILE *_RESTRICT_KYWD iop, const char *_RESTRICT_KYWD format, ...);
1175 int printf(const char *_RESTRICT_KYWD format, ...);
1179 int snprintf(char *_RESTRICT_KYWD string, size_t n,
1180 const char *_RESTRICT_KYWD format, ...);
1184 int sprintf(char *_RESTRICT_KYWD string,
1185 const char *_RESTRICT_KYWD format, ...);
1189 int vfprintf(FILE *_RESTRICT_KYWD iop, const char *_RESTRICT_KYWD format,
1194 int vprintf(const char *_RESTRICT_KYWD format, va_list);
1198 int vsnprintf(char *_RESTRICT_KYWD string, size_t n,
1199 const char *_RESTRICT_KYWD format, va_list);
1203 int vsprintf(char *_RESTRICT_KYWD string, const char *_RESTRICT_KYWD format,
1207 * /usr/src/lib/libc/port/regex routines
1211 extern int glob(const char *restrict pattern, int flags,
1212 int(*errfunc)(const char *epath, int eerrno), glob_t *restrict pglob);
1213 extern void globfree(glob_t *pglob);
1216 char *regex(const char *regexp, const char *stringp, ...);
1223 char *regcmp(const char *regexp, ...);
1230 * /usr/src/lib/libc/port/stdio routines
1234 int _filbuf(FILE *iop);
1237 int _flsbuf(int ch, FILE *iop);
1240 int _wrtchk(FILE *iop);
1243 void clearerr(FILE *iop);
1246 char *ctermid(char *s);
1247 char *ctermid_r(char *s);
1250 char *cuserid(char *s);
1255 int _doscan(FILE *iop, const char *fmt, va_list va_alist);
1258 FILE *fdopen(int fd, const char *type);
1261 int feof(FILE *iop);
1264 int ferror(FILE *iop);
1267 int fgetc(FILE *iop);
1270 char *fgets(char *_RESTRICT_KYWD buf, int size, FILE *_RESTRICT_KYWD iop);
1273 int _fileno(FILE *iop);
1276 void _cleanup(void);
1277 FILE *_findiop(void);
1278 typedef unsigned char Uchar;
1279 void _setbufend(FILE *iop, Uchar *end);
1280 Uchar *_realbufend(FILE *iop);
1281 void _bufsync(FILE *iop, Uchar *bufend);
1282 int _xflsbuf(FILE *iop);
1283 int fflush(FILE *iop);
1284 int fclose(FILE *iop);
1287 FILE *fopen(const char *_RESTRICT_KYWD name, const char *_RESTRICT_KYWD type);
1288 FILE *freopen(const char *_RESTRICT_KYWD name, const char *_RESTRICT_KYWD type,
1289 FILE *_RESTRICT_KYWD iop);
1292 int fgetpos(FILE *_RESTRICT_KYWD stream, fpos_t *_RESTRICT_KYWD pos);
1293 int fsetpos(FILE *stream, const fpos_t *pos);
1296 int fputc(int ch, FILE *iop);
1299 int fputs(const char *_RESTRICT_KYWD ptr, FILE *_RESTRICT_KYWD iop);
1302 size_t fread(void *_RESTRICT_KYWD ptr, size_t size, size_t count,
1303 FILE *_RESTRICT_KYWD iop);
1306 int fseek(FILE *iop, long offset, int ptrname);
1309 long ftell(FILE *iop);
1312 size_t fwrite(const void *_RESTRICT_KYWD ptr1, size_t size, size_t count,
1313 FILE *_RESTRICT_KYWD iop);
1316 int getc(FILE *iop);
1322 char *getpass(const char *prompt);
1325 char *getpassphrase(const char *prompt);
1328 char *gets(char *buf);
1331 int getw(FILE *stream);
1334 FILE *popen(const char *cmd, const char *mode);
1335 int pclose(FILE *ptr);
1338 int putc(int ch, FILE *iop);
1341 int putchar(int ch);
1344 int puts(const char *ptr);
1347 int putw(int w, FILE *stream);
1350 void rewind(FILE *iop);
1354 int scanf(const char *_RESTRICT_KYWD fmt, ...);
1357 int fscanf(FILE *_RESTRICT_KYWD iop, const char *_RESTRICT_KYWD fmt, ...);
1360 int sscanf(const char *_RESTRICT_KYWD str, const char *_RESTRICT_KYWD fmt, ...);
1363 void setbuf(FILE *_RESTRICT_KYWD iop, char *_RESTRICT_KYWD abuf);
1366 int setvbuf(FILE *_RESTRICT_KYWD iop, char *_RESTRICT_KYWD abuf, int type,
1370 int system(const char *s);
1373 char *tempnam(const char *dir, const char *pfx);
1376 FILE *tmpfile(void);
1379 char *tmpnam(char *s);
1380 char *tmpnam_r(char *);
1383 int ungetc(int c, FILE *iop);
1386 * /usr/src/lib/libc/port/sys routines
1390 size_t getacct(idtype_t idtype, id_t id, void *buf, size_t bufsize);
1391 int putacct(idtype_t idtype, id_t id, void *buf, size_t bufsize, int flags);
1392 int wracct(idtype_t idtype, id_t id, int flags);
1396 int execl(const char *name, const char *, ...);
1399 int execle(const char *, const char *file, ...);
1402 int execv(const char *file, char *const *argv);
1405 int lockf(int fildes, int function, off_t size);
1408 int meminfo(const uint64_t *inaddr, int addr_count, const uint_t *info_req,
1409 int info_count, uint64_t *outdata, uint_t *validity);
1412 int msgget(key_t key, int msgflg);
1413 int msgctl(int msqid, int cmd, struct msqid_ds *buf);
1414 ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg);
1415 int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg);
1419 int exportfs(char *dir, struct export *ep);
1420 int nfs_getfh(char *path, fhandle_t *fhp);
1425 int pset_create(psetid_t *npset);
1426 int pset_destroy(psetid_t pset);
1427 int pset_assign(psetid_t pset, processorid_t cpu, psetid_t *opset);
1428 int pset_assign_forced(psetid_t pset, processorid_t cpu, psetid_t *opset);
1429 int pset_info(psetid_t pset, int *type, u_int *numcpus, processorid_t *cpulist);
1430 int pset_bind(psetid_t pset, idtype_t idtype, id_t id, psetid_t *opset);
1431 int pset_bind_lwp(psetid_t pset, id_t id, pid_t, psetid_t *opset);
1435 int getrctl(const char *name, rctlblk_t *old_rblk, rctlblk_t *new_rblk,
1437 int setrctl(const char *name, rctlblk_t *old_rblk, rctlblk_t *new_rblk,
1439 /* (private functions) */
1440 int setprojrctl(const char *name, rctlblk_t *new_rblk, size_t size, int flags);
1441 int rctlctl(const char *, rctlblk_t *, int);
1442 size_t rctllist(char *, size_t);
1446 int semctl(int semid, int semnum, int cmd, ...);
1447 int semget(key_t key, int nsems, int semflg);
1448 int semop(int semid, struct sembuf *sops, size_t nsops);
1451 void *shmat(int shmid, const void *shmaddr, int shmflg);
1452 int shmctl(int shmid, int cmd, struct shmid_ds *buf);
1453 #if defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4)
1454 int shmdt(const void *);
1457 #endif /* defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4) */
1458 int shmget(key_t key, size_t size, int shmflg);
1461 taskid_t settaskid(projid_t project, uint_t flags);
1462 taskid_t gettaskid(void);
1463 projid_t getprojid(void);
1466 * /usr/src/lib/libc/port/widec routines
1470 wchar_t *fgetws(wchar_t *_RESTRICT_KYWD ptr, int size,
1471 FILE *_RESTRICT_KYWD iop);
1474 wint_t fputwc(wint_t wc, FILE *iop);
1475 wint_t putwc(wint_t wc, FILE *iop);
1478 int fputws(const wchar_t *_RESTRICT_KYWD ptr, FILE *_RESTRICT_KYWD iop);
1481 wint_t getwchar(void);
1484 void getwidth(eucwidth_t *eucstruct);
1487 wchar_t *getws(wchar_t *ptr);
1490 int iswctype(wint_t wc, wctype_t charclass);
1491 int iswalpha(wint_t c);
1492 int iswupper(wint_t c);
1493 int iswlower(wint_t c);
1494 int iswdigit(wint_t c);
1495 int iswxdigit(wint_t c);
1496 int iswalnum(wint_t c);
1497 int iswspace(wint_t c);
1498 int iswpunct(wint_t c);
1499 int iswprint(wint_t c);
1500 int iswgraph(wint_t c);
1501 int iswcntrl(wint_t c);
1502 int isphonogram(wint_t c);
1503 int isideogram(wint_t c);
1504 int isenglish(wint_t c);
1505 int isnumber(wint_t c);
1506 int isspecial(wint_t c);
1511 wint_t putwchar(wint_t c);
1514 int putws(const wchar_t *ptr);
1519 wchar_t *strtows(wchar_t *s1, char *s2);
1520 char *wstostr(char *s1, wchar_t *s2);
1523 wint_t towupper(wint_t c);
1524 wint_t towlower(wint_t c);
1527 wint_t ungetwc(wint_t wc, FILE *iop);
1530 size_t wcsxfrm(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2,
1532 int wcscoll(const wchar_t *s1, const wchar_t *s2);
1535 #if !defined(__amd64) /* XX64 - fix me */
1536 size_t wcsftime(wchar_t *wcs, size_t maxsize,
1537 const char *format, const struct tm *timeptr);
1538 #endif /* __amd64 */
1541 wint_t fgetwc(FILE *iop);
1542 wint_t getwc(FILE *iop);
1543 int wcwidth(wchar_t wc);
1544 int wcswidth(const wchar_t *pwcs, size_t n);
1547 wchar_t *wcswcs(const wchar_t *ws1, const wchar_t *ws2);
1549 /* wcsxfrm.c - empty file! */
1551 /* wcsxfrm.xpg4.c */
1554 int wisprint(wchar_t c);
1557 int wscasecmp(const wchar_t *s1, const wchar_t *s2);
1560 wchar_t *wcscat(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2);
1561 wchar_t *wscat(wchar_t *s1, const wchar_t *s2);
1564 wchar_t *wcschr(const wchar_t *sp, wchar_t c);
1565 wchar_t *wschr(const wchar_t *sp, wchar_t c);
1568 int wcscmp(const wchar_t *s1, const wchar_t *s2);
1569 int wscmp(const wchar_t *s1, const wchar_t *s2);
1572 int wscol(const wchar_t *s1);
1575 wchar_t *wcscpy(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2);
1576 wchar_t *wscpy(wchar_t *s1, const wchar_t *s2);
1579 size_t wcscspn(const wchar_t *string, const wchar_t *charset);
1580 size_t wscspn(const wchar_t *string, const wchar_t *charset);
1583 wchar_t *wsdup(const wchar_t *s1);
1586 size_t wcslen(const wchar_t *s);
1587 size_t wslen(const wchar_t *s);
1590 int wsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n);
1593 wchar_t *wcsncat(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2,
1595 wchar_t *wsncat(wchar_t *s1, const wchar_t *s2, size_t n);
1598 int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
1599 int wsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
1602 wchar_t *wcsncpy(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2,
1604 wchar_t *wsncpy(wchar_t *s1, const wchar_t *s2, size_t n);
1607 wchar_t *wcspbrk(const wchar_t *string, const wchar_t *brkset);
1608 wchar_t *wspbrk(const wchar_t *string, const wchar_t *brkset);
1611 int wsprintf(wchar_t *wstring, const char *format, ...);
1614 wchar_t *wcsrchr(const wchar_t *sp, wchar_t c);
1615 wchar_t *wsrchr(const wchar_t *sp, wchar_t c);
1618 int wsscanf(wchar_t *s, const char *format, ...);
1623 size_t wcsspn(const wchar_t *string, const wchar_t *charset);
1624 size_t wsspn(const wchar_t *string, const wchar_t *charset);
1627 double wcstod(const wchar_t *_RESTRICT_KYWD cp, wchar_t **_RESTRICT_KYWD ptr);
1628 float wcstof(const wchar_t *_RESTRICT_KYWD cp, wchar_t **_RESTRICT_KYWD ptr);
1629 long double wcstold(const wchar_t *_RESTRICT_KYWD cp,
1630 wchar_t **_RESTRICT_KYWD ptr);
1631 double wstod(const wchar_t *cp, wchar_t **ptr);
1634 #if !defined(__amd64) /* XX64 - fix me */
1635 wchar_t *wcstok(wchar_t *string, const wchar_t *sepset);
1636 wchar_t *wstok(wchar_t *string, const wchar_t *sepset);
1637 #endif /* __amd64 */
1640 long wcstol(const wchar_t *_RESTRICT_KYWD str, wchar_t **_RESTRICT_KYWD ptr,
1642 long long wcstoll(const wchar_t *_RESTRICT_KYWD str,
1643 wchar_t **_RESTRICT_KYWD ptr, int base);
1646 unsigned long wcstoul(const wchar_t *_RESTRICT_KYWD str,
1647 wchar_t **_RESTRICT_KYWD ptr, int base);
1648 unsigned long long wcstoull(const wchar_t *_RESTRICT_KYWD str,
1649 wchar_t **_RESTRICT_KYWD ptr, int base);
1652 intmax_t wcstoimax(const wchar_t *_RESTRICT_KYWD nptr,
1653 wchar_t **_RESTRICT_KYWD endptr, int base);
1654 uintmax_t wcstoumax(const wchar_t *_RESTRICT_KYWD nptr,
1655 wchar_t **_RESTRICT_KYWD endptr, int base);
1658 long wstol(const wchar_t *str, wchar_t **ptr, int base);
1661 long long wstoll(const wchar_t *str, wchar_t **ptr, int base);
1662 long long watoll(const wchar_t *p);
1665 size_t wsxfrm(wchar_t *s1, const wchar_t *s2, size_t n);
1666 int wscoll(const wchar_t *s1, const wchar_t *s2);
1669 * /usr/src/lib/libc/port/gen/event_port.c
1671 int port_dispatch(int port, int flags, int source, int events, uintptr_t object,
1675 * /usr/src/lib/libc/$MACH/gen routines
1680 void *__builtin_alloca(size_t);
1683 * modctl(int arg, ...) and utssys(...) are not available from a header
1684 * file, but our utilities which make use of it should be able to be
1687 int modctl(int arg, ...);
1688 int utssys(void *buf, int arg, int type, void *outbp);
1691 typedef float single;
1692 typedef unsigned extended[3];
1693 typedef long double quadruple;
1694 typedef unsigned fp_exception_field_type;
1696 typedef char decimal_string[512];
1698 enum fp_class_type {
1707 enum fp_direction_type {
1715 enum fp_class_type fpclass;
1729 enum fp_direction_type rd;
1730 enum decimal_form df;
1734 enum decimal_string_form {
1740 fixed_intdotfrac_form,
1742 floating_intdot_form,
1743 floating_dotfrac_form,
1744 floating_intdotfrac_form,
1751 typedef int sigfpe_code_type;
1753 typedef void (*sigfpe_handler_type)();
1755 extern sigfpe_handler_type sigfpe(sigfpe_code_type, sigfpe_handler_type);
1757 extern void single_to_decimal(single *, decimal_mode *, decimal_record *,
1758 fp_exception_field_type *);
1760 extern void double_to_decimal(double *, decimal_mode *, decimal_record *,
1761 fp_exception_field_type *);
1762 extern void extended_to_decimal(extended *, decimal_mode *,
1763 decimal_record *, fp_exception_field_type *);
1764 extern void quadruple_to_decimal(quadruple *, decimal_mode *,
1765 decimal_record *, fp_exception_field_type *);
1766 extern void decimal_to_single(single *, decimal_mode *, decimal_record *,
1767 fp_exception_field_type *);
1768 extern void decimal_to_double(double *, decimal_mode *, decimal_record *,
1769 fp_exception_field_type *);
1770 extern void decimal_to_extended(extended *, decimal_mode *,
1771 decimal_record *, fp_exception_field_type *);
1772 extern void decimal_to_quadruple(quadruple *, decimal_mode *,
1773 decimal_record *, fp_exception_field_type *);
1774 extern void string_to_decimal(char **, int, int, decimal_record *,
1775 enum decimal_string_form *, char **);
1776 extern void func_to_decimal(char **, int, int, decimal_record *,
1777 enum decimal_string_form *, char **,
1778 int (*)(void), int *, int (*)(int));
1779 extern void file_to_decimal(char **, int, int, decimal_record *,
1780 enum decimal_string_form *, char **,
1782 extern char *seconvert(single *, int, int *, int *, char *);
1783 extern char *sfconvert(single *, int, int *, int *, char *);
1784 extern char *sgconvert(single *, int, int, char *);
1785 extern char *econvert(double, int, int *, int *, char *);
1786 extern char *fconvert(double, int, int *, int *, char *);
1787 extern char *gconvert(double, int, int, char *);
1788 extern char *qeconvert(quadruple *, int, int *, int *, char *);
1789 extern char *qfconvert(quadruple *, int, int *, int *, char *);
1790 extern char *qgconvert(quadruple *, int, int, char *);
1792 extern void __assert(const char *, const char *, int);
1794 extern int setjmp(jmp_buf);
1795 extern void longjmp(jmp_buf, int);
1796 extern int sigsetjmp(sigjmp_buf, int);
1797 extern void siglongjmp(sigjmp_buf, int);
1799 int uname(struct utsname *);
1800 int _uname(struct utsname *);
1804 { return (&errno); }
1806 extern int getloadavg(double [], int);
1808 extern long pcsample(uintptr_t [], long);
1810 int fstat(int, struct stat *);
1811 int stat(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
1812 int lstat(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
1813 int mknod(const char *, mode_t, dev_t);
1815 extern int __init_daemon_priv(int, uid_t uid, gid_t gid, ...);
1816 extern void __fini_daemon_priv(const char *, ...);
1817 extern int __init_suid_priv(int, ...);
1818 extern int __priv_bracket(priv_op_t);
1819 extern void __priv_relinquish(void);
1820 extern const char * __priv_getsetbynum(const void *, int);
1821 extern char * __priv_set_to_str(void *, const priv_set_t *, char, int);
1823 /* private interface to get the groups list for a certain user */
1824 int _getgroupsbymember(const char *, gid_t[], int, int);
1826 /* private interface for use only by java */
1827 volatile sc_shared_t *volatile *_thr_schedctl(void);
1829 /* private interface to unmount all autofs mounts */
1830 int _autofssys(enum autofssys_op, void *);
1833 extern int is_system_labeled(void);
1835 extern int uconv_u16tou32(const uint16_t *, size_t *, uint32_t *, size_t *,
1837 extern int uconv_u16tou8(const uint16_t *, size_t *, uchar_t *, size_t *, int);
1838 extern int uconv_u32tou16(const uint32_t *, size_t *, uint16_t *, size_t *,
1840 extern int uconv_u32tou8(const uint32_t *, size_t *, uchar_t *, size_t *, int);
1841 extern int uconv_u8tou16(const uchar_t *, size_t *, uint16_t *, size_t *, int);
1842 extern int uconv_u8tou32(const uchar_t *, size_t *, uint32_t *, size_t *, int);
1843 extern int u8_validate(char *, size_t, char **, int, int *);
1844 extern int u8_strcmp(const char *, const char *, size_t, int, size_t, int *);
1845 extern size_t u8_textprep_str(char *, size_t *, char *, size_t *, int, size_t,
1848 /* private locale interfaces */
1849 wint_t __nextwctype(wint_t, wctype_t);
1850 int __iswrune(wint_t);