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