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