From 54d853eaccae1f4f2e04ae70d79e34cfef86bf67 Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Mon, 19 Oct 2020 13:54:17 +0300 Subject: include: update to 6.8 --- include/CVS/Entries | 18 +- include/assert.h | 7 +- include/bitstring.h | 46 ++-- include/err.h | 73 ++++++- include/grp.h | 82 +++++++- include/pwd.h | 123 ++++++++++- include/readpassphrase.h | 4 +- include/resolv.h | 316 +++++++++++++++++++++++++++- include/sndio.h | 9 +- include/stdio.h | 10 +- include/stdlib.h | 331 ++++++++++++++++++++++++++++- include/string.h | 143 ++++++++++++- include/tib.h | 7 +- include/unistd.h | 535 ++++++++++++++++++++++++++++++++++++++++++++++- 14 files changed, 1629 insertions(+), 75 deletions(-) (limited to 'include') diff --git a/include/CVS/Entries b/include/CVS/Entries index 97f2910..ab5a7bf 100644 --- a/include/CVS/Entries +++ b/include/CVS/Entries @@ -1,9 +1,13 @@ +D/arpa//// +D/protocols//// +D/rpc//// +D/rpcsvc//// /Makefile/1.226/Thu Nov 14 21:14:53 2019// /a.out.h/1.3/Mon Jun 2 19:34:12 2003// /ar.h/1.3/Mon Jun 2 19:34:12 2003// /asr.h/1.2/Thu Oct 24 05:57:41 2019// -/assert.h/1.13/Sun Jun 26 21:11:41 2011// -/bitstring.h/1.5/Mon Jun 2 19:34:12 2003// +/assert.h/1.15/Sun Sep 6 12:57:25 2020// +/bitstring.h/1.6/Sun May 10 00:56:06 2020// /blf.h/1.7/Wed Mar 14 17:59:41 2007// /bsd_auth.h/1.11/Thu Mar 9 10:13:03 2017// /complex.h/1.5/Sun Mar 16 18:38:30 2014// @@ -66,18 +70,18 @@ /sha2.h/1.10/Sat Sep 3 17:00:29 2016// /signal.h/1.26/Wed May 30 13:20:38 2018// /siphash.h/1.3/Fri Feb 20 11:51:03 2015// -/sndio.h/1.10/Wed Feb 26 13:53:58 2020// +/sndio.h/1.13/Sun Jun 28 05:21:38 2020// /spawn.h/1.3/Wed May 20 22:50:07 2015// /stdbool.h/1.7/Fri Sep 4 23:47:09 2015// /stddef.h/1.14/Fri Jan 6 14:36:50 2017// -/stdio.h/1.53/Fri Sep 9 18:12:37 2016// +/stdio.h/1.54/Fri Sep 11 17:56:41 2020// /stdlib.h/1.76/Fri May 10 15:03:24 2019// /string.h/1.32/Tue Sep 5 03:16:13 2017// /strings.h/1.6/Sun Sep 10 21:50:36 2017// /sysexits.h/1.5/Mon Jun 2 19:34:12 2003// /tar.h/1.3/Thu Jun 26 05:42:04 2008// /tgmath.h/1.1/Fri Jul 8 19:28:06 2011// -/tib.h/1.7/Fri May 10 13:29:21 2019// +/tib.h/1.8/Tue Jul 14 16:48:13 2020// /time.h/1.31/Tue Oct 30 16:28:42 2018// /ttyent.h/1.4/Mon Jun 2 19:34:12 2003// /unistd.h/1.106/Fri Jul 13 09:25:22 2018// @@ -87,7 +91,3 @@ /vis.h/1.15/Mon Jul 20 01:52:27 2015// /wchar.h/1.31/Tue Sep 5 03:16:13 2017// /wctype.h/1.6/Tue Sep 5 03:16:13 2017// -D/arpa//// -D/protocols//// -D/rpc//// -D/rpcsvc//// diff --git a/include/assert.h b/include/assert.h index c885a13..ccc8e33 100644 --- a/include/assert.h +++ b/include/assert.h @@ -1,4 +1,4 @@ -/* $OpenBSD: assert.h,v 1.13 2011/06/26 21:11:41 espie Exp $ */ +/* $OpenBSD: assert.h,v 1.15 2020/09/06 12:57:25 millert Exp $ */ /* $NetBSD: assert.h,v 1.6 1994/10/26 00:55:44 cgd Exp $ */ /*- @@ -61,6 +61,11 @@ #ifndef _ASSERT_H_ #define _ASSERT_H_ + +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112 +#define static_assert _Static_assert +#endif + __BEGIN_DECLS __dead void __assert(const char *, int, const char *); __dead void __assert2(const char *, int, const char *, const char *); diff --git a/include/bitstring.h b/include/bitstring.h index 8fc3423..1352874 100644 --- a/include/bitstring.h +++ b/include/bitstring.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bitstring.h,v 1.5 2003/06/02 19:34:12 millert Exp $ */ +/* $OpenBSD: bitstring.h,v 1.6 2020/05/10 00:56:06 guenther Exp $ */ /* $NetBSD: bitstring.h,v 1.5 1997/05/14 15:49:55 pk Exp $ */ /* @@ -83,46 +83,46 @@ typedef unsigned char bitstr_t; /* clear bits start ... stop in bitstring */ #define bit_nclear(name, start, stop) do { \ - register bitstr_t *_name = name; \ - register int _start = start, _stop = stop; \ - while (_start <= _stop) { \ - bit_clear(_name, _start); \ - _start++; \ + register bitstr_t *__name = (name); \ + register int __start = (start), __stop = (stop); \ + while (__start <= __stop) { \ + bit_clear(__name, __start); \ + __start++; \ } \ } while(0) /* set bits start ... stop in bitstring */ #define bit_nset(name, start, stop) do { \ - register bitstr_t *_name = name; \ - register int _start = start, _stop = stop; \ - while (_start <= _stop) { \ - bit_set(_name, _start); \ - _start++; \ + register bitstr_t *__name = (name); \ + register int __start = (start), __stop = (stop); \ + while (__start <= __stop) { \ + bit_set(__name, __start); \ + __start++; \ } \ } while(0) /* find first bit clear in name */ #define bit_ffc(name, nbits, value) do { \ - register bitstr_t *_name = name; \ - register int _bit, _nbits = nbits, _value = -1; \ - for (_bit = 0; _bit < _nbits; ++_bit) \ - if (!bit_test(_name, _bit)) { \ - _value = _bit; \ + register bitstr_t *__name = (name); \ + register int __bit, __nbits = (nbits), __value = -1; \ + for (__bit = 0; __bit < __nbits; ++__bit) \ + if (!bit_test(__name, __bit)) { \ + __value = __bit; \ break; \ } \ - *(value) = _value; \ + *(value) = __value; \ } while(0) /* find first bit set in name */ #define bit_ffs(name, nbits, value) do { \ - register bitstr_t *_name = name; \ - register int _bit, _nbits = nbits, _value = -1; \ - for (_bit = 0; _bit < _nbits; ++_bit) \ - if (bit_test(_name, _bit)) { \ - _value = _bit; \ + register bitstr_t *__name = (name); \ + register int __bit, __nbits = (nbits), __value = -1; \ + for (__bit = 0; __bit < __nbits; ++__bit) \ + if (bit_test(__name, __bit)) { \ + __value = __bit; \ break; \ } \ - *(value) = _value; \ + *(value) = __value; \ } while(0) #endif /* !_BITSTRING_H_ */ diff --git a/include/err.h b/include/err.h index c537811..3fed1b5 100644 --- a/include/err.h +++ b/include/err.h @@ -1,3 +1,70 @@ -#include_next -void warnc(int, const char *, ...) __attribute__((__format__ (printf, 2, 3))); -void vwarnc(int, const char *, va_list) __attribute__((__format__ (printf, 2, 0))); +/* $OpenBSD: err.h,v 1.13 2015/08/31 02:53:56 guenther Exp $ */ +/* $NetBSD: err.h,v 1.11 1994/10/26 00:55:52 cgd Exp $ */ + +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)err.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _ERR_H_ +#define _ERR_H_ + +#include +#include /* for __va_list */ + +__BEGIN_DECLS + +__dead void err(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__dead void verr(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +__dead void errc(int, int, const char *, ...) + __attribute__((__format__ (printf, 3, 4))); +__dead void verrc(int, int, const char *, __va_list) + __attribute__((__format__ (printf, 3, 0))); +__dead void errx(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +__dead void verrx(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +void warn(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void vwarn(const char *, __va_list) + __attribute__((__format__ (printf, 1, 0))); +void warnc(int, const char *, ...) + __attribute__((__format__ (printf, 2, 3))); +void vwarnc(int, const char *, __va_list) + __attribute__((__format__ (printf, 2, 0))); +void warnx(const char *, ...) + __attribute__((__format__ (printf, 1, 2))); +void vwarnx(const char *, __va_list) + __attribute__((__format__ (printf, 1, 0))); + +__END_DECLS + +#endif /* !_ERR_H_ */ diff --git a/include/grp.h b/include/grp.h index c59cf96..ebf6518 100644 --- a/include/grp.h +++ b/include/grp.h @@ -1,4 +1,78 @@ -#include_next -#define setgroupent(n) setgrent() -const char *group_from_gid(gid_t, int); -int gid_from_group(const char *, gid_t *); +/* $OpenBSD: grp.h,v 1.13 2018/09/13 12:31:15 millert Exp $ */ +/* $NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $ */ + +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)grp.h 8.2 (Berkeley) 1/21/94 + */ + +#ifndef _GRP_H_ +#define _GRP_H_ + +#include + +#if __BSD_VISIBLE +#define _PATH_GROUP "/etc/group" +#define _GR_BUF_LEN (1024+200*sizeof(char*)) +#endif + +struct group { + char *gr_name; /* group name */ + char *gr_passwd; /* group password */ + gid_t gr_gid; /* group id */ + char **gr_mem; /* group members */ +}; + +__BEGIN_DECLS +struct group *getgrgid(gid_t); +struct group *getgrnam(const char *); +#if __BSD_VISIBLE || __XPG_VISIBLE +struct group *getgrent(void); +void setgrent(void); +void endgrent(void); +#endif +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 199506 || __XPG_VISIBLE +int getgrgid_r(gid_t, struct group *, char *, + size_t, struct group **); +int getgrnam_r(const char *, struct group *, char *, + size_t, struct group **); +#endif +#if __BSD_VISIBLE +int setgroupent(int); +int gid_from_group(const char *, gid_t *); +const char *group_from_gid(gid_t, int); +#endif +__END_DECLS + +#endif /* !_GRP_H_ */ diff --git a/include/pwd.h b/include/pwd.h index c1aabba..8410734 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -1,4 +1,119 @@ -#include_next -#define setpassent(n) setpwent() -const char *user_from_uid(uid_t, int); -int uid_from_user(const char *, uid_t *); +/* $OpenBSD: pwd.h,v 1.26 2018/09/13 12:31:15 millert Exp $ */ +/* $NetBSD: pwd.h,v 1.9 1996/05/15 21:36:45 jtc Exp $ */ + +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * Portions Copyright(C) 1995, 1996, Jason Downs. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)pwd.h 8.2 (Berkeley) 1/21/94 + */ + +#ifndef _PWD_H_ +#define _PWD_H_ + +#include + +#if __BSD_VISIBLE +#define _PATH_PASSWD "/etc/passwd" +#define _PATH_MASTERPASSWD "/etc/master.passwd" +#define _PATH_MASTERPASSWD_LOCK "/etc/ptmp" + +#define _PATH_MP_DB "/etc/pwd.db" +#define _PATH_SMP_DB "/etc/spwd.db" + +#define _PATH_PWD_MKDB "/usr/sbin/pwd_mkdb" + +#define _PW_KEYBYNAME '1' /* stored by name */ +#define _PW_KEYBYNUM '2' /* stored by entry in the "file" */ +#define _PW_KEYBYUID '3' /* stored by uid */ + +#define _PW_YPTOKEN "__YP!" + +#define _PASSWORD_EFMT1 '_' /* extended encryption format */ + +#define _PASSWORD_LEN 128 /* max length, not counting NUL */ +#define _PW_NAME_LEN 31 /* max length, not counting NUL */ + /* Should be MAXLOGNAME - 1 */ +#define _PW_BUF_LEN 1024 /* length of getpw*_r buffer */ + +#define _PASSWORD_NOUID 0x01 /* flag for no specified uid. */ +#define _PASSWORD_NOGID 0x02 /* flag for no specified gid. */ +#define _PASSWORD_NOCHG 0x04 /* flag for no specified change. */ +#define _PASSWORD_NOEXP 0x08 /* flag for no specified expire. */ + +/* Flags for pw_mkdb(3) */ +#define _PASSWORD_SECUREONLY 0x01 /* only generate spwd.db file */ +#define _PASSWORD_OMITV7 0x02 /* don't generate v7 passwd file */ + +#endif + +struct passwd { + char *pw_name; /* user name */ + char *pw_passwd; /* encrypted password */ + uid_t pw_uid; /* user uid */ + gid_t pw_gid; /* user gid */ + time_t pw_change; /* password change time */ + char *pw_class; /* user access class */ + char *pw_gecos; /* Honeywell login info */ + char *pw_dir; /* home directory */ + char *pw_shell; /* default shell */ + time_t pw_expire; /* account expiration */ +}; + +__BEGIN_DECLS +struct passwd *getpwuid(uid_t); +struct passwd *getpwnam(const char *); +struct passwd *getpwuid_shadow(uid_t); +struct passwd *getpwnam_shadow(const char *); +int getpwnam_r(const char *, struct passwd *, char *, size_t, + struct passwd **); +int getpwuid_r(uid_t, struct passwd *, char *, size_t, + struct passwd **); +#if __BSD_VISIBLE || __XPG_VISIBLE +struct passwd *getpwent(void); +void setpwent(void); +void endpwent(void); +#endif +#if __BSD_VISIBLE +int setpassent(int); +int uid_from_user(const char *, uid_t *); +const char *user_from_uid(uid_t, int); +char *bcrypt_gensalt(u_int8_t); +char *bcrypt(const char *, const char *); +int bcrypt_newhash(const char *, int, char *, size_t); +int bcrypt_checkpass(const char *, const char *); +struct passwd *pw_dup(const struct passwd *); +#endif +__END_DECLS + +#endif /* !_PWD_H_ */ diff --git a/include/readpassphrase.h b/include/readpassphrase.h index cef36f0..4ef538c 100644 --- a/include/readpassphrase.h +++ b/include/readpassphrase.h @@ -1,7 +1,7 @@ -/* $OpenBSD: readpassphrase.h,v 1.5 2003/06/17 21:56:23 millert Exp $ */ +/* $OpenBSD: readpassphrase.h,v 1.6 2019/01/25 00:19:25 millert Exp $ */ /* - * Copyright (c) 2000, 2002 Todd C. Miller + * Copyright (c) 2000, 2002 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/include/resolv.h b/include/resolv.h index 23f19f9..fb02483 100644 --- a/include/resolv.h +++ b/include/resolv.h @@ -1,3 +1,313 @@ -#include_next -int b64_ntop(unsigned char const *, size_t, char *, size_t); -int b64_pton(char const *, unsigned char *, size_t); +/* $OpenBSD: resolv.h,v 1.22 2019/01/14 06:23:06 otto Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * ++Copyright++ 1983, 1987, 1989, 1993 + * - + * Copyright (c) 1983, 1987, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * - + * Portions Copyright (c) 1993 by Digital Equipment Corporation. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies, and that + * the name of Digital Equipment Corporation not be used in advertising or + * publicity pertaining to distribution of the document or software without + * specific, written prior permission. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT + * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + * - + * --Copyright-- + */ + +/* + * @(#)resolv.h 8.1 (Berkeley) 6/2/93 + * $From: resolv.h,v 8.17 1996/11/26 10:11:20 vixie Exp $ + */ + +#ifndef _RESOLV_H_ +#define _RESOLV_H_ + +#include +#include +#include + +/* + * Revision information. This is the release date in YYYYMMDD format. + * It can change every day so the right thing to do with it is use it + * in preprocessor commands such as "#if (__RES > 19931104)". Do not + * compare for equality; rather, use it to determine whether your resolver + * is new enough to contain a certain feature. + */ + +#define __RES 19960801 + +/* + * Resolver configuration file. + * Normally not present, but may contain the address of the + * initial name server(s) to query and the domain search list. + */ + +#ifndef _PATH_RESCONF +#define _PATH_RESCONF "/etc/resolv.conf" +#endif + +/* + * Global defines and variables for resolver stub. + */ +#define MAXNS 3 /* max # name servers we'll track */ +#define MAXDFLSRCH 3 /* # default domain levels to try */ +#define MAXDNSRCH 6 /* max # domains in search path */ +#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */ +#define MAXDNSLUS 4 /* max # of host lookup types */ + +#define RES_TIMEOUT 5 /* min. seconds between retries */ +#define MAXRESOLVSORT 10 /* number of net to sort on */ +#define RES_MAXNDOTS 15 /* should reflect bit field size */ + +struct __res_state { + int retrans; /* retransmission time interval */ + int retry; /* number of times to retransmit */ + unsigned int options; /* option flags - see below. */ + int nscount; /* number of name servers */ + int family[2]; /* specifies which address + * families will be queried and + * in which order */ + struct sockaddr_in + nsaddr_list[MAXNS]; /* address of name server */ +#define nsaddr nsaddr_list[0] /* for backward compatibility */ + unsigned short id; /* current message id */ + char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ + char defdname[256]; /* default domain (deprecated) */ + unsigned int pfcode; /* RES_PRF_ flags - see below. */ + unsigned ndots:4; /* threshold for initial abs. query */ + unsigned nsort:4; /* number of elements in sort_list[] */ + char unused[3]; + struct { + struct in_addr addr; + u_int32_t mask; + } sort_list[MAXRESOLVSORT]; + char lookups[MAXDNSLUS]; + struct { time_t __res_sec; long __res_nsec; } restimespec; + time_t reschktime; +}; + +#if 1 /* INET6 */ +/* + * replacement of __res_state, separated to keep binary compatibility. + */ +struct __res_state_ext { + struct sockaddr_storage nsaddr_list[MAXNS]; + struct { + int af; /* address family for addr, mask */ + union { + struct in_addr ina; + struct in6_addr in6a; + } addr, mask; + } sort_list[MAXRESOLVSORT]; +}; +#endif + + +/* + * Resolver options (keep these in synch with res_debug.c, please) + */ +#define RES_INIT 0x00000001 /* address initialized */ +#define RES_DEBUG 0x00000002 /* print debug messages */ +#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/ +#define RES_USEVC 0x00000008 /* use virtual circuit */ +#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */ +#define RES_IGNTC 0x00000020 /* ignore trucation errors */ +#define RES_RECURSE 0x00000040 /* recursion desired */ +#define RES_DEFNAMES 0x00000080 /* use default domain name */ +#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */ +#define RES_DNSRCH 0x00000200 /* search up local domain tree */ +#define RES_INSECURE1 0x00000400 /* type 1 security disabled */ +#define RES_INSECURE2 0x00000800 /* type 2 security disabled */ +#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */ +#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */ +/* KAME extensions: use higher bit to avoid conflict with ISC use */ +#define RES_USE_EDNS0 0x40000000 /* use EDNS0 */ +/* DNSSEC extensions: use higher bit to avoid conflict with ISC use */ +#define RES_USE_DNSSEC 0x20000000 /* use DNSSEC using OK bit in OPT */ +#define RES_USE_CD 0x10000000 /* set Checking Disabled flag */ + +#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH) + +/* + * Resolver "pfcode" values. Used by dig. + */ +#define RES_PRF_STATS 0x00000001 +/* 0x00000002 */ +#define RES_PRF_CLASS 0x00000004 +#define RES_PRF_CMD 0x00000008 +#define RES_PRF_QUES 0x00000010 +#define RES_PRF_ANS 0x00000020 +#define RES_PRF_AUTH 0x00000040 +#define RES_PRF_ADD 0x00000080 +#define RES_PRF_HEAD1 0x00000100 +#define RES_PRF_HEAD2 0x00000200 +#define RES_PRF_TTLID 0x00000400 +#define RES_PRF_HEADX 0x00000800 +#define RES_PRF_QUERY 0x00001000 +#define RES_PRF_REPLY 0x00002000 +#define RES_PRF_INIT 0x00004000 +/* 0x00008000 */ + +/* hooks are still experimental as of 4.9.2 */ +typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error } + res_sendhookact; + +typedef res_sendhookact (*res_send_qhook)(struct sockaddr_in * const *ns, + const unsigned char **query, + int *querylen, + unsigned char *ans, + int anssiz, + int *resplen); + +typedef res_sendhookact (*res_send_rhook)(const struct sockaddr_in *ns, + const unsigned char *query, + int querylen, + unsigned char *ans, + int anssiz, + int *resplen); + +struct res_sym { + int number; /* Identifying number, like T_MX */ + char * name; /* Its symbolic name, like "MX" */ + char * humanname; /* Its fun name, like "mail exchanger" */ +}; + +extern struct __res_state _res; +#if 1 /* INET6 */ +extern struct __res_state_ext _res_ext; +#endif +extern const struct res_sym __p_class_syms[]; +extern const struct res_sym __p_type_syms[]; + +/* Private routines shared between libc/net, named, nslookup and others. */ +#define res_hnok __res_hnok +#define res_ownok __res_ownok +#define res_mailok __res_mailok +#define res_dnok __res_dnok +#define sym_ntos __sym_ntos +#define b64_ntop __b64_ntop +#define b64_pton __b64_pton +#define dn_skipname __dn_skipname +#define putlong __putlong +#define putshort __putshort +#define p_class __p_class +#define p_type __p_type +#define dn_count_labels __dn_count_labels +#define dn_comp __dn_comp +#define res_randomid __res_randomid +#define res_send __res_send +#define res_opt __res_opt + +#ifdef BIND_RES_POSIX3 +#define dn_expand __dn_expand +#define res_init __res_init +#define res_query __res_query +#define res_search __res_search +#define res_querydomain __res_querydomain +#define res_mkquery __res_mkquery +#endif + +__BEGIN_DECLS +int res_hnok(const char *); +int res_ownok(const char *); +int res_mailok(const char *); +int res_dnok(const char *); +const char * sym_ntos(const struct res_sym *, int, int *); +int b64_ntop(unsigned char const *, size_t, char *, size_t); +int b64_pton(char const *, unsigned char *, size_t); +int dn_skipname(const unsigned char *, + const unsigned char *); +void putlong(u_int32_t, unsigned char *); +void putshort(u_int16_t, unsigned char *); +const char * p_class(int); +const char * p_type(int); +int dn_comp(const char *, unsigned char *, int, + unsigned char **, unsigned char **); +int dn_expand(const unsigned char *, const unsigned char *, + const unsigned char *, char *, int); +int res_init(void); +unsigned int res_randomid(void); +int res_query(const char *, int, int, unsigned char *, int) + __attribute__((__bounded__(__string__,4,5))); +int res_search(const char *, int, int, unsigned char *, int) + __attribute__((__bounded__(__string__,4,5))); +int res_querydomain(const char *, const char *, int, int, + unsigned char *, int) + __attribute__((__bounded__(__string__,5,6))); +int res_mkquery(int, const char *, int, int, + const unsigned char *, int, const unsigned char *, + unsigned char *, int) + __attribute__((__bounded__(__string__,5,6))) + __attribute__((__bounded__(__string__,8,9))); +int res_send(const unsigned char *, int, unsigned char *, + int) + __attribute__((__bounded__(__string__,3,4))); +__END_DECLS + +#endif /* !_RESOLV_H_ */ diff --git a/include/sndio.h b/include/sndio.h index 4fed3d5..03550a0 100644 --- a/include/sndio.h +++ b/include/sndio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sndio.h,v 1.10 2020/02/26 13:53:58 ratchov Exp $ */ +/* $OpenBSD: sndio.h,v 1.13 2020/06/28 05:21:38 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -104,16 +104,17 @@ struct sioctl_node { struct sioctl_desc { unsigned int addr; /* control address */ #define SIOCTL_NONE 0 /* deleted */ -#define SIOCTL_NUM 2 /* integer in the 0..127 range */ +#define SIOCTL_NUM 2 /* integer in the 0..maxval range */ #define SIOCTL_SW 3 /* on/off switch (0 or 1) */ #define SIOCTL_VEC 4 /* number, element of vector */ #define SIOCTL_LIST 5 /* switch, element of a list */ +#define SIOCTL_SEL 6 /* element of a selector */ unsigned int type; /* one of above */ char func[SIOCTL_NAMEMAX]; /* function name, ex. "level" */ char group[SIOCTL_NAMEMAX]; /* group this control belongs to */ struct sioctl_node node0; /* affected node */ - struct sioctl_node node1; /* dito for SIOCTL_{VEC,LIST} */ - unsigned int maxval; /* max value for SIOCTL_{NUM,VEC} */ + struct sioctl_node node1; /* dito for SIOCTL_{VEC,LIST,SEL} */ + unsigned int maxval; /* max value */ int __pad[3]; }; diff --git a/include/stdio.h b/include/stdio.h index 3f39a21..ffb49fb 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdio.h,v 1.53 2016/09/09 18:12:37 millert Exp $ */ +/* $OpenBSD: stdio.h,v 1.54 2020/09/11 17:56:41 naddy Exp $ */ /* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ /*- @@ -204,7 +204,9 @@ __END_DECLS __BEGIN_DECLS void clearerr(FILE *); #if __POSIX_VISIBLE >= 200809 -int dprintf(int, const char * __restrict, ...); +int dprintf(int, const char * __restrict, ...) + __attribute__((__format__ (printf, 2, 3))) + __attribute__((__nonnull__ (2))); #endif int fclose(FILE *); int feof(FILE *); @@ -266,7 +268,9 @@ int vfprintf(FILE *, const char *, __va_list); int vprintf(const char *, __va_list); int vsprintf(char *, const char *, __va_list); #if __POSIX_VISIBLE >= 200809 -int vdprintf(int, const char * __restrict, __va_list); +int vdprintf(int, const char * __restrict, __va_list) + __attribute__((__format__ (printf, 2, 0))) + __attribute__((__nonnull__ (2))); #endif #if __ISO_C_VISIBLE >= 1999 || __XPG_VISIBLE >= 500 || __BSD_VISIBLE diff --git a/include/stdlib.h b/include/stdlib.h index 652bba4..ab8a2ae 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,12 +1,323 @@ -#include_next -#include -void freezero(void *, size_t); -void *reallocarray(void *, size_t, size_t); -void *recallocarray(void *, size_t, size_t, size_t); -long long strtonum(const char *, long long, long long, const char **); +/* $OpenBSD: stdlib.h,v 1.76 2019/05/10 15:03:24 otto Exp $ */ +/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdlib.h 5.13 (Berkeley) 6/4/91 + */ + +#ifndef _STDLIB_H_ +#define _STDLIB_H_ + +#include +#include +#include +#if __BSD_VISIBLE /* for quad_t, etc. (XXX - use protected types) */ +#include +#endif + +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; +#endif + +/* in C++, wchar_t is a built-in type */ +#if !defined(_WCHAR_T_DEFINED_) && !defined(__cplusplus) +#define _WCHAR_T_DEFINED_ +typedef __wchar_t wchar_t; +#endif + +typedef struct { + int quot; /* quotient */ + int rem; /* remainder */ +} div_t; + +typedef struct { + long quot; /* quotient */ + long rem; /* remainder */ +} ldiv_t; + +#if __ISO_C_VISIBLE >= 1999 +typedef struct { + long long quot; /* quotient */ + long long rem; /* remainder */ +} lldiv_t; +#endif + +#if __BSD_VISIBLE +typedef struct { + quad_t quot; /* quotient */ + quad_t rem; /* remainder */ +} qdiv_t; +#endif + +#define EXIT_FAILURE 1 +#define EXIT_SUCCESS 0 + +#define RAND_MAX 0x7fffffff + +#define MB_CUR_MAX __mb_cur_max() + +/* + * Some header files may define an abs macro. + * If defined, undef it to prevent a syntax error and issue a warning. + */ +#ifdef abs +#undef abs +#warning abs macro collides with abs() prototype, undefining +#endif + +__BEGIN_DECLS +__dead void abort(void); +int abs(int); +int atexit(void (*)(void)); +double atof(const char *); +int atoi(const char *); +long atol(const char *); +void *bsearch(const void *, const void *, size_t, size_t, + int (*)(const void *, const void *)); +void *calloc(size_t, size_t); +div_t div(int, int); +__dead void exit(int); +__dead void _Exit(int); +void free(void *); +char *getenv(const char *); +long labs(long); +ldiv_t ldiv(long, long); +void *malloc(size_t); +#if __BSD_VISIBLE +void freezero(void *, size_t) + __attribute__ ((__bounded__(__buffer__,1,2))); +void *calloc_conceal(size_t, size_t); +void *malloc_conceal(size_t); +void *reallocarray(void *, size_t, size_t); +void *recallocarray(void *, size_t, size_t, size_t); +#endif /* __BSD_VISIBLE */ +void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); +int rand(void); +void *realloc(void *, size_t); +void srand(unsigned); +void srand_deterministic(unsigned); +double strtod(const char *__restrict, char **__restrict); +float strtof(const char *__restrict, char **__restrict); +long strtol(const char *__restrict, char **__restrict, int); +long double + strtold(const char *__restrict, char **__restrict); +unsigned long + strtoul(const char *__restrict, char **__restrict, int); +int system(const char *); + +size_t __mb_cur_max(void); +int mblen(const char *, size_t); +size_t mbstowcs(wchar_t *, const char *, size_t); +int wctomb(char *, wchar_t); +int mbtowc(wchar_t *, const char *, size_t); +size_t wcstombs(char *, const wchar_t *, size_t); + +/* + * IEEE Std 1003.1c-95, also adopted by X/Open CAE Spec Issue 5 Version 2 + */ +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 199506 || defined(_REENTRANT) +int rand_r(unsigned int *); +#endif + +#if __BSD_VISIBLE || __XPG_VISIBLE >= 400 +double drand48(void); +double erand48(unsigned short[3]); +long jrand48(unsigned short[3]); +void lcong48(unsigned short[7]); +void lcong48_deterministic(unsigned short[7]); +long lrand48(void); +long mrand48(void); +long nrand48(unsigned short[3]); +unsigned short *seed48(unsigned short[3]); +unsigned short *seed48_deterministic(unsigned short[3]); +void srand48(long); +void srand48_deterministic(long); + +int putenv(char *); +#endif + +/* + * XSI functions marked LEGACY in IEEE Std 1003.1-2001 (POSIX) and + * removed in IEEE Std 1003.1-2008 + */ +#if __BSD_VISIBLE || __XPG_VISIBLE < 700 +char *ecvt(double, int, int *, int *); +char *fcvt(double, int, int *, int *); +char *gcvt(double, int, char *); +#if __BSD_VISIBLE || __XPG_VISIBLE >= 420 +char *mktemp(char *); +#endif +#endif /* __BSD_VISIBLE || __XPG_VISIBLE < 700 */ + +#if __BSD_VISIBLE || __XPG_VISIBLE >= 420 +long a64l(const char *); +char *l64a(long); + +char *initstate(unsigned int, char *, size_t) + __attribute__((__bounded__ (__string__,2,3))); +long random(void); +char *setstate(char *); +void srandom(unsigned int); +void srandom_deterministic(unsigned int); + +char *realpath(const char *, char *) + __attribute__((__bounded__ (__minbytes__,2,1024))); + +/* + * XSI functions marked LEGACY in XPG5 and removed in IEEE Std 1003.1-2001 + */ +#if __BSD_VISIBLE || __XPG_VISIBLE < 600 +int ttyslot(void); +void *valloc(size_t); /* obsoleted by malloc() */ +#endif +#endif /* __BSD_VISIBLE || __XPG_VISIBLE >= 420 */ + +/* + * 4.4BSD, then XSI in XPG4.2, then added to POSIX base in IEEE Std 1003.1-2008 + */ +#if __BSD_VISIBLE || __XPG_VISIBLE >= 420 || __POSIX_VISIBLE >= 200809 +int mkstemp(char *); +#endif + +/* + * ISO C99 + */ +#if __ISO_C_VISIBLE >= 1999 +long long + atoll(const char *); +long long + llabs(long long); +lldiv_t + lldiv(long long, long long); +long long + strtoll(const char *__restrict, char **__restrict, int); +unsigned long long + strtoull(const char *__restrict, char **__restrict, int); +#endif + +#if __ISO_C_VISIBLE >= 2011 +void * + aligned_alloc(size_t, size_t); +#endif + +/* + * The Open Group Base Specifications, Issue 6; IEEE Std 1003.1-2001 (POSIX) + */ +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 +int posix_memalign(void **, size_t, size_t); +int setenv(const char *, const char *, int); +int unsetenv(const char *); +#endif +#if __XPG_VISIBLE >= 420 || __POSIX_VISIBLE >= 200112 +char *ptsname(int); +int grantpt(int); +int unlockpt(int); +#endif +#if __POSIX_VISIBLE >= 200112 +int posix_openpt(int); +#endif + +/* + * The Open Group Base Specifications, Issue 7; IEEE Std 1003.1-2008 (POSIX) + */ +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +char *mkdtemp(char *); +#endif + +#if __XPG_VISIBLE >= 420 || __POSIX_VISIBLE >= 200809 +int getsubopt(char **, char * const *, char **); +#endif + +/* + * The Open Group Base Specifications, post-Issue 7 + */ +#if __BSD_VISIBLE +int mkostemp(char *, int); +#endif + +#if __BSD_VISIBLE +#define alloca(n) __builtin_alloca(n) + +char *getbsize(int *, long *); +char *cgetcap(char *, const char *, int); +int cgetclose(void); +int cgetent(char **, char **, const char *); +int cgetfirst(char **, char **); +int cgetmatch(char *, const char *); +int cgetnext(char **, char **); +int cgetnum(char *, const char *, long *); +int cgetset(const char *); +int cgetusedb(int); +int cgetstr(char *, const char *, char **); +int cgetustr(char *, const char *, char **); + +int daemon(int, int); +char *devname(dev_t, mode_t); +int getloadavg(double [], int); + +const char * + getprogname(void); +void setprogname(const char *); + +extern char *suboptarg; /* getsubopt(3) external variable */ + +int mkstemps(char *, int); +int mkostemps(char *, int, int); + +int heapsort(void *, size_t, size_t, int (*)(const void *, const void *)); +int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); +int radixsort(const unsigned char **, int, const unsigned char *, + unsigned); +int sradixsort(const unsigned char **, int, const unsigned char *, + unsigned); + +void srandomdev(void); +long long + strtonum(const char *, long long, long long, const char **); + +void setproctitle(const char *, ...) + __attribute__((__format__ (__printf__, 1, 2))); + +quad_t qabs(quad_t); +qdiv_t qdiv(quad_t, quad_t); +quad_t strtoq(const char *__restrict, char **__restrict, int); +u_quad_t strtouq(const char *__restrict, char **__restrict, int); + uint32_t arc4random(void); uint32_t arc4random_uniform(uint32_t); -void arc4random_buf(void *, size_t); -void setprogname(const char *); -const char *getprogname(void); -extern char *__progname; +void arc4random_buf(void *, size_t) + __attribute__((__bounded__ (__buffer__,1,2))); + +#endif /* __BSD_VISIBLE */ + +__END_DECLS + +#endif /* _STDLIB_H_ */ diff --git a/include/string.h b/include/string.h index 9cf9ac9..9141c30 100644 --- a/include/string.h +++ b/include/string.h @@ -1,5 +1,138 @@ -#include_next -char *strcasestr(const char *, const char *); -void strmode(int, char *); -int timingsafe_memcmp(const void *, const void *, size_t); -int timingsafe_bcmp(const void *, const void *, size_t); +/* $OpenBSD: string.h,v 1.32 2017/09/05 03:16:13 schwarze Exp $ */ +/* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)string.h 5.10 (Berkeley) 3/9/91 + */ + +#ifndef _STRING_H_ +#define _STRING_H_ + +#include +#include +#include + +/* + * POSIX mandates that certain string functions not present in ISO C + * be prototyped in strings.h. Historically, we've included them here. + */ +#if __BSD_VISIBLE +#include +#endif + +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef __size_t size_t; +#endif + +#if __POSIX_VISIBLE >= 200809 +#ifndef _LOCALE_T_DEFINED_ +#define _LOCALE_T_DEFINED_ +typedef void *locale_t; +#endif +#endif + +__BEGIN_DECLS +void *memchr(const void *, int, size_t); +int memcmp(const void *, const void *, size_t); +void *memcpy(void *__restrict, const void *__restrict, size_t) + __attribute__ ((__bounded__(__buffer__,1,3))) + __attribute__ ((__bounded__(__buffer__,2,3))); +void *memmove(void *, const void *, size_t) + __attribute__ ((__bounded__(__buffer__,1,3))) + __attribute__ ((__bounded__(__buffer__,2,3))); +void *memset(void *, int, size_t) + __attribute__ ((__bounded__(__buffer__,1,3))); +char *strcat(char *__restrict, const char *__restrict); +char *strchr(const char *, int); +int strcmp(const char *, const char *); +int strcoll(const char *, const char *); +char *strcpy(char *__restrict, const char *__restrict); +size_t strcspn(const char *, const char *); +char *strerror(int); +size_t strlen(const char *); +char *strncat(char *__restrict, const char *__restrict, size_t) + __attribute__ ((__bounded__(__string__,1,3))); +int strncmp(const char *, const char *, size_t); +char *strncpy(char *__restrict, const char *__restrict, size_t) + __attribute__ ((__bounded__(__string__,1,3))); +char *strpbrk(const char *, const char *); +char *strrchr(const char *, int); +size_t strspn(const char *, const char *); +char *strstr(const char *, const char *); +char *strtok(char *__restrict, const char *__restrict); +char *strtok_r(char *__restrict, const char *__restrict, char **__restrict); +size_t strxfrm(char *__restrict, const char *__restrict, size_t) + __attribute__ ((__bounded__(__string__,1,3))); + +#if __XPG_VISIBLE +void *memccpy(void *__restrict, const void *__restrict, int, size_t) + __attribute__ ((__bounded__(__buffer__,1,4))); +#endif + +#if __POSIX_VISIBLE >= 200112 +int strerror_r(int, char *, size_t) + __attribute__ ((__bounded__(__string__,2,3))); +#endif + +#if __XPG_VISIBLE >= 420 || __POSIX_VISIBLE >= 200809 +char *strdup(const char *); +#endif + +#if __POSIX_VISIBLE >= 200809 +char *stpcpy(char *__restrict, const char *__restrict); +char *stpncpy(char *__restrict, const char *__restrict, size_t); +int strcoll_l(const char *, const char *, locale_t); +char *strerror_l(int, locale_t); +char *strndup(const char *, size_t); +size_t strnlen(const char *, size_t); +char *strsignal(int); +size_t strxfrm_l(char *__restrict, const char *__restrict, size_t, locale_t) + __attribute__ ((__bounded__(__string__,1,3))); +#endif + +#if __BSD_VISIBLE +void explicit_bzero(void *, size_t) + __attribute__ ((__bounded__(__buffer__,1,2))); +void *memmem(const void *, size_t, const void *, size_t); +void *memrchr(const void *, int, size_t); +char *strcasestr(const char *, const char *); +size_t strlcat(char *, const char *, size_t) + __attribute__ ((__bounded__(__string__,1,3))); +size_t strlcpy(char *, const char *, size_t) + __attribute__ ((__bounded__(__string__,1,3))); +void strmode(int, char *); +char *strsep(char **, const char *); +int timingsafe_bcmp(const void *, const void *, size_t); +int timingsafe_memcmp(const void *, const void *, size_t); +#endif +__END_DECLS + +#endif /* _STRING_H_ */ diff --git a/include/tib.h b/include/tib.h index 8d9216f..d901b54 100644 --- a/include/tib.h +++ b/include/tib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tib.h,v 1.7 2019/05/10 13:29:21 guenther Exp $ */ +/* $OpenBSD: tib.h,v 1.8 2020/07/14 16:48:13 kettenis Exp $ */ /* * Copyright (c) 2011,2014 Philip Guenther * @@ -143,8 +143,13 @@ struct tib { int tib_canceled; int tib_errno; void *tib_locale; +#ifdef __powerpc64__ + void *tib_thread; + void *tib_dtv; /* internal to the runtime linker */ +#else void *tib_dtv; /* internal to the runtime linker */ void *tib_thread; +#endif }; diff --git a/include/unistd.h b/include/unistd.h index a715077..c9432ea 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,3 +1,532 @@ -#include_next -#define pledge(request, paths) 0 /* linux doesn't have pledge */ -#define unveil(path, permissions) 0 /* linux doesn't have unveil */ +/* $OpenBSD: unistd.h,v 1.106 2018/07/13 09:25:22 beck Exp $ */ +/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */ + +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)unistd.h 5.13 (Berkeley) 6/17/91 + */ + +#ifndef _UNISTD_H_ +#define _UNISTD_H_ + +#include +#include +#include + +#define STDIN_FILENO 0 /* standard input file descriptor */ +#define STDOUT_FILENO 1 /* standard output file descriptor */ +#define STDERR_FILENO 2 /* standard error file descriptor */ + +#if __XPG_VISIBLE || __POSIX_VISIBLE >= 200112 +#define F_ULOCK 0 /* unlock locked section */ +#define F_LOCK 1 /* lock a section for exclusive use */ +#define F_TLOCK 2 /* test and lock a section for exclusive use */ +#define F_TEST 3 /* test a section for locks by other procs */ +#endif + +/* + * POSIX options and option groups we unconditionally do or don't + * implement. Please keep this list in alphabetical order. + * + * Anything which is defined as zero below **must** have an + * implementation for the corresponding sysconf() which is able to + * determine conclusively whether or not the feature is supported. + * Anything which is defined as other than -1 below **must** have + * complete headers, types, and function declarations as specified by + * the POSIX standard; however, if the relevant sysconf() function + * returns -1, the functions may be stubbed out. + */ +#define _POSIX_ADVISORY_INFO (-1) +#define _POSIX_ASYNCHRONOUS_IO (-1) +#define _POSIX_BARRIERS 200112L +#define _POSIX_CHOWN_RESTRICTED 1 +#define _POSIX_CLOCK_SELECTION (-1) +#define _POSIX_CPUTIME 200809L +#define _POSIX_FSYNC 200112L +#define _POSIX_IPV6 0 +#define _POSIX_JOB_CONTROL 1 +#define _POSIX_MAPPED_FILES 200112L +#define _POSIX_MEMLOCK 200112L +#define _POSIX_MEMLOCK_RANGE 200112L +#define _POSIX_MEMORY_PROTECTION 200112L +#define _POSIX_MESSAGE_PASSING (-1) +#define _POSIX_MONOTONIC_CLOCK 200112L +#define _POSIX_NO_TRUNC 1 +#define _POSIX_PRIORITIZED_IO (-1) +#define _POSIX_PRIORITY_SCHEDULING (-1) +#define _POSIX_RAW_SOCKETS 200112L +#define _POSIX_READER_WRITER_LOCKS 200112L +#define _POSIX_REALTIME_SIGNALS (-1) +#define _POSIX_REGEXP 1 +#define _POSIX_SAVED_IDS 1 +#define _POSIX_SEMAPHORES 200112L +#define _POSIX_SHARED_MEMORY_OBJECTS 200809L +#define _POSIX_SHELL 1 +#define _POSIX_SPAWN 200112L +#define _POSIX_SPIN_LOCKS 200112L +#define _POSIX_SPORADIC_SERVER (-1) +#define _POSIX_SYNCHRONIZED_IO (-1) +#define _POSIX_THREAD_ATTR_STACKADDR 200112L +#define _POSIX_THREAD_ATTR_STACKSIZE 200112L +#define _POSIX_THREAD_CPUTIME 200809L +#define _POSIX_THREAD_PRIO_INHERIT (-1) +#define _POSIX_THREAD_PRIO_PROTECT (-1) +#define _POSIX_THREAD_PRIORITY_SCHEDULING (-1) +#define _POSIX_THREAD_PROCESS_SHARED (-1) +#define _POSIX_THREAD_ROBUST_PRIO_INHERIT (-1) +#define _POSIX_THREAD_ROBUST_PRIO_PROTECT (-1) +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L +#define _POSIX_THREAD_SPORADIC_SERVER (-1) +#define _POSIX_THREADS 200112L +#define _POSIX_TIMEOUTS 200112L +#define _POSIX_TIMERS (-1) +#define _POSIX_TRACE (-1) +#define _POSIX_TRACE_EVENT_FILTER (-1) +#define _POSIX_TRACE_INHERIT (-1) +#define _POSIX_TRACE_LOG (-1) +#define _POSIX_TYPED_MEMORY_OBJECTS (-1) +#define _POSIX2_C_BIND 200112L +#define _POSIX2_C_DEV (-1) /* need C99 utility */ +#define _POSIX2_CHAR_TERM 1 +#define _POSIX2_FORT_DEV (-1) /* need fort77 utility */ +#define _POSIX2_FORT_RUN (-1) /* need asa utility */ +#define _POSIX2_LOCALEDEF (-1) +#define _POSIX2_PBS (-1) +#define _POSIX2_PBS_ACCOUNTING (-1) +#define _POSIX2_PBS_CHECKPOINT (-1) +#define _POSIX2_PBS_LOCATE (-1) +#define _POSIX2_PBS_MESSAGE (-1) +#define _POSIX2_PBS_TRACK (-1) +#define _POSIX2_SW_DEV 200112L +#define _POSIX2_UPE 200112L +#define _POSIX_V6_ILP32_OFF32 (-1) +#define _POSIX_V6_ILP32_OFFBIG 0 +#define _POSIX_V6_LP64_OFF64 0 +#define _POSIX_V6_LPBIG_OFFBIG 0 +#define _POSIX_V7_ILP32_OFF32 (-1) +#define _POSIX_V7_ILP32_OFFBIG 0 +#define _POSIX_V7_LP64_OFF64 0 +#define _POSIX_V7_LPBIG_OFFBIG 0 + +#define _XOPEN_CRYPT 1 +#define _XOPEN_ENH_I18N (-1) /* mandatory in XSI */ +#define _XOPEN_LEGACY (-1) +#define _XOPEN_REALTIME (-1) +#define _XOPEN_REALTIME_THREADS (-1) +#define _XOPEN_SHM 1 +#define _XOPEN_STREAMS (-1) +#define _XOPEN_UUCP (-1) +#define _XOPEN_UNIX (-1) + +/* Define the POSIX.2 version we target for compliance. */ +#define _POSIX2_VERSION 200809L + +/* the sysconf(3) variable values are part of the ABI */ + +/* configurable system variables */ +#define _SC_ARG_MAX 1 +#define _SC_CHILD_MAX 2 +#define _SC_CLK_TCK 3 +#define _SC_NGROUPS_MAX 4 +#define _SC_OPEN_MAX 5 +#define _SC_JOB_CONTROL 6 +#define _SC_SAVED_IDS 7 +#define _SC_VERSION 8 +#define _SC_BC_BASE_MAX 9 +#define _SC_BC_DIM_MAX 10 +#define _SC_BC_SCALE_MAX 11 +#define _SC_BC_STRING_MAX 12 +#define _SC_COLL_WEIGHTS_MAX 13 +#define _SC_EXPR_NEST_MAX 14 +#define _SC_LINE_MAX 15 +#define _SC_RE_DUP_MAX 16 +#define _SC_2_VERSION 17 +#define _SC_2_C_BIND 18 +#define _SC_2_C_DEV 19 +#define _SC_2_CHAR_TERM 20 +#define _SC_2_FORT_DEV 21 +#define _SC_2_FORT_RUN 22 +#define _SC_2_LOCALEDEF 23 +#define _SC_2_SW_DEV 24 +#define _SC_2_UPE 25 +#define _SC_STREAM_MAX 26 +#define _SC_TZNAME_MAX 27 +#define _SC_PAGESIZE 28 +#define _SC_PAGE_SIZE _SC_PAGESIZE /* 1170 compatibility */ +#define _SC_FSYNC 29 +#define _SC_XOPEN_SHM 30 +#define _SC_SEM_NSEMS_MAX 31 +#define _SC_SEM_VALUE_MAX 32 +#define _SC_HOST_NAME_MAX 33 +#define _SC_MONOTONIC_CLOCK 34 +#define _SC_2_PBS 35 +#define _SC_2_PBS_ACCOUNTING 36 +#define _SC_2_PBS_CHECKPOINT 37 +#define _SC_2_PBS_LOCATE 38 +#define _SC_2_PBS_MESSAGE 39 +#define _SC_2_PBS_TRACK 40 +#define _SC_ADVISORY_INFO 41 +#define _SC_AIO_LISTIO_MAX 42 +#define _SC_AIO_MAX 43 +#define _SC_AIO_PRIO_DELTA_MAX 44 +#define _SC_ASYNCHRONOUS_IO 45 +#define _SC_ATEXIT_MAX 46 +#define _SC_BARRIERS 47 +#define _SC_CLOCK_SELECTION 48 +#define _SC_CPUTIME 49 +#define _SC_DELAYTIMER_MAX 50 +#define _SC_IOV_MAX 51 +#define _SC_IPV6 52 +#define _SC_MAPPED_FILES 53 +#define _SC_MEMLOCK 54 +#define _SC_MEMLOCK_RANGE 55 +#define _SC_MEMORY_PROTECTION 56 +#define _SC_MESSAGE_PASSING 57 +#define _SC_MQ_OPEN_MAX 58 +#define _SC_MQ_PRIO_MAX 59 +#define _SC_PRIORITIZED_IO 60 +#define _SC_PRIORITY_SCHEDULING 61 +#define _SC_RAW_SOCKETS 62 +#define _SC_READER_WRITER_LOCKS 63 +#define _SC_REALTIME_SIGNALS 64 +#define _SC_REGEXP 65 +#define _SC_RTSIG_MAX 66 +#define _SC_SEMAPHORES 67 +#define _SC_SHARED_MEMORY_OBJECTS 68 +#define _SC_SHELL 69 +#define _SC_SIGQUEUE_MAX 70 +#define _SC_SPAWN 71 +#define _SC_SPIN_LOCKS 72 +#define _SC_SPORADIC_SERVER 73 +#define _SC_SS_REPL_MAX 74 +#define _SC_SYNCHRONIZED_IO 75 +#define _SC_SYMLOOP_MAX 76 +#define _SC_THREAD_ATTR_STACKADDR 77 +#define _SC_THREAD_ATTR_STACKSIZE 78 +#define _SC_THREAD_CPUTIME 79 +#define _SC_THREAD_DESTRUCTOR_ITERATIONS 80 +#define _SC_THREAD_KEYS_MAX 81 +#define _SC_THREAD_PRIO_INHERIT 82 +#define _SC_THREAD_PRIO_PROTECT 83 +#define _SC_THREAD_PRIORITY_SCHEDULING 84 +#define _SC_THREAD_PROCESS_SHARED 85 +#define _SC_THREAD_ROBUST_PRIO_INHERIT 86 +#define _SC_THREAD_ROBUST_PRIO_PROTECT 87 +#define _SC_THREAD_SPORADIC_SERVER 88 +#define _SC_THREAD_STACK_MIN 89 +#define _SC_THREAD_THREADS_MAX 90 +#define _SC_THREADS 91 +#define _SC_TIMEOUTS 92 +#define _SC_TIMER_MAX 93 +#define _SC_TIMERS 94 +#define _SC_TRACE 95 +#define _SC_TRACE_EVENT_FILTER 96 +#define _SC_TRACE_EVENT_NAME_MAX 97 +#define _SC_TRACE_INHERIT 98 +#define _SC_TRACE_LOG 99 +#define _SC_GETGR_R_SIZE_MAX 100 +#define _SC_GETPW_R_SIZE_MAX 101 +#define _SC_LOGIN_NAME_MAX 102 +#define _SC_THREAD_SAFE_FUNCTIONS 103 +#define _SC_TRACE_NAME_MAX 104 +#define _SC_TRACE_SYS_MAX 105 +#define _SC_TRACE_USER_EVENT_MAX 106 +#define _SC_TTY_NAME_MAX 107 +#define _SC_TYPED_MEMORY_OBJECTS 108 +#define _SC_V6_ILP32_OFF32 109 +#define _SC_V6_ILP32_OFFBIG 110 +#define _SC_V6_LP64_OFF64 111 +#define _SC_V6_LPBIG_OFFBIG 112 +#define _SC_V7_ILP32_OFF32 113 +#define _SC_V7_ILP32_OFFBIG 114 +#define _SC_V7_LP64_OFF64 115 +#define _SC_V7_LPBIG_OFFBIG 116 +#define _SC_XOPEN_CRYPT 117 +#define _SC_XOPEN_ENH_I18N 118 +#define _SC_XOPEN_LEGACY 119 +#define _SC_XOPEN_REALTIME 120 +#define _SC_XOPEN_REALTIME_THREADS 121 +#define _SC_XOPEN_STREAMS 122 +#define _SC_XOPEN_UNIX 123 +#define _SC_XOPEN_UUCP 124 +#define _SC_XOPEN_VERSION 125 + +#define _SC_PHYS_PAGES 500 +#define _SC_AVPHYS_PAGES 501 +#define _SC_NPROCESSORS_CONF 502 +#define _SC_NPROCESSORS_ONLN 503 + +/* configurable system strings */ +#define _CS_PATH 1 +#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2 +#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3 +#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4 +#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5 +#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6 +#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7 +#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8 +#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9 +#define _CS_POSIX_V6_LP64_OFF64_LIBS 10 +#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13 +#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14 +#define _CS_V6_ENV 15 +#define _CS_POSIX_V7_ILP32_OFF32_CFLAGS 16 +#define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS 17 +#define _CS_POSIX_V7_ILP32_OFF32_LIBS 18 +#define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS 19 +#define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS 20 +#define _CS_POSIX_V7_ILP32_OFFBIG_LIBS 21 +#define _CS_POSIX_V7_LP64_OFF64_CFLAGS 22 +#define _CS_POSIX_V7_LP64_OFF64_LDFLAGS 23 +#define _CS_POSIX_V7_LP64_OFF64_LIBS 24 +#define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS 25 +#define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS 26 +#define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS 27 +#define _CS_POSIX_V7_THREADS_CFLAGS 28 +#define _CS_POSIX_V7_THREADS_LDFLAGS 29 +#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS 30 +#define _CS_V7_ENV 31 + +#ifndef _INTPTR_T_DEFINED_ +#define _INTPTR_T_DEFINED_ +typedef __intptr_t intptr_t; +#endif + +__BEGIN_DECLS +__dead void _exit(int); +int access(const char *, int); +unsigned int alarm(unsigned int); +int chdir(const char *); +int chown(const char *, uid_t, gid_t); +int close(int); +int dup(int); +int dup2(int, int); +int execl(const char *, const char *, ...) + __attribute__((__sentinel__)); +int execle(const char *, const char *, ...); +int execlp(const char *, const char *, ...) + __attribute__((__sentinel__)); +int execv(const char *, char *const *); +int execve(const char *, char *const *, char *const *); +int execvp(const char *, char *const *); +#if __BSD_VISIBLE +int execvpe(const char *, char *const *, char *const *); +#endif +pid_t fork(void); +long fpathconf(int, int); +char *getcwd(char *, size_t) + __attribute__((__bounded__(__string__,1,2))); +gid_t getegid(void); +uid_t geteuid(void); +gid_t getgid(void); +int getgroups(int, gid_t *); +char *getlogin(void); +pid_t getpgrp(void); +pid_t getpid(void); +pid_t getppid(void); +uid_t getuid(void); +int isatty(int); +int link(const char *, const char *); +off_t lseek(int, off_t, int); +long pathconf(const char *, int); +int pause(void); +int pipe(int *); +ssize_t read(int, void *, size_t) + __attribute__((__bounded__(__buffer__,2,3))); +int rmdir(const char *); +int setgid(gid_t); +int setuid(uid_t); +unsigned int sleep(unsigned int); +long sysconf(int); +pid_t tcgetpgrp(int); +int tcsetpgrp(int, pid_t); +char *ttyname(int); +int unlink(const char *); +ssize_t write(int, const void *, size_t) + __attribute__((__bounded__(__buffer__,2,3))); + +#if __POSIX_VISIBLE || __XPG_VISIBLE >= 300 +pid_t setsid(void); +int setpgid(pid_t, pid_t); +#endif + +#if __POSIX_VISIBLE >= 199209 || __XPG_VISIBLE +size_t confstr(int, char *, size_t) + __attribute__((__bounded__(__string__,2,3))); +#ifndef _GETOPT_DEFINED_ +#define _GETOPT_DEFINED_ +int getopt(int, char * const *, const char *); +extern char *optarg; /* getopt(3) external variables */ +extern int opterr, optind, optopt, optreset; +#endif /* _GETOPT_DEFINED_ */ +#endif + +#if __POSIX_VISIBLE >= 199506 || __XPG_VISIBLE +int fsync(int); +int ftruncate(int, off_t); +int getlogin_r(char *, size_t) + __attribute__((__bounded__(__string__,1,2))); +ssize_t readlink(const char * __restrict, char * __restrict, size_t) + __attribute__ ((__bounded__(__string__,2,3))); +#endif +#if __POSIX_VISIBLE >= 199506 +int fdatasync(int); +#endif + +#if __XPG_VISIBLE || __BSD_VISIBLE +char *crypt(const char *, const char *); +int fchdir(int); +int fchown(int, uid_t, gid_t); +long gethostid(void); +char *getwd(char *) + __attribute__ ((__bounded__(__minbytes__,1,1024))); +int lchown(const char *, uid_t, gid_t); +int mkstemp(char *); +char *mktemp(char *); +int nice(int); +int setregid(gid_t, gid_t); +int setreuid(uid_t, uid_t); +void swab(const void *__restrict, void *__restrict, ssize_t); +void sync(void); +int truncate(const char *, off_t); +useconds_t ualarm(useconds_t, useconds_t); +int usleep(useconds_t); +pid_t vfork(void); +#endif + +#if __POSIX_VISIBLE >= 200809 || __XPG_VISIBLE >= 420 +pid_t getpgid(pid_t); +pid_t getsid(pid_t); +#endif + +#if __XPG_VISIBLE >= 500 +ssize_t pread(int, void *, size_t, off_t) + __attribute__((__bounded__(__buffer__,2,3))); +ssize_t pwrite(int, const void *, size_t, off_t) + __attribute__((__bounded__(__buffer__,2,3))); +int ttyname_r(int, char *, size_t) + __attribute__((__bounded__(__string__,2,3))); +#endif + +#if __BSD_VISIBLE || __XPG_VISIBLE <= 500 +/* Interfaces withdrawn by X/Open Issue 5 Version 0 */ +int brk(void *); +int chroot(const char *); +int getdtablesize(void); +int getpagesize(void); +char *getpass(const char *); +void *sbrk(int); +#endif + +#if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE >= 420 +int lockf(int, int, off_t); +#endif + +#if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE >= 420 || __BSD_VISIBLE +int symlink(const char *, const char *); +int gethostname(char *, size_t) + __attribute__ ((__bounded__(__string__,1,2))); +int setegid(gid_t); +int seteuid(uid_t); +#endif + +#if __POSIX_VISIBLE >= 200809 +int faccessat(int, const char *, int, int); +int fchownat(int, const char *, uid_t, gid_t, int); +int linkat(int, const char *, int, const char *, int); +ssize_t readlinkat(int, const char *, char *, size_t) + __attribute__ ((__bounded__(__string__,3,4))); +int symlinkat(const char *, int, const char *); +int unlinkat(int, const char *, int); +#endif + +#if __BSD_VISIBLE +int dup3(int, int, int); +int pipe2(int [2], int); +#endif + +#if __BSD_VISIBLE +int acct(const char *); +int closefrom(int); +int crypt_checkpass(const char *, const char *); +int crypt_newhash(const char *, const char *, char *, size_t); +void endusershell(void); +char *fflagstostr(u_int32_t); +int getdomainname(char *, size_t) + __attribute__ ((__bounded__(__string__,1,2))); +int getdtablecount(void); +int getgrouplist(const char *, gid_t, gid_t *, int *); +mode_t getmode(const void *, mode_t); +int getresgid(gid_t *, gid_t *, gid_t *); +int getresuid(uid_t *, uid_t *, uid_t *); +pid_t getthrid(void); +char *getusershell(void); +int initgroups(const char *, gid_t); +int issetugid(void); +char *mkdtemp(char *); +int mkstemps(char *, int); +int nfssvc(int, void *); +int profil(char *, size_t, unsigned long, unsigned int) + __attribute__ ((__bounded__(__string__,1,2))); +int quotactl(const char *, int, int, char *); +int rcmd(char **, int, const char *, + const char *, const char *, int *); +int rcmd_af(char **, int, const char *, + const char *, const char *, int *, int); +int rcmdsh(char **, int, const char *, + const char *, const char *, char *); +int reboot(int); +int revoke(const char *); +int rresvport(int *); +int rresvport_af(int *, int); +int ruserok(const char *, int, const char *, const char *); +int setdomainname(const char *, size_t); +int setgroups(int, const gid_t *); +int sethostid(long); +int sethostname(const char *, size_t); +int setlogin(const char *); +void *setmode(const char *); +int setpgrp(pid_t _pid, pid_t _pgrp); /* BSD compat version */ +int setresgid(gid_t, gid_t, gid_t); +int setresuid(uid_t, uid_t, uid_t); +void setusershell(void); +int strtofflags(char **, u_int32_t *, u_int32_t *); +int swapctl(int cmd, const void *arg, int misc); +int syscall(int, ...); +int getentropy(void *, size_t); +int pledge(const char *, const char *); +int unveil(const char *, const char *); +pid_t __tfork_thread(const struct __tfork *, size_t, void (*)(void *), + void *); +#endif /* __BSD_VISIBLE */ +__END_DECLS + +#endif /* !_UNISTD_H_ */ -- cgit v1.2.3