xref: /titanic_52/usr/src/lib/libc/port/llib-lc (revision 74e20cfe817b82802b16fac8690dadcda76f54f5)
1/*
2 * CDDL HEADER START
3 *
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.
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 2006 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident	"%Z%%M%	%I%	%E% SMI"
28
29/* LINTLIBRARY */
30/* PROTOLIB1 */
31
32#include <aio.h>
33#include <alloca.h>
34#include <atomic.h>
35#include <ctype.h>
36#include <deflt.h>
37#include <dirent.h>
38#include <dlfcn.h>
39#include <door.h>
40#include <sys/errno.h>
41#include <euc.h>
42#include <fcntl.h>
43#include <float.h>
44#include <fmtmsg.h>
45#include <fnmatch.h>
46#include <ftw.h>
47#include <getwidth.h>
48#include <grp.h>
49#include <iconv.h>
50#include <langinfo.h>
51#include <libgen.h>
52#include <libw.h>
53#include <locale.h>
54#include <memory.h>
55#include <mon.h>
56#include <mqueue.h>
57#include <nan.h>
58#include <ndbm.h>
59#include <limits.h>
60#include <nl_types.h>
61#include <project.h>
62#include <priv.h>
63#include <pwd.h>
64#include <rctl.h>
65#include <regex.h>
66#include <rpcsvc/ypclnt.h>
67#include <sched.h>
68#include <search.h>
69#include <semaphore.h>
70#include <setjmp.h>
71#include <shadow.h>
72#include <siginfo.h>
73#include <signal.h>
74#include <stdarg.h>
75#include <ucred.h>
76#include <sys/ucred.h>
77#include <unistd.h>
78#include <ulimit.h>
79#include <utime.h>
80#include <stddef.h>
81#include <stdio.h>
82#include <stdlib.h>
83#include <string.h>
84#include <stropts.h>
85#include <synch.h>
86#include <sys/acctctl.h>
87#include <sys/acl.h>
88#include <sys/asynch.h>
89#include <sys/byteorder.h>
90#include <sys/cladm.h>
91#include <sys/corectl.h>
92#include <sys/dl.h>
93#include <sys/exacct.h>
94#include <sys/fcntl.h>
95#include <sys/file.h>
96#include <sys/vnode.h>
97#include <sys/fs/namenode.h>
98#include <sys/instance.h>
99#include <sys/ipc.h>
100#include <sys/lwp.h>
101#include <sys/mkdev.h>
102#include <sys/mman.h>
103#include <sys/mnttab.h>
104#include <sys/mount.h>
105#include <sys/msg.h>
106#include <sys/param.h>
107#include <sys/poll.h>
108#include <sys/priocntl.h>
109#include <sys/procset.h>
110#include <sys/processor.h>
111#include <sys/pset.h>
112#include <sys/rctl_impl.h>
113#include <sys/sem.h>
114#include <sys/shm.h>
115#include <sys/signal.h>
116#include <sys/stat.h>
117#include <sys/statvfs.h>
118#include <sys/strlog.h>
119#include <sys/stropts.h>
120#include <sys/syscall.h>
121#include <sys/sysconfig.h>
122#include <sys/syslog.h>
123#include <sys/systeminfo.h>
124#include <sys/task.h>
125#include <sys/termio.h>
126#include <sys/termios.h>
127#include <sys/time.h>
128#include <sys/timeb.h>
129#include <sys/times.h>
130#include <sys/types.h>
131#include <sys/uadmin.h>
132#include <sys/utsname.h>
133#include <sys/vfstab.h>
134#include <sys/sendfile.h>
135#include <sys/zone.h>
136#include <termio.h>
137#include <time.h>
138#include <tzfile.h>
139#include <ucontext.h>
140#include <utmpx.h>
141#include <values.h>
142#include <wait.h>
143#include <wchar.h>
144#include <wctype.h>
145#include <widec.h>
146#include <wordexp.h>
147#include <thread.h>
148#include <pthread.h>
149#include <schedctl.h>
150#include <zone.h>
151#include <port.h>
152#include <spawn.h>
153#include <inttypes.h>
154#include <getopt.h>
155#include <stdio_ext.h>
156#if defined(__i386)
157#include <sys/sysi86.h>
158#endif
159#if defined(__amd64)
160#include <stack_unwind.h>
161#endif
162
163/*
164 * This really comes from the crt*.s startup modules.
165 */
166char **environ;
167
168/*
169 * POSIX versions of standard libc routines; these aren't extracted
170 * from the headers above since we cannot #define _POSIX_C_SOURCE.
171 */
172int __posix_readdir_r(DIR * _RESTRICT_KYWD, struct dirent * _RESTRICT_KYWD,
173    struct dirent ** _RESTRICT_KYWD);
174int __posix_getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
175int __posix_getgrnam_r(const char *, struct group *, char *, size_t,
176    struct group **);
177int __posix_getpwuid_r(uid_t, struct passwd *, char *, size_t,
178    struct passwd **);
179int __posix_getpwnam_r(const char *, struct passwd *, char *, size_t,
180    struct passwd **);
181int __posix_sigwait(const sigset_t * _RESTRICT_KYWD, int * _RESTRICT_KYWD);
182char *__posix_asctime_r(const struct tm *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
183char *__posix_ctime_r(const time_t *, char *);
184int __posix_ttyname_r(int, char *, size_t);
185int __posix_getlogin_r(char *, int);
186
187/*
188 * XPG4 versions of standard libc routines; these aren't extracted
189 * from the headers above since we cannot #define _XPG4_2.
190 */
191int __xpg4_putmsg(int, const struct strbuf *, const struct strbuf *, int);
192int __xpg4_putpmsg(int, const struct strbuf *, const struct strbuf *, int, int);
193
194/*
195 * These aren't extracted from the headers above because:
196 * - We cannot #define _STRPTIME_DONTZERO
197 * - We cannot #define _XPG5
198 */
199char *__strptime_dontzero(const char *, const char *, struct tm *);
200long __sysconf_xpg5(int);
201wchar_t *__wcstok_xpg5(wchar_t *_RESTRICT_KYWD,
202	const wchar_t *_RESTRICT_KYWD, wchar_t **_RESTRICT_KYWD);
203size_t __wcsftime_xpg5(wchar_t *_RESTRICT_KYWD, size_t,
204	const wchar_t *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD);
205wint_t __fgetwc_xpg5(__FILE *);
206wint_t __getwc_xpg5(__FILE *);
207wint_t __getwchar_xpg5(void);
208wint_t __fputwc_xpg5(wint_t, __FILE *);
209wint_t __putwc_xpg5(wint_t, __FILE *);
210wint_t __putwchar_xpg5(wint_t);
211wchar_t *__fgetws_xpg5(wchar_t *_RESTRICT_KYWD, int, __FILE *_RESTRICT_KYWD);
212int __fputws_xpg5(const wchar_t *_RESTRICT_KYWD, __FILE *_RESTRICT_KYWD);
213wint_t __ungetwc_xpg5(wint_t, __FILE *);
214
215/*
216 * /usr/src/lib/libc/port/gen routines
217 */
218
219/* _ctype.c */
220
221/* _loc_data.c */
222
223/* _locale.c */
224
225/* _set_tab.c */
226int _set_tab(const char *loc, int cat);
227
228/* _xftw.c */
229int _xftw(int ver, const char *path, int (*fn)(), int depth);
230
231/* a64l.c */
232long a64l(const char *);
233
234/* abort.c */
235void abort(void);
236
237/* abs.c */
238int abs(int arg);
239long labs(long int arg);
240
241/* assert.c */
242void _assert(const char *assertion, const char *filename, int line_num);
243
244/* atexit.c */
245int atexit(void(*func)());
246void _exithandle(void);
247
248/* atof.c */
249double atof(const char *p);
250
251/* atoi.c */
252int atoi(const char *p);
253
254/* atol.c */
255long atol(const char *p);
256
257/* basename.c */
258char *basename(char *s);
259
260/* bcmp.c */
261int bcmp(const void *s1, const void *s2, size_t len);
262
263/* bcopy.c */
264void bcopy(const void *s1, void *s2, size_t len);
265
266/* bsearch.c */
267void *bsearch(const void *ky, const void *bs, size_t nel,
268		size_t width, int (*compar)());
269
270/* bzero.c */
271void bzero(void *sp, size_t len);
272
273/* calloc.c */
274void *calloc(size_t num, size_t size);
275
276/* catclose.c */
277int catclose(nl_catd catd);
278
279/* catgets.c */
280char *catgets(nl_catd catd, int set_num, int msg_num, const char *s);
281
282/* catopen.c */
283nl_catd catopen(const char *name, int mode);
284
285/* cfgetispeed.c */
286speed_t cfgetispeed(const struct termios *termios_p);
287
288/* cfgetospeed.c */
289speed_t cfgetospeed(const struct termios *termios_p);
290
291/* cfree.c */
292void cfree(void *p, size_t num, size_t size);
293
294/* cfsetispeed.c */
295int cfsetispeed(struct termios *termios_p, speed_t speed);
296
297/* cfsetospeed.c */
298int cfsetospeed(struct termios *termios_p, speed_t speed);
299
300/* cftime.c */
301int cftime(char *buf, char *format, const time_t *t);
302int ascftime(char *buf, const char *format, const struct tm *tm);
303
304/* clock.c */
305clock_t clock(void);
306
307/* closedir.c */
308int closedir(DIR *dirp);
309
310/* confstr.c */
311size_t confstr(int name, char *buf, size_t length);
312
313/* crypt.c */
314void setkey(const char *key);
315void encrypt(char *block, int fake);
316char *crypt(const char *key, const char *salt);
317
318/* csetlen.c */
319int csetlen(int cset);
320int csetcol(int cset);
321
322/* ctime.c */
323char *ctime(const time_t *t);
324char *ctime_r(const time_t *, char *buf, int);
325char *asctime(const struct tm *t);
326char *asctime_r(const struct tm *, char *, int);
327
328/* ctypefcns.c */
329int isalpha(int c);
330int isupper(int c);
331int islower(int c);
332int isdigit(int c);
333int isxdigit(int c);
334int isalnum(int c);
335int isspace(int c);
336int ispunct(int c);
337int isprint(int c);
338int isgraph(int c);
339int iscntrl(int c);
340int isascii(int c);
341int _toupper(int c);
342int _tolower(int c);
343int toascii(int c);
344
345/* directio.c */
346int directio(int filedes, int advice);
347
348/* dirname.c */
349char *dirname(char *s);
350
351/* div.c */
352div_t div(int numer, int denom);
353ldiv_t ldiv(long int numer, long int denom);
354
355/* drand48.c */
356double drand48(void);
357double erand48(unsigned short *xsubi);
358long krand48(unsigned short *xsubi, unsigned int m);
359long lrand48(void);
360long mrand48(void);
361void srand48(long seedval);
362unsigned short *seed48(unsigned short seed16v[3]);
363void lcong48(unsigned short param[7]);
364long nrand48(unsigned short *xsubi);
365long jrand48(unsigned short *xsubi);
366
367/* dup2.c */
368int dup2(int fildes, int fildes2);
369
370/* ecvt.c */
371char *ecvt(double value, int ndigit, int *_RESTRICT_KYWD decpt,
372	int *_RESTRICT_KYWDsign);
373char *fcvt(double value, int ndigit, int *_RESTRICT_KYWD decpt,
374	int *_RESTRICT_KYWD sign);
375
376/* errlst.c */
377
378/* euclen.c */
379int euccol(const unsigned char *s);
380int euclen(const unsigned char *s);
381int eucscol(const unsigned char *s);
382
383/* execvp.c */
384/* VARARGS1 */
385int execlp(const char *, const char *, ...);
386int execvp(const char *name, char *const *argv);
387
388/* fattach.c */
389int fattach(int fildes, const char *path);
390
391/* fdetach.c */
392int fdetach(const char *path);
393
394/* ffs.c */
395int ffs(int field);
396
397/* fmtmsg.c */
398int addseverity(int value, const char *string);
399int fmtmsg(long class, const char *label, int severity, const char *text,
400		const char *action, const char *tag);
401
402/* ftime.c */
403int ftime(struct timeb *tp);
404
405/* ftok.c */
406key_t ftok(const char *path, int id);
407
408/* gcvt.c */
409char *gcvt(double number, int ndigit, char *buf);
410
411/* getcwd.c */
412char *getcwd(char *str, size_t size);
413
414/* getdate.c */
415struct tm *getdate(const char *expression);
416#ifdef getdate_err
417#undef getdate_err
418#endif
419int getdate_err;
420
421/* getdate_data.c */
422
423/* getdate_gd.c */
424
425/* getdtblsize.c */
426int getdtablesize(void);
427
428/* getenv.c */
429char *getenv(const char *name);
430
431/* getexecname.c */
432const char *getexecname(void);
433
434/* getgrnam.c */
435struct group *getgrnam(const char *name);
436struct group *getgrgid(gid_t gid);
437struct group *fgetgrent_r(FILE *, struct group *, char *, int);
438struct group *getgrent_r(struct group *, char *, int);
439struct group *getgrgid_r(gid_t, struct group *, char *, int);
440struct group *getgrnam_r(const char *, struct group *, char *, int);
441
442/* gethostid.c */
443long gethostid(void);
444
445/* gethz.c */
446int gethz(void);
447
448/* getisax.c */
449uint_t getisax(uint32_t *, uint_t);
450
451/* getlogin.c */
452char *getlogin(void);
453char *getlogin_r(char *, int);
454
455/* getmntent.c */
456int getmntany(FILE *fd, struct mnttab *mgetp, struct mnttab *mrefp);
457int getmntent(FILE *fd, struct mnttab *mp);
458
459/* getnetgrent.c */
460int setnetgrent(const char *grp);
461int endnetgrent(void);
462int getnetgrent(char **machinep, char **namep, char **domainp);
463
464/* getopt.c */
465int getopt(int argc, char *const *argv, const char *opts);
466
467/* getopt_long.c */
468int getopt_clip(int argc, char *const *argv, const char *optstring,
469		const struct option *long_options, int *long_index);
470int getopt_long(int argc, char *const *argv, const char *optstring,
471		const struct option *long_options, int *long_index);
472int getopt_long_only(int argc, char *const *argv, const char *optstring,
473		const struct option *long_options, int *long_index);
474
475/* getpagesize.c */
476int getpagesize(void);
477
478/* getpw.c */
479int getpw(uid_t uid, char *buf);
480
481/* getpwnam.c */
482struct passwd *getpwnam(const char *name);
483struct passwd *getpwuid(uid_t uid);
484struct passwd *fgetpwent_r(FILE *, struct passwd *, char *, int);
485struct passwd *getpwent_r(struct passwd *, char *, int);
486struct passwd *getpwnam_r(const char *, struct passwd *, char *, int);
487struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
488
489/* getrusage.c */
490int getrusage(int who, struct rusage *rusage);
491
492/* gettimeofday.c */
493int gettimeofday(struct timeval *_RESTRICT_KYWD tp, void *_RESTRICT_KYWD);
494
495/* getspent.c */
496void setspent(void);
497void endspent(void);
498struct spwd *getspent(void);
499struct spwd *getspent_r(struct spwd *, char *, int);
500struct spwd *fgetspent(FILE *f);
501struct spwd *fgetspent_r(FILE *, struct spwd *, char *, int);
502struct spwd *getspnam(const char *name);
503struct spwd *getspnam_r(const char *, struct spwd *, char *, int);
504int putspent(const struct spwd *p, FILE *f);
505
506/* getspent_r.c */
507int str2spwd(const char *, int, void *, char *, int);
508
509/* getsubopt.c */
510int getsubopt(char **optionsp, char *const *tokens, char **valuep);
511
512/* gettxt.c */
513char *gettxt(const char *msg_id, const char *dflt_str);
514
515/* getusershell.c */
516char *getusershell(void);
517void endusershell(void);
518void setusershell(void);
519
520/* getut.c */
521struct utmp *getutent(void);
522struct utmp *getutid(const struct utmp *entry);
523struct utmp *getutline(const struct utmp *entry);
524struct utmp *pututline(const struct utmp *entry);
525void setutent(void);
526void endutent(void);
527int utmpname(const char *newfile);
528void updwtmp(const char *file, struct utmp *ut);
529void getutmp(const struct utmpx *utx, struct utmp *ut);
530void getutmpx(const struct utmp *ut, struct utmpx *utx);
531struct utmp *makeut(struct utmp *utmp);
532
533/* getutx.c */
534struct utmpx *getutxent(void);
535struct utmpx *getutxid(const struct utmpx *entry);
536struct utmpx *getutxline(const struct utmpx *entry);
537struct utmpx *pututxline(const struct utmpx *entry);
538void setutxent(void);
539void endutxent(void);
540int utmpxname(const char *newfile);
541void updwtmpx(const char *filex, struct utmpx *utx);
542struct utmpx *makeutx(const struct utmpx *utmp);
543struct utmpx *modutx(const struct utmpx *utp);
544
545/* getvfsent.c */
546int getvfsspec(FILE *fd, struct vfstab *vp, char *special);
547int getvfsfile(FILE *fd, struct vfstab *vp, char *mountp);
548int getvfsany(FILE *fd, struct vfstab *vgetp, struct vfstab *vrefp);
549int getvfsent(FILE *fd, struct vfstab *vp);
550
551/* getwd.c */
552char *getwd(char *pathname);
553
554/* getwidth.c */
555void getwidth(eucwidth_t *eucstruct);
556
557/* hsearch.c */
558int hcreate(size_t size);
559void hdestroy(void);
560ENTRY *hsearch(ENTRY item, ACTION action);
561
562/* iconv.c  */
563size_t iconv(iconv_t cd, const char **_RESTRICT_KYWD inbuf,
564    size_t *_RESTRICT_KYWD inbytesleft, char **_RESTRICT_KYWD outbuf,
565    size_t *_RESTRICT_KYWD outbytesleft);
566int iconv_close(iconv_t cd);
567iconv_t iconv_open(const char *tocode, const char *fromcode);
568
569/* imaxabs.c */
570intmax_t imaxabs(intmax_t j);
571
572/* imaxdiv.c */
573imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
574
575/* index.c */
576char *index(const char *sp, int c);
577
578/* initgroups.c */
579int initgroups(const char *uname, gid_t agroup);
580
581/* innetgr.c */
582int innetgr(const char *group, const char *machine, const char *name,
583    const char *domain);
584
585/* insque.c */
586void insque(void *elem, void *pred);
587void remque(void *elem);
588
589/* isaexec.c */
590int isaexec(const char *, char *const *, char *const *);
591
592/* isastream.c */
593int isastream(int fd);
594
595/* isatty.c */
596int isatty(int f);
597
598/* killpg.c */
599int killpg(pid_t pgrp, int sig);
600
601/* l64a.c */
602char *l64a(long lg);
603
604/* lckpwdf.c */
605int lckpwdf(void);
606int ulckpwdf(void);
607
608/* lfind.c */
609void * lfind(const void *ky, const void *bs, size_t *nelp,
610		size_t width, int (*compar)());
611
612/* localeconv.c */
613struct lconv *localeconv(void);
614
615/* lsearch.c */
616void * lsearch(const void *ky, void *bs, size_t *nelp,
617		size_t width, int (*compar)());
618
619/* madvise.c */
620int madvise(caddr_t addr, size_t len, int advice);
621
622/* malloc.c */
623void *malloc(size_t size);
624void *realloc(void *old, size_t size);
625void free(void *old);
626
627/* mbstowcs.c */
628size_t mbstowcs(wchar_t *_RESTRICT_KYWD pwcs, const char *_RESTRICT_KYWD s,
629	size_t n);
630
631/* mbtowc.c */
632int mbtowc(wchar_t *_RESTRICT_KYWD wchar, const char *_RESTRICT_KYWD s,
633	size_t n);
634int mblen(const char *s, size_t n);
635
636/* memalign.c */
637void *memalign(size_t align, size_t nbytes);
638
639/* memccpy.c */
640void *memccpy(void *_RESTRICT_KYWDs, const void *_RESTRICT_KYWD s0, int c,
641	size_t n);
642
643/* memchr.c */
644void *memchr(const void *sptr, int c1, size_t n);
645
646/* memcmp.c */
647int memcmp(const void *s1, const void *s2, size_t n);
648
649/* memcpy.c */
650void *memcpy(void *_RESTRICT_KYWD s, const void *_RESTRICT_KYWD s0, size_t n);
651
652/* memmove.c */
653void *memmove(void *s, const void *s0, size_t n);
654
655/* memset.c */
656void *memset(void *sp1, int c, size_t n);
657
658/* mkdev.c */
659dev_t __makedev(const int version, const major_t majdev,
660		const minor_t mindev);
661major_t __major(const int version, const dev_t devnum);
662minor_t __minor(const int version, const dev_t devnum);
663
664/* mkfifo.c */
665int mkfifo(const char *path, mode_t mode);
666
667/* mktemp.c */
668char *mktemp(char *as);
669
670/* mlock.c */
671int mlock(caddr_t addr, size_t len);
672
673/* mlockall.c */
674int mlockall(int flags);
675
676/* mon.c */
677void monitor(int (*alowpc)(), int (*ahighpc)(), WORD *buffer,
678		size_t bufsize, size_t nfunc);
679
680/* msync.c */
681int msync(caddr_t addr, size_t len, int flags);
682
683/* munlock.c */
684int munlock(caddr_t addr, size_t len);
685
686/* munlockall.c */
687int munlockall(void);
688
689/* ndbm.c */
690void dbm_setdefwrite(DBM *db);
691int dbm_flush(DBM *db);
692int dbm_flushpag(DBM *db);
693DBM *dbm_open(const char *file, int flags, mode_t mode);
694void dbm_close(DBM *db);
695int dbm_close_status(DBM *db);
696datum dbm_fetch(DBM *db, datum key);
697int dbm_delete(DBM *db, datum key);
698int dbm_store(DBM *db, datum key, datum dat, int replace);
699datum dbm_firstkey(DBM *db);
700datum dbm_nextkey(DBM *db);
701datum dbm_do_nextkey(DBM *db, datum inkey);
702
703/* new_list.c */
704
705/* nftw.c */
706int nftw(const char *path, int (*fn)(), int depth, int flags);
707
708/* nl_langinfo.c */
709char *nl_langinfo(nl_item item);
710
711/* opendir.c */
712DIR *opendir(const char *filename);
713
714/* opt_data.c */
715
716/* perror.c */
717void perror(const char *s);
718
719/* psiginfo.c */
720void psiginfo(siginfo_t *sip, char *s);
721
722/* psignal.c */
723void psignal(int sig, const char *s);
724
725/* pt.c */
726char *ptsname(int fd);
727int unlockpt(int fd);
728int grantpt(int fd);
729
730/* putenv.c */
731int putenv(char *change);
732int setenv(const char *envname, const char *envval, int overwrite);
733int unsetenv(const char *name);
734
735/* putpwent.c */
736int putpwent(const struct passwd *p, FILE *f);
737
738/* qsort.c */
739void qsort(void *base, size_t n, size_t size, int (*compar)());
740
741/* raise.c */
742int raise(int sig);
743
744/* rand.c */
745void srand(unsigned x);
746int rand(void);
747int rand_r(unsigned int *);
748
749/* random.c */
750void srandom(unsigned x);
751char *initstate(unsigned seed, char *arg_state, size_t n);
752char *setstate(const char *arg_state);
753long random(void);
754
755/* rctlops.c */
756int rctl_walk(int (*callback)(const char *, void *), void *walk_data);
757hrtime_t rctlblk_get_firing_time(rctlblk_t *rblk);
758uint_t rctlblk_get_global_action(rctlblk_t *rblk);
759uint_t rctlblk_get_global_flags(rctlblk_t *rblk);
760uint_t rctlblk_get_local_action(rctlblk_t *rblk, int *signalp);
761uint_t rctlblk_get_local_flags(rctlblk_t *rblk);
762id_t rctlblk_get_recipient_pid(rctlblk_t *rblk);
763rctl_priv_t rctlblk_get_privilege(rctlblk_t *rblk);
764rctl_qty_t rctlblk_get_value(rctlblk_t *rblk);
765void rctlblk_set_local_action(rctlblk_t *rblk, uint_t action, int signal);
766void rctlblk_set_local_flags(rctlblk_t *rblk, uint_t flags);
767void rctlblk_set_privilege(rctlblk_t *rblk, rctl_priv_t priv);
768void rctlblk_set_value(rctlblk_t *rblk, rctl_qty_t val);
769size_t rctlblk_size(void);
770
771/* readdir.c */
772struct dirent *readdir(DIR *dirp);
773
774/* realpath.c */
775char *realpath(const char *_RESTRICT_KYWD raw, char *_RESTRICT_KYWD canon);
776
777/* regexpr.c */
778char *re_comp(const char *sp);
779int re_exec(const char *p1);
780
781/* rindex.c */
782char *rindex(const char *sp, int c);
783
784/* rename.c */
785int remove(const char *filename);
786int rename(const char *old, const char *new);
787
788/* rewinddir.c */
789void _rewinddir(DIR *dirp);
790
791/* scandir.c */
792int alphasort(const struct dirent **, const struct dirent **);
793int scandir(const char *dirname, struct dirent *(*namelist[]),
794	int (*select)(const struct dirent *),
795	int (*dcomp)(const struct dirent **, const struct dirent **));
796
797/* scrwidth.c */
798int scrwidth(wchar_t c);
799
800/* seekdir.c */
801void seekdir(DIR *dirp, long loc);
802
803/* select.c */
804int pselect(int nfds,
805	fd_set *_RESTRICT_KYWD readfds,
806	fd_set *_RESTRICT_KYWD writefds,
807	fd_set *_RESTRICT_KYWD errorfds,
808	const struct timespec *_RESTRICT_KYWD timeout,
809	const sigset_t *_RESTRICT_KYWD sigmask);
810int select(int nfds,
811	fd_set *_RESTRICT_KYWD readfds,
812	fd_set *_RESTRICT_KYWD writefds,
813	fd_set *_RESTRICT_KYWD errorfds,
814	struct timeval *_RESTRICT_KYWD timeout);
815
816/* setlocale.c */
817char *setlocale(int cat, const char *loc);
818
819/* setpriority.c */
820int getpriority(int which, id_t who);
821int setpriority(int which, id_t who, int prio);
822
823/* settimeofday.c */
824int settimeofday(struct timeval *tp, void *);
825
826/* sigflag.c */
827int sigflag(int sig, int flag, int on);
828
829/* siglist.c */
830
831/* sigsend.c */
832int sigsend(idtype_t idtype, id_t id, int sig);
833
834/* sigsetops.c */
835int sigfillset(sigset_t *set);
836int sigemptyset(sigset_t *set);
837int sigaddset(sigset_t *set, int sig);
838int sigdelset(sigset_t *set, int sig);
839int sigismember(const sigset_t *set, int sig);
840
841/* scalls.c */
842unsigned sleep(unsigned sleep_tm);
843
844/* ssignal.c */
845int (*ssignal(int sig, int (*fn)())) ();
846int gsignal(int sig);
847
848/* str2id.c */
849
850/* str2sig.c */
851int str2sig(const char *s, int *sigp);
852int sig2str(int i, char *s);
853
854/* strcat.c */
855char *strcat(char *_RESTRICT_KYWD s1, const char *_RESTRICT_KYWD s2);
856
857/* strchr.c */
858char *strchr(const char *sp, int c);
859
860/* strcmp.c */
861int strcmp(const char *s1, const char *s2);
862
863/* strcpy.c */
864char *strcpy(char *_RESTRICT_KYWD s1, const char *_RESTRICT_KYWD s2);
865
866/* strcspn.c */
867size_t strcspn(const char *string, const char *charset);
868
869/* strdup.c */
870char *strdup(const char *s1);
871
872/* strerror.c */
873char *strerror(int errnum);
874int strerror_r(int errnum, char *strerrbuf, size_t buflen);
875
876/* strftime.c */
877size_t strftime(char *_RESTRICT_KYWD s, size_t maxsize,
878		const char *_RESTRICT_KYWD format,
879		const struct tm *_RESTRICT_KYWD tm);
880
881/* strlen.c */
882size_t strlen(const char *s);
883
884/* strncat.c */
885char *strncat(char *_RESTRICT_KYWD s1, const char *_RESTRICT_KYWD s2, size_t n);
886
887/* strncmp.c */
888int strncmp(const char *s1, const char *s2, size_t n);
889
890/* strncpy.c */
891char *strncpy(char *_RESTRICT_KYWD s1, const char *_RESTRICT_KYWD s2, size_t n);
892
893/* strpbrk.c */
894char *strpbrk(const char *string, const char *brkset);
895
896/* strrchr.c */
897char *strrchr(const char *sp, int c);
898
899/* strspn.c */
900size_t strspn(const char *string, const char *charset);
901
902/* strstr.c */
903char *strstr(const char *as1, const char *as2);
904
905/* strtod.c */
906double strtod(const char *_RESTRICT_KYWD cp, char **_RESTRICT_KYWD ptr);
907float strtof(const char *_RESTRICT_KYWD cp, char **_RESTRICT_KYWD ptr);
908long double strtold(const char *_RESTRICT_KYWD cp, char **_RESTRICT_KYWD ptr);
909
910/* strtoimax.c */
911intmax_t strtoimax(const char *_RESTRICT_KYWD nptr,
912	char **_RESTRICT_KYWD endptr, int base);
913
914/* strtok.c */
915char *strtok(char *_RESTRICT_KYWD string, const char *_RESTRICT_KYWD sepset);
916char *strtok_r(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
917	char **_RESTRICT_KYWD);
918
919/* strtol.c */
920long strtol(const char *_RESTRICT_KYWD str, char **_RESTRICT_KYWD nptr,
921	int base);
922
923/* strtoul.c */
924unsigned long strtoul(const char *_RESTRICT_KYWD str,
925	char **_RESTRICT_KYWD nptr, int base);
926
927/* strtoumax.c */
928uintmax_t strtoumax(const char *_RESTRICT_KYWD nptr,
929		    char **_RESTRICT_KYWD endptr, int base);
930
931/* strxfrm.c */
932size_t strxfrm(char *_RESTRICT_KYWD s1, const char *_RESTRICT_KYWD s2,
933	size_t n);
934int strcoll(const char *s1, const char *s2);
935
936/* swab.c */
937void swab(const char *_RESTRICT_KYWD from, char *_RESTRICT_KYWD to, ssize_t n);
938
939/* swapctl.c */
940int swapctl(int cmd, void *arg);
941
942/* sysconf.c */
943long sysconf(int name);
944
945/* syslog.c */
946/* VARARGS2 */
947void syslog(int pri, const char *fmt, ...);
948void vsyslog(int pri, const char *fmt, va_list ap);
949void openlog(const char *ident, int logstat, int logfac);
950void closelog(void);
951int setlogmask(int pmask);
952
953/* tcdrain.c */
954int tcdrain(int fildes);
955
956/* tcflow.c */
957int tcflow(int fildes, int action);
958
959/* tcflush.c */
960int tcflush(int fildes, int queue_selector);
961
962/* tcgetattr.c */
963int tcgetattr(int fildes, struct termios *termios_p);
964
965/* tcgetpgrp.c */
966pid_t tcgetpgrp(int fd);
967
968/* tcgetsid.c */
969pid_t tcgetsid(int fd);
970
971/* tcsendbreak.c */
972int tcsendbreak(int fildes, int duration);
973
974/* tcsetattr.c */
975int tcsetattr(int fildes, int optional_actions,
976	const struct termios *termios_p);
977
978/* tcsetpgrp.c */
979int tcsetpgrp(int fd, pid_t pgrp);
980
981/* tell.c */
982long tell(int f);
983
984/* telldir.c */
985long telldir(DIR *dirp);
986
987/* tfind.c */
988void *tfind(const void *ky, void *const *rtp, int (*compar)());
989
990/* time_comm.c */
991struct tm *localtime(const time_t *timep);
992struct tm *localtime_r(const time_t *_RESTRICT_KYWD, struct tm *_RESTRICT_KYWD);
993struct tm *gmtime(const time_t *clock);
994struct tm *gmtime_r(const time_t *_RESTRICT_KYWD, struct tm *_RESTRICT_KYWD);
995double difftime(time_t time1, time_t time0);
996time_t mktime(struct tm *timeptr);
997void _ltzset(time_t tim);
998void tzset(void);
999
1000/* time_data.c */
1001
1002/* time_gdata.c */
1003
1004/* tolower.c */
1005int tolower(int c);
1006
1007/* toupper.c */
1008int toupper(int c);
1009
1010/* truncate.c */
1011int ftruncate(int fildes, off_t len);
1012int truncate(const char *path, off_t len);
1013
1014/* tsearch.c */
1015void *tsearch(const void *ky, void **rtp, int (*compar)());
1016void *tdelete(const void *ky, void **rtp, int (*compar)());
1017void twalk(const void *rt, void (*action)());
1018
1019/* ttyname.c */
1020char *ttyname(int f);
1021char *_ttyname_dev(dev_t rdev, char *buffer, size_t buflen);
1022char *ttyname_r(int, char *, int);
1023
1024/* ttyslot.c */
1025int ttyslot(void);
1026
1027/* ualarm.c */
1028unsigned ualarm(unsigned usecs, unsigned reload);
1029
1030/* ulimit.c */
1031/* VARARGS1 */
1032long ulimit(int cmd, ...);
1033
1034/* scalls.c */
1035int usleep(unsigned n);
1036
1037/* valloc.c */
1038void *valloc(size_t size);
1039
1040/* values-Xa.c */
1041
1042/* values-Xc.c */
1043
1044/* values-Xs.c */
1045
1046/* values-Xt.c */
1047
1048/* wait3.c */
1049pid_t wait3(int *status, int options, struct rusage *rp);
1050
1051/* wait4.c */
1052pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage);
1053
1054/* waitpid.c */
1055pid_t waitpid(pid_t pid, int *stat_loc, int options);
1056
1057/* wcstombs.c */
1058size_t wcstombs(char *_RESTRICT_KYWD s, const wchar_t *_RESTRICT_KYWD pwcs,
1059	size_t n);
1060
1061/* wctomb.c */
1062int wctomb(char *s, wchar_t wchar);
1063
1064/* wdata.c */
1065
1066/* wisprint.c */
1067int wisprint(wchar_t c);
1068
1069/* xgetwidth.c */
1070void _xgetwidth(void);
1071
1072/*
1073 * /usr/src/lib/libc/port/intl routines
1074 */
1075
1076/* gettext.c */
1077char *bindtextdomain(const char *domain, const char *binding);
1078char *dcgettext(const char *domain, const char *msg_id, const int category);
1079char *dgettext(const char *domain, const char *msg_id);
1080char *gettext(const char *msg_id);
1081char *textdomain(const char *domain);
1082
1083/*
1084 * /usr/src/lib/libc/port/print routines
1085 */
1086
1087/* fprintf.c */
1088/* VARARGS2 */
1089int fprintf(FILE *_RESTRICT_KYWD iop, const char *_RESTRICT_KYWD format, ...);
1090
1091/* printf.c */
1092/* VARARGS1 */
1093int printf(const char *_RESTRICT_KYWD format, ...);
1094
1095/* snprintf.c */
1096/* VARARGS2 */
1097int snprintf(char *_RESTRICT_KYWD string, size_t n,
1098		const char *_RESTRICT_KYWD format, ...);
1099
1100/* sprintf.c */
1101/* VARARGS2 */
1102int sprintf(char *_RESTRICT_KYWD string,
1103		const char *_RESTRICT_KYWD format, ...);
1104
1105/* vfprintf.c */
1106/* VARARGS2 */
1107int vfprintf(FILE *_RESTRICT_KYWD iop, const char *_RESTRICT_KYWD format,
1108		va_list);
1109
1110/* vprintf.c */
1111/* VARARGS1 */
1112int vprintf(const char *_RESTRICT_KYWD format, va_list);
1113
1114/* vsnprintf.c */
1115/* VARARGS2 */
1116int vsnprintf(char *_RESTRICT_KYWD string, size_t n,
1117		const char *_RESTRICT_KYWD format, va_list);
1118
1119/* vsprintf.c */
1120/* VARARGS2 */
1121int vsprintf(char *_RESTRICT_KYWD string, const char *_RESTRICT_KYWD format,
1122	va_list);
1123
1124/*
1125 * /usr/src/lib/libc/port/regex routines
1126 */
1127
1128/* regex.c */
1129char *regex(const char *regexp, const char *stringp, ...);
1130#ifdef __loc1
1131#undef __loc1
1132#endif
1133char *__loc1;
1134
1135/* regcmp.c */
1136char *regcmp(const char *regexp, ...);
1137#ifdef __i_size
1138#undef __i_size
1139#endif
1140int __i_size;
1141
1142/*
1143 * /usr/src/lib/libc/port/stdio routines
1144 */
1145
1146/* _filbuf.c */
1147int _filbuf(FILE *iop);
1148
1149/* _flsbuf.c */
1150int _flsbuf(int ch, FILE *iop);
1151
1152/* _wrtchk.c */
1153int _wrtchk(FILE *iop);
1154
1155/* clearerr.c */
1156void clearerr(FILE *iop);
1157
1158/* ctermid.c */
1159char *ctermid(char *s);
1160char *ctermid_r(char *s);
1161
1162/* cuserid.c */
1163char *cuserid(char *s);
1164
1165/* data.c */
1166
1167/* doscan.c */
1168int _doscan(FILE *iop, const char *fmt, va_list va_alist);
1169
1170/* fdopen.c */
1171FILE *fdopen(int fd, const char *type);
1172
1173/* feof.c */
1174int feof(FILE *iop);
1175
1176/* ferror.c */
1177int ferror(FILE *iop);
1178
1179/* fgetc.c */
1180int fgetc(FILE *iop);
1181
1182/* fgets.c */
1183char *fgets(char *_RESTRICT_KYWD buf, int size, FILE *_RESTRICT_KYWD iop);
1184
1185/* fileno.c */
1186int _fileno(FILE *iop);
1187
1188/* flush.c */
1189void _cleanup(void);
1190FILE *_findiop(void);
1191typedef unsigned char Uchar;
1192void _setbufend(FILE *iop, Uchar *end);
1193Uchar *_realbufend(FILE *iop);
1194void _bufsync(FILE *iop, Uchar *bufend);
1195int _xflsbuf(FILE *iop);
1196int fflush(FILE *iop);
1197int fclose(FILE *iop);
1198
1199/* fopen.c */
1200FILE *fopen(const char *_RESTRICT_KYWD name, const char *_RESTRICT_KYWD type);
1201FILE *freopen(const char *_RESTRICT_KYWD name, const char *_RESTRICT_KYWD type,
1202		FILE *_RESTRICT_KYWD iop);
1203
1204/* fpos.c */
1205int fgetpos(FILE *_RESTRICT_KYWD stream, fpos_t *_RESTRICT_KYWD pos);
1206int fsetpos(FILE *stream, const fpos_t *pos);
1207
1208/* fputc.c */
1209int fputc(int ch, FILE *iop);
1210
1211/* fputs.c */
1212int fputs(const char *_RESTRICT_KYWD ptr, FILE *_RESTRICT_KYWD iop);
1213
1214/* fread.c */
1215size_t fread(void *_RESTRICT_KYWD ptr, size_t size, size_t count,
1216	FILE *_RESTRICT_KYWD iop);
1217
1218/* fseek.c */
1219int fseek(FILE *iop, long offset, int ptrname);
1220
1221/* ftell.c */
1222long ftell(FILE *iop);
1223
1224/* fwrite.c */
1225size_t fwrite(const void *_RESTRICT_KYWD ptr1, size_t size, size_t count,
1226	FILE *_RESTRICT_KYWD iop);
1227
1228/* getc.c */
1229int getc(FILE *iop);
1230
1231/* getchar.c */
1232int getchar(void);
1233
1234/* getpass.c */
1235char *getpass(const char *prompt);
1236
1237/* getpass.c */
1238char *getpassphrase(const char *prompt);
1239
1240/* gets.c */
1241char *gets(char *buf);
1242
1243/* getw.c */
1244int getw(FILE *stream);
1245
1246/* popen.c */
1247FILE *popen(const char *cmd, const char *mode);
1248int pclose(FILE *ptr);
1249
1250/* putc.c */
1251int putc(int ch, FILE *iop);
1252
1253/* putchar.c */
1254int putchar(int ch);
1255
1256/* puts.c */
1257int puts(const char *ptr);
1258
1259/* putw.c */
1260int putw(int w, FILE *stream);
1261
1262/* rewind.c */
1263void rewind(FILE *iop);
1264
1265/* scanf.c */
1266/* VARARGS1 */
1267int scanf(const char *_RESTRICT_KYWD fmt, ...);
1268
1269/* VARARGS2 */
1270int fscanf(FILE *_RESTRICT_KYWD iop, const char *_RESTRICT_KYWD fmt, ...);
1271
1272/* VARARGS2 */
1273int sscanf(const char *_RESTRICT_KYWD str, const char *_RESTRICT_KYWD fmt, ...);
1274
1275/* setbuf.c */
1276void setbuf(FILE *_RESTRICT_KYWD iop, char *_RESTRICT_KYWD abuf);
1277
1278/* setvbuf.c */
1279int setvbuf(FILE *_RESTRICT_KYWD iop, char *_RESTRICT_KYWD abuf, int type,
1280		size_t size);
1281
1282/* system.c */
1283int system(const char *s);
1284
1285/* tempnam.c */
1286char *tempnam(const char *dir, const char *pfx);
1287
1288/* tmpfile.c */
1289FILE *tmpfile(void);
1290
1291/* tmpnam.c */
1292char *tmpnam(char *s);
1293char *tmpnam_r(char *);
1294
1295/* ungetc.c */
1296int ungetc(int c, FILE *iop);
1297
1298/*
1299 * /usr/src/lib/libc/port/sys routines
1300 */
1301
1302/* exacctsys.c */
1303size_t getacct(idtype_t idtype, id_t id, void *buf, size_t bufsize);
1304int putacct(idtype_t idtype, id_t id, void *buf, size_t bufsize, int flags);
1305int wracct(idtype_t idtype, id_t id, int flags);
1306
1307/* execl.c */
1308/* VARARGS1 */
1309int execl(const char *name, const char *, ...);
1310
1311/* execle.c */
1312int execle(const char *, const char *file, ...);
1313
1314/* execv.c */
1315int execv(const char *file, char *const *argv);
1316
1317/* lockf.c */
1318int lockf(int fildes, int function, off_t size);
1319
1320/* meminfosys.c */
1321int meminfo(const uint64_t *inaddr, int addr_count, const uint_t *info_req,
1322	int info_count, uint64_t *outdata, uint_t *validity);
1323
1324/* msgsys.c */
1325int msgget(key_t key, int msgflg);
1326int msgctl(int msqid, int cmd, struct msqid_ds *buf);
1327ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg);
1328int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg);
1329
1330/* nfssys.c */
1331/*
1332int exportfs(char *dir, struct export *ep);
1333int nfs_getfh(char *path, fhandle_t *fhp);
1334int nfssvc(int fd);
1335*/
1336
1337/* psetsys.c */
1338int pset_create(psetid_t *npset);
1339int pset_destroy(psetid_t pset);
1340int pset_assign(psetid_t pset, processorid_t cpu, psetid_t *opset);
1341int pset_assign_forced(psetid_t pset, processorid_t cpu, psetid_t *opset);
1342int pset_info(psetid_t pset, int *type, u_int *numcpus, processorid_t *cpulist);
1343int pset_bind(psetid_t pset, idtype_t idtype, id_t id, psetid_t *opset);
1344
1345/* rctlsys.c */
1346int getrctl(const char *name, rctlblk_t *old_rblk, rctlblk_t *new_rblk,
1347    int flags);
1348int setrctl(const char *name, rctlblk_t *old_rblk, rctlblk_t *new_rblk,
1349    int flags);
1350/* (private functions) */
1351int rctlctl(const char *, rctlblk_t *, int);
1352size_t rctllist(char *, size_t);
1353
1354
1355/* semsys.c */
1356int semctl(int semid, int semnum, int cmd, ...);
1357int semget(key_t key, int nsems, int semflg);
1358int semop(int semid, struct sembuf *sops, size_t nsops);
1359
1360/* shmsys.c */
1361void *shmat(int shmid, const void *shmaddr, int shmflg);
1362int shmctl(int shmid, int cmd, struct shmid_ds *buf);
1363#if defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4)
1364int shmdt(const void *);
1365#else
1366int shmdt(char *);
1367#endif /* defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4) */
1368int shmget(key_t key, size_t size, int shmflg);
1369
1370/* tasksys.c */
1371taskid_t settaskid(projid_t project, uint_t flags);
1372taskid_t gettaskid(void);
1373projid_t getprojid(void);
1374
1375/*
1376 * /usr/src/lib/libc/port/widec routines
1377 */
1378
1379/* fgetws.c */
1380wchar_t *fgetws(wchar_t *_RESTRICT_KYWD ptr, int  size,
1381	FILE *_RESTRICT_KYWD iop);
1382
1383/* fputwc.c */
1384wint_t fputwc(wint_t wc, FILE *iop);
1385wint_t putwc(wint_t wc, FILE *iop);
1386
1387/* fputws.c */
1388int fputws(const wchar_t *_RESTRICT_KYWD ptr, FILE *_RESTRICT_KYWD iop);
1389
1390/* getwchar.c */
1391wint_t getwchar(void);
1392
1393/* getwidth.c */
1394void getwidth(eucwidth_t *eucstruct);
1395
1396/* getws.c */
1397wchar_t *getws(wchar_t *ptr);
1398
1399/* iswctype.c */
1400int iswctype(wint_t wc, wctype_t charclass);
1401int iswalpha(wint_t c);
1402int iswupper(wint_t c);
1403int iswlower(wint_t c);
1404int iswdigit(wint_t c);
1405int iswxdigit(wint_t c);
1406int iswalnum(wint_t c);
1407int iswspace(wint_t c);
1408int iswpunct(wint_t c);
1409int iswprint(wint_t c);
1410int iswgraph(wint_t c);
1411int iswcntrl(wint_t c);
1412int isphonogram(wint_t c);
1413int isideogram(wint_t c);
1414int isenglish(wint_t c);
1415int isnumber(wint_t c);
1416int isspecial(wint_t c);
1417
1418/* libwcollate.c */
1419
1420/* putwchar.c */
1421wint_t putwchar(wint_t c);
1422
1423/* putws.c */
1424int putws(const wchar_t *ptr);
1425
1426/* scrwidth.c */
1427
1428/* strtows.c */
1429wchar_t *strtows(wchar_t *s1, char *s2);
1430char *wstostr(char *s1, wchar_t *s2);
1431
1432/* trwctype.c */
1433wint_t towupper(wint_t c);
1434wint_t towlower(wint_t c);
1435
1436/* ungetwc.c */
1437wint_t ungetwc(wint_t wc, FILE *iop);
1438
1439/* wcollate.c */
1440size_t wcsxfrm(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2,
1441	size_t n);
1442int wcscoll(const wchar_t *s1, const wchar_t *s2);
1443
1444/* wcsftime.c */
1445#if !defined(__amd64) 		/* XX64 - fix me */
1446size_t wcsftime(wchar_t *wcs, size_t maxsize,
1447	const char *format, const struct tm *timeptr);
1448#endif	/* __amd64 */
1449
1450/* wcstring.c */
1451wint_t fgetwc(FILE *iop);
1452wint_t getwc(FILE *iop);
1453int wcwidth(wchar_t wc);
1454int wcswidth(const wchar_t *pwcs, size_t n);
1455
1456/* wcswcs.c */
1457wchar_t *wcswcs(const wchar_t *ws1, const wchar_t *ws2);
1458
1459/* wcsxfrm.c - empty file! */
1460
1461/* wcsxfrm.xpg4.c */
1462
1463/* wisprint.c */
1464int wisprint(wchar_t c);
1465
1466/* wscasecmp.c */
1467int wscasecmp(const wchar_t *s1, const wchar_t *s2);
1468
1469/* wscat.c */
1470wchar_t *wcscat(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2);
1471wchar_t *wscat(wchar_t *s1, const wchar_t *s2);
1472
1473/* wschr.c */
1474wchar_t *wcschr(const wchar_t *sp, wchar_t c);
1475wchar_t *wschr(const wchar_t *sp, wchar_t c);
1476
1477/* wscmp.c */
1478int wcscmp(const wchar_t *s1, const wchar_t *s2);
1479int wscmp(const wchar_t *s1, const wchar_t *s2);
1480
1481/* wscol.c */
1482int wscol(const wchar_t *s1);
1483
1484/* wscpy.c */
1485wchar_t *wcscpy(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2);
1486wchar_t *wscpy(wchar_t *s1, const wchar_t *s2);
1487
1488/* wscspn.c */
1489size_t wcscspn(const wchar_t *string, const wchar_t *charset);
1490size_t wscspn(const wchar_t *string, const wchar_t *charset);
1491
1492/* wsdup.c */
1493wchar_t *wsdup(const wchar_t *s1);
1494
1495/* wslen.c */
1496size_t wcslen(const wchar_t *s);
1497size_t wslen(const wchar_t *s);
1498
1499/* wsncasecmp.c */
1500int wsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n);
1501
1502/* wsncat.c */
1503wchar_t *wcsncat(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2,
1504	size_t n);
1505wchar_t *wsncat(wchar_t *s1, const wchar_t *s2, size_t n);
1506
1507/* wsncmp.c */
1508int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
1509int wsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
1510
1511/* wsncpy.c */
1512wchar_t *wcsncpy(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2,
1513	size_t n);
1514wchar_t *wsncpy(wchar_t *s1, const wchar_t *s2, size_t n);
1515
1516/* wspbrk.c */
1517wchar_t *wcspbrk(const wchar_t *string, const wchar_t *brkset);
1518wchar_t *wspbrk(const wchar_t *string, const wchar_t *brkset);
1519
1520/* wsprintf.c */
1521int wsprintf(wchar_t *wstring, const char *format, ...);
1522
1523/* wsrchr.c */
1524wchar_t *wcsrchr(const wchar_t *sp, wchar_t c);
1525wchar_t *wsrchr(const wchar_t *sp, wchar_t c);
1526
1527/* wsscanf.c */
1528int wsscanf(wchar_t *s, const char *format, ...);
1529
1530/* wssize.c */
1531
1532/* wsspn.c */
1533size_t wcsspn(const wchar_t *string, const wchar_t *charset);
1534size_t wsspn(const wchar_t *string, const wchar_t *charset);
1535
1536/* wstod.c */
1537double wcstod(const wchar_t *_RESTRICT_KYWD cp, wchar_t **_RESTRICT_KYWD ptr);
1538float wcstof(const wchar_t *_RESTRICT_KYWD cp, wchar_t **_RESTRICT_KYWD ptr);
1539long double wcstold(const wchar_t *_RESTRICT_KYWD cp,
1540	wchar_t **_RESTRICT_KYWD ptr);
1541double wstod(const wchar_t *cp, wchar_t **ptr);
1542
1543/* wstok.c */
1544#if !defined(__amd64) 		/* XX64 - fix me */
1545wchar_t *wcstok(wchar_t *string, const wchar_t *sepset);
1546wchar_t *wstok(wchar_t *string, const wchar_t *sepset);
1547#endif	/* __amd64 */
1548
1549/* wcstol.c */
1550long wcstol(const wchar_t *_RESTRICT_KYWD str, wchar_t **_RESTRICT_KYWD ptr,
1551	int base);
1552long long wcstoll(const wchar_t *_RESTRICT_KYWD str,
1553	wchar_t **_RESTRICT_KYWD ptr, int base);
1554
1555/* wcstoul.c */
1556unsigned long wcstoul(const wchar_t *_RESTRICT_KYWD str,
1557	wchar_t **_RESTRICT_KYWD ptr, int base);
1558unsigned long long wcstoull(const wchar_t *_RESTRICT_KYWD str,
1559	wchar_t **_RESTRICT_KYWD ptr, int base);
1560
1561/* wcstoimax.c */
1562intmax_t wcstoimax(const wchar_t *_RESTRICT_KYWD nptr,
1563	wchar_t **_RESTRICT_KYWD endptr, int base);
1564uintmax_t wcstoumax(const wchar_t *_RESTRICT_KYWD nptr,
1565	wchar_t **_RESTRICT_KYWD endptr, int base);
1566
1567/* wstol.c */
1568long wstol(const wchar_t *str, wchar_t **ptr, int base);
1569
1570/* wstoll.c */
1571long long wstoll(const wchar_t *str, wchar_t **ptr, int base);
1572long long watoll(const wchar_t *p);
1573
1574/* wsxfrm.c */
1575size_t wsxfrm(wchar_t *s1, const wchar_t *s2, size_t n);
1576int wscoll(const wchar_t *s1, const wchar_t *s2);
1577
1578/*
1579 * /usr/src/lib/libc/port/gen/event_port.c
1580 */
1581int port_dispatch(int port, int flags, int source, int events, uintptr_t object,
1582    void *user);
1583
1584/*
1585 * /usr/src/lib/libc/$MACH/gen routines
1586 */
1587
1588/* alloca.s */
1589
1590void *__builtin_alloca(size_t);
1591
1592/*
1593 * modctl(int arg, ...) and utssys(...) are not available from a header
1594 * file, but our utilities which make use of it should be able to be
1595 * lint clean.
1596 */
1597int modctl(int arg, ...);
1598int utssys(void *buf, int arg, int type, void *outbp);
1599
1600
1601typedef float single;
1602typedef unsigned extended[3];
1603typedef long double quadruple;
1604typedef unsigned fp_exception_field_type;
1605
1606typedef char decimal_string[512];
1607
1608enum fp_class_type {
1609	fp_zero	 = 0,
1610	fp_subnormal    = 1,
1611	fp_normal	= 2,
1612	fp_infinity	= 3,
1613	fp_quiet	= 4,
1614	fp_signaling    = 5
1615};
1616
1617enum fp_direction_type {
1618	fp_nearest	= 0,
1619	fp_tozero	= 1,
1620	fp_positive	= 2,
1621	fp_negative	= 3
1622};
1623
1624typedef struct {
1625	enum fp_class_type fpclass;
1626	int sign;
1627	int exponent;
1628	decimal_string ds;
1629	int more;
1630	int ndigits;
1631} decimal_record;
1632
1633enum decimal_form {
1634	fixed_form,
1635	floating_form
1636};
1637
1638typedef struct {
1639	enum fp_direction_type rd;
1640	enum decimal_form df;
1641	int ndigits;
1642} decimal_mode;
1643
1644enum decimal_string_form {
1645	invalid_form,
1646	whitespace_form,
1647	fixed_int_form,
1648	fixed_intdot_form,
1649	fixed_dotfrac_form,
1650	fixed_intdotfrac_form,
1651	floating_int_form,
1652	floating_intdot_form,
1653	floating_dotfrac_form,
1654	floating_intdotfrac_form,
1655	inf_form,
1656	infinity_form,
1657	nan_form,
1658	nanstring_form
1659};
1660
1661typedef int sigfpe_code_type;
1662
1663typedef void (*sigfpe_handler_type)();
1664
1665extern sigfpe_handler_type sigfpe(sigfpe_code_type, sigfpe_handler_type);
1666
1667extern void single_to_decimal(single *, decimal_mode *, decimal_record *,
1668				fp_exception_field_type *);
1669
1670extern void double_to_decimal(double *, decimal_mode *, decimal_record *,
1671				fp_exception_field_type *);
1672extern void extended_to_decimal(extended *, decimal_mode *,
1673				decimal_record *, fp_exception_field_type *);
1674extern void quadruple_to_decimal(quadruple *, decimal_mode *,
1675				decimal_record *, fp_exception_field_type *);
1676extern void decimal_to_single(single *, decimal_mode *, decimal_record *,
1677				fp_exception_field_type *);
1678extern void decimal_to_double(double *, decimal_mode *, decimal_record *,
1679				fp_exception_field_type *);
1680extern void decimal_to_extended(extended *, decimal_mode *,
1681				decimal_record *, fp_exception_field_type *);
1682extern void decimal_to_quadruple(quadruple *, decimal_mode *,
1683				decimal_record *, fp_exception_field_type *);
1684extern void string_to_decimal(char **, int, int, decimal_record *,
1685				enum decimal_string_form *, char **);
1686extern void func_to_decimal(char **, int, int, decimal_record *,
1687				enum decimal_string_form *, char **,
1688				int (*)(void), int *, int (*)(int));
1689extern void file_to_decimal(char **, int, int, decimal_record *,
1690				enum decimal_string_form *, char **,
1691				FILE *, int *);
1692extern char *seconvert(single *, int, int *, int *, char *);
1693extern char *sfconvert(single *, int, int *, int *, char *);
1694extern char *sgconvert(single *, int, int, char *);
1695extern char *econvert(double, int, int *, int *, char *);
1696extern char *fconvert(double, int, int *, int *, char *);
1697extern char *gconvert(double, int, int, char *);
1698extern char *qeconvert(quadruple *, int, int *, int *, char *);
1699extern char *qfconvert(quadruple *, int, int *, int *, char *);
1700extern char *qgconvert(quadruple *, int, int, char *);
1701
1702extern void __assert(const char *, const char *, int);
1703
1704extern int setjmp(jmp_buf);
1705extern void longjmp(jmp_buf, int);
1706extern int sigsetjmp(sigjmp_buf, int);
1707extern void siglongjmp(sigjmp_buf, int);
1708
1709int uname(struct utsname *);
1710int _uname(struct utsname *);
1711
1712int errno;
1713int *___errno()
1714{ return (&errno); }
1715
1716extern int getloadavg(double [], int);
1717
1718extern long pcsample(uintptr_t [], long);
1719
1720int fstat(int, struct stat *);
1721int stat(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
1722int lstat(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
1723int mknod(const char *, mode_t, dev_t);
1724
1725extern int __init_daemon_priv(int, uid_t uid, gid_t gid, ...);
1726extern void __fini_daemon_priv(const char *, ...);
1727extern int __init_suid_priv(int, ...);
1728extern int __priv_bracket(priv_op_t);
1729extern void __priv_relinquish(void);
1730extern const char * __priv_getsetbynum(const void *, int);
1731extern char * __priv_set_to_str(void *, const priv_set_t *, char, int);
1732
1733/* private interface to get the groups list for a certain user */
1734int _getgroupsbymember(const char *, gid_t[], int, int);
1735
1736/* private interface for use only by java */
1737volatile sc_shared_t *volatile *_thr_schedctl(void);
1738
1739/* private interface to unmount all autofs mounts */
1740int _autofssys(enum autofssys_op, void *);
1741
1742/* label.c */
1743extern int is_system_labeled(void);
1744