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