xref: /titanic_44/usr/src/lib/libc/port/llib-lc (revision 24da5b34f49324ed742a340010ed5bd3d4e06625)
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 2007 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 setprojrctl(const char *name, rctlblk_t *new_rblk, size_t size, int flags);
1352int rctlctl(const char *, rctlblk_t *, int);
1353size_t rctllist(char *, size_t);
1354
1355
1356/* semsys.c */
1357int semctl(int semid, int semnum, int cmd, ...);
1358int semget(key_t key, int nsems, int semflg);
1359int semop(int semid, struct sembuf *sops, size_t nsops);
1360
1361/* shmsys.c */
1362void *shmat(int shmid, const void *shmaddr, int shmflg);
1363int shmctl(int shmid, int cmd, struct shmid_ds *buf);
1364#if defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4)
1365int shmdt(const void *);
1366#else
1367int shmdt(char *);
1368#endif /* defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4) */
1369int shmget(key_t key, size_t size, int shmflg);
1370
1371/* tasksys.c */
1372taskid_t settaskid(projid_t project, uint_t flags);
1373taskid_t gettaskid(void);
1374projid_t getprojid(void);
1375
1376/*
1377 * /usr/src/lib/libc/port/widec routines
1378 */
1379
1380/* fgetws.c */
1381wchar_t *fgetws(wchar_t *_RESTRICT_KYWD ptr, int  size,
1382	FILE *_RESTRICT_KYWD iop);
1383
1384/* fputwc.c */
1385wint_t fputwc(wint_t wc, FILE *iop);
1386wint_t putwc(wint_t wc, FILE *iop);
1387
1388/* fputws.c */
1389int fputws(const wchar_t *_RESTRICT_KYWD ptr, FILE *_RESTRICT_KYWD iop);
1390
1391/* getwchar.c */
1392wint_t getwchar(void);
1393
1394/* getwidth.c */
1395void getwidth(eucwidth_t *eucstruct);
1396
1397/* getws.c */
1398wchar_t *getws(wchar_t *ptr);
1399
1400/* iswctype.c */
1401int iswctype(wint_t wc, wctype_t charclass);
1402int iswalpha(wint_t c);
1403int iswupper(wint_t c);
1404int iswlower(wint_t c);
1405int iswdigit(wint_t c);
1406int iswxdigit(wint_t c);
1407int iswalnum(wint_t c);
1408int iswspace(wint_t c);
1409int iswpunct(wint_t c);
1410int iswprint(wint_t c);
1411int iswgraph(wint_t c);
1412int iswcntrl(wint_t c);
1413int isphonogram(wint_t c);
1414int isideogram(wint_t c);
1415int isenglish(wint_t c);
1416int isnumber(wint_t c);
1417int isspecial(wint_t c);
1418
1419/* libwcollate.c */
1420
1421/* putwchar.c */
1422wint_t putwchar(wint_t c);
1423
1424/* putws.c */
1425int putws(const wchar_t *ptr);
1426
1427/* scrwidth.c */
1428
1429/* strtows.c */
1430wchar_t *strtows(wchar_t *s1, char *s2);
1431char *wstostr(char *s1, wchar_t *s2);
1432
1433/* trwctype.c */
1434wint_t towupper(wint_t c);
1435wint_t towlower(wint_t c);
1436
1437/* ungetwc.c */
1438wint_t ungetwc(wint_t wc, FILE *iop);
1439
1440/* wcollate.c */
1441size_t wcsxfrm(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2,
1442	size_t n);
1443int wcscoll(const wchar_t *s1, const wchar_t *s2);
1444
1445/* wcsftime.c */
1446#if !defined(__amd64) 		/* XX64 - fix me */
1447size_t wcsftime(wchar_t *wcs, size_t maxsize,
1448	const char *format, const struct tm *timeptr);
1449#endif	/* __amd64 */
1450
1451/* wcstring.c */
1452wint_t fgetwc(FILE *iop);
1453wint_t getwc(FILE *iop);
1454int wcwidth(wchar_t wc);
1455int wcswidth(const wchar_t *pwcs, size_t n);
1456
1457/* wcswcs.c */
1458wchar_t *wcswcs(const wchar_t *ws1, const wchar_t *ws2);
1459
1460/* wcsxfrm.c - empty file! */
1461
1462/* wcsxfrm.xpg4.c */
1463
1464/* wisprint.c */
1465int wisprint(wchar_t c);
1466
1467/* wscasecmp.c */
1468int wscasecmp(const wchar_t *s1, const wchar_t *s2);
1469
1470/* wscat.c */
1471wchar_t *wcscat(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2);
1472wchar_t *wscat(wchar_t *s1, const wchar_t *s2);
1473
1474/* wschr.c */
1475wchar_t *wcschr(const wchar_t *sp, wchar_t c);
1476wchar_t *wschr(const wchar_t *sp, wchar_t c);
1477
1478/* wscmp.c */
1479int wcscmp(const wchar_t *s1, const wchar_t *s2);
1480int wscmp(const wchar_t *s1, const wchar_t *s2);
1481
1482/* wscol.c */
1483int wscol(const wchar_t *s1);
1484
1485/* wscpy.c */
1486wchar_t *wcscpy(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2);
1487wchar_t *wscpy(wchar_t *s1, const wchar_t *s2);
1488
1489/* wscspn.c */
1490size_t wcscspn(const wchar_t *string, const wchar_t *charset);
1491size_t wscspn(const wchar_t *string, const wchar_t *charset);
1492
1493/* wsdup.c */
1494wchar_t *wsdup(const wchar_t *s1);
1495
1496/* wslen.c */
1497size_t wcslen(const wchar_t *s);
1498size_t wslen(const wchar_t *s);
1499
1500/* wsncasecmp.c */
1501int wsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n);
1502
1503/* wsncat.c */
1504wchar_t *wcsncat(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2,
1505	size_t n);
1506wchar_t *wsncat(wchar_t *s1, const wchar_t *s2, size_t n);
1507
1508/* wsncmp.c */
1509int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
1510int wsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
1511
1512/* wsncpy.c */
1513wchar_t *wcsncpy(wchar_t *_RESTRICT_KYWD s1, const wchar_t *_RESTRICT_KYWD s2,
1514	size_t n);
1515wchar_t *wsncpy(wchar_t *s1, const wchar_t *s2, size_t n);
1516
1517/* wspbrk.c */
1518wchar_t *wcspbrk(const wchar_t *string, const wchar_t *brkset);
1519wchar_t *wspbrk(const wchar_t *string, const wchar_t *brkset);
1520
1521/* wsprintf.c */
1522int wsprintf(wchar_t *wstring, const char *format, ...);
1523
1524/* wsrchr.c */
1525wchar_t *wcsrchr(const wchar_t *sp, wchar_t c);
1526wchar_t *wsrchr(const wchar_t *sp, wchar_t c);
1527
1528/* wsscanf.c */
1529int wsscanf(wchar_t *s, const char *format, ...);
1530
1531/* wssize.c */
1532
1533/* wsspn.c */
1534size_t wcsspn(const wchar_t *string, const wchar_t *charset);
1535size_t wsspn(const wchar_t *string, const wchar_t *charset);
1536
1537/* wstod.c */
1538double wcstod(const wchar_t *_RESTRICT_KYWD cp, wchar_t **_RESTRICT_KYWD ptr);
1539float wcstof(const wchar_t *_RESTRICT_KYWD cp, wchar_t **_RESTRICT_KYWD ptr);
1540long double wcstold(const wchar_t *_RESTRICT_KYWD cp,
1541	wchar_t **_RESTRICT_KYWD ptr);
1542double wstod(const wchar_t *cp, wchar_t **ptr);
1543
1544/* wstok.c */
1545#if !defined(__amd64) 		/* XX64 - fix me */
1546wchar_t *wcstok(wchar_t *string, const wchar_t *sepset);
1547wchar_t *wstok(wchar_t *string, const wchar_t *sepset);
1548#endif	/* __amd64 */
1549
1550/* wcstol.c */
1551long wcstol(const wchar_t *_RESTRICT_KYWD str, wchar_t **_RESTRICT_KYWD ptr,
1552	int base);
1553long long wcstoll(const wchar_t *_RESTRICT_KYWD str,
1554	wchar_t **_RESTRICT_KYWD ptr, int base);
1555
1556/* wcstoul.c */
1557unsigned long wcstoul(const wchar_t *_RESTRICT_KYWD str,
1558	wchar_t **_RESTRICT_KYWD ptr, int base);
1559unsigned long long wcstoull(const wchar_t *_RESTRICT_KYWD str,
1560	wchar_t **_RESTRICT_KYWD ptr, int base);
1561
1562/* wcstoimax.c */
1563intmax_t wcstoimax(const wchar_t *_RESTRICT_KYWD nptr,
1564	wchar_t **_RESTRICT_KYWD endptr, int base);
1565uintmax_t wcstoumax(const wchar_t *_RESTRICT_KYWD nptr,
1566	wchar_t **_RESTRICT_KYWD endptr, int base);
1567
1568/* wstol.c */
1569long wstol(const wchar_t *str, wchar_t **ptr, int base);
1570
1571/* wstoll.c */
1572long long wstoll(const wchar_t *str, wchar_t **ptr, int base);
1573long long watoll(const wchar_t *p);
1574
1575/* wsxfrm.c */
1576size_t wsxfrm(wchar_t *s1, const wchar_t *s2, size_t n);
1577int wscoll(const wchar_t *s1, const wchar_t *s2);
1578
1579/*
1580 * /usr/src/lib/libc/port/gen/event_port.c
1581 */
1582int port_dispatch(int port, int flags, int source, int events, uintptr_t object,
1583    void *user);
1584
1585/*
1586 * /usr/src/lib/libc/$MACH/gen routines
1587 */
1588
1589/* alloca.s */
1590
1591void *__builtin_alloca(size_t);
1592
1593/*
1594 * modctl(int arg, ...) and utssys(...) are not available from a header
1595 * file, but our utilities which make use of it should be able to be
1596 * lint clean.
1597 */
1598int modctl(int arg, ...);
1599int utssys(void *buf, int arg, int type, void *outbp);
1600
1601
1602typedef float single;
1603typedef unsigned extended[3];
1604typedef long double quadruple;
1605typedef unsigned fp_exception_field_type;
1606
1607typedef char decimal_string[512];
1608
1609enum fp_class_type {
1610	fp_zero	 = 0,
1611	fp_subnormal    = 1,
1612	fp_normal	= 2,
1613	fp_infinity	= 3,
1614	fp_quiet	= 4,
1615	fp_signaling    = 5
1616};
1617
1618enum fp_direction_type {
1619	fp_nearest	= 0,
1620	fp_tozero	= 1,
1621	fp_positive	= 2,
1622	fp_negative	= 3
1623};
1624
1625typedef struct {
1626	enum fp_class_type fpclass;
1627	int sign;
1628	int exponent;
1629	decimal_string ds;
1630	int more;
1631	int ndigits;
1632} decimal_record;
1633
1634enum decimal_form {
1635	fixed_form,
1636	floating_form
1637};
1638
1639typedef struct {
1640	enum fp_direction_type rd;
1641	enum decimal_form df;
1642	int ndigits;
1643} decimal_mode;
1644
1645enum decimal_string_form {
1646	invalid_form,
1647	whitespace_form,
1648	fixed_int_form,
1649	fixed_intdot_form,
1650	fixed_dotfrac_form,
1651	fixed_intdotfrac_form,
1652	floating_int_form,
1653	floating_intdot_form,
1654	floating_dotfrac_form,
1655	floating_intdotfrac_form,
1656	inf_form,
1657	infinity_form,
1658	nan_form,
1659	nanstring_form
1660};
1661
1662typedef int sigfpe_code_type;
1663
1664typedef void (*sigfpe_handler_type)();
1665
1666extern sigfpe_handler_type sigfpe(sigfpe_code_type, sigfpe_handler_type);
1667
1668extern void single_to_decimal(single *, decimal_mode *, decimal_record *,
1669				fp_exception_field_type *);
1670
1671extern void double_to_decimal(double *, decimal_mode *, decimal_record *,
1672				fp_exception_field_type *);
1673extern void extended_to_decimal(extended *, decimal_mode *,
1674				decimal_record *, fp_exception_field_type *);
1675extern void quadruple_to_decimal(quadruple *, decimal_mode *,
1676				decimal_record *, fp_exception_field_type *);
1677extern void decimal_to_single(single *, decimal_mode *, decimal_record *,
1678				fp_exception_field_type *);
1679extern void decimal_to_double(double *, decimal_mode *, decimal_record *,
1680				fp_exception_field_type *);
1681extern void decimal_to_extended(extended *, decimal_mode *,
1682				decimal_record *, fp_exception_field_type *);
1683extern void decimal_to_quadruple(quadruple *, decimal_mode *,
1684				decimal_record *, fp_exception_field_type *);
1685extern void string_to_decimal(char **, int, int, decimal_record *,
1686				enum decimal_string_form *, char **);
1687extern void func_to_decimal(char **, int, int, decimal_record *,
1688				enum decimal_string_form *, char **,
1689				int (*)(void), int *, int (*)(int));
1690extern void file_to_decimal(char **, int, int, decimal_record *,
1691				enum decimal_string_form *, char **,
1692				FILE *, int *);
1693extern char *seconvert(single *, int, int *, int *, char *);
1694extern char *sfconvert(single *, int, int *, int *, char *);
1695extern char *sgconvert(single *, int, int, char *);
1696extern char *econvert(double, int, int *, int *, char *);
1697extern char *fconvert(double, int, int *, int *, char *);
1698extern char *gconvert(double, int, int, char *);
1699extern char *qeconvert(quadruple *, int, int *, int *, char *);
1700extern char *qfconvert(quadruple *, int, int *, int *, char *);
1701extern char *qgconvert(quadruple *, int, int, char *);
1702
1703extern void __assert(const char *, const char *, int);
1704
1705extern int setjmp(jmp_buf);
1706extern void longjmp(jmp_buf, int);
1707extern int sigsetjmp(sigjmp_buf, int);
1708extern void siglongjmp(sigjmp_buf, int);
1709
1710int uname(struct utsname *);
1711int _uname(struct utsname *);
1712
1713int errno;
1714int *___errno()
1715{ return (&errno); }
1716
1717extern int getloadavg(double [], int);
1718
1719extern long pcsample(uintptr_t [], long);
1720
1721int fstat(int, struct stat *);
1722int stat(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
1723int lstat(const char *_RESTRICT_KYWD, struct stat *_RESTRICT_KYWD);
1724int mknod(const char *, mode_t, dev_t);
1725
1726extern int __init_daemon_priv(int, uid_t uid, gid_t gid, ...);
1727extern void __fini_daemon_priv(const char *, ...);
1728extern int __init_suid_priv(int, ...);
1729extern int __priv_bracket(priv_op_t);
1730extern void __priv_relinquish(void);
1731extern const char * __priv_getsetbynum(const void *, int);
1732extern char * __priv_set_to_str(void *, const priv_set_t *, char, int);
1733
1734/* private interface to get the groups list for a certain user */
1735int _getgroupsbymember(const char *, gid_t[], int, int);
1736
1737/* private interface for use only by java */
1738volatile sc_shared_t *volatile *_thr_schedctl(void);
1739
1740/* private interface to unmount all autofs mounts */
1741int _autofssys(enum autofssys_op, void *);
1742
1743/* label.c */
1744extern int is_system_labeled(void);
1745
1746/* until TOG resolves the name, keep this private */
1747int __accessat(int, const char *, int);
1748