xref: /netbsd-src/lib/libc/include/extern.h (revision ced5df5920e318a101ec7c6a0b35f7776ce7ce23)
1*ced5df59Schristos /*	$NetBSD: extern.h,v 1.32 2024/10/01 16:35:13 christos Exp $	*/
200406df8Schristos 
300406df8Schristos /*
400406df8Schristos  * Copyright (c) 1997 Christos Zoulas.  All rights reserved.
500406df8Schristos  *
600406df8Schristos  * Redistribution and use in source and binary forms, with or without
700406df8Schristos  * modification, are permitted provided that the following conditions
800406df8Schristos  * are met:
900406df8Schristos  * 1. Redistributions of source code must retain the above copyright
1000406df8Schristos  *    notice, this list of conditions and the following disclaimer.
1100406df8Schristos  * 2. Redistributions in binary form must reproduce the above copyright
1200406df8Schristos  *    notice, this list of conditions and the following disclaimer in the
1300406df8Schristos  *    documentation and/or other materials provided with the distribution.
1400406df8Schristos  *
1500406df8Schristos  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1600406df8Schristos  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1700406df8Schristos  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1800406df8Schristos  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1900406df8Schristos  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2000406df8Schristos  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2100406df8Schristos  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2200406df8Schristos  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2300406df8Schristos  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2400406df8Schristos  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2500406df8Schristos  */
2600406df8Schristos 
27*ced5df59Schristos #include <sys/types.h>	/* off_t */
283eb244d8Sjoerg #include <stdarg.h>
29bba80928Smanu #include <ucontext.h>
303eb244d8Sjoerg 
317efdee83Sjoerg #ifndef __LOCALE_T_DECLARED
327efdee83Sjoerg typedef struct _locale		*locale_t;
337efdee83Sjoerg #define __LOCALE_T_DECLARED
347efdee83Sjoerg #endif /* __LOCALE_T_DECLARED */
357efdee83Sjoerg 
3600406df8Schristos __BEGIN_DECLS
376348b7d5Skleink extern char *__minbrk;
384be2f99dSchristos extern sigset_t __sigintr;
399ba017e6Schristos extern char **environ;
404ca73ce8Schristos int __getcwd(char *, size_t);
414ca73ce8Schristos int __getlogin(char *, size_t);
424ca73ce8Schristos int __setlogin(const char *);
43*ced5df59Schristos int __posix_fadvise50(int, int, off_t, off_t, int);
449ba017e6Schristos void  __section(".text.startup") __attribute__((__visibility__("hidden")))
459ba017e6Schristos     __libc_atomic_init(void);
460a2b7583Sjoerg void _resumecontext(void) __dead;
477efdee83Sjoerg __dso_hidden int	_strerror_lr(int, char *, size_t, locale_t);
484ca73ce8Schristos const char *__strerror(int , char *, size_t);
494ca73ce8Schristos const char *__strsignal(int , char *, size_t);
504ca73ce8Schristos char *__dtoa(double, int, int, int *, int *, char **);
514ca73ce8Schristos void __freedtoa(char *);
524ca73ce8Schristos int __sysctl(const int *, unsigned int, void *, size_t *, const void *, size_t);
53522edd58Sthorpej 
54522edd58Sthorpej struct sigaction;
554ca73ce8Schristos int __sigaction_sigtramp(int, const struct sigaction *,
564ca73ce8Schristos     struct sigaction *, const void *, int);
57b72acd51Schristos 
58c41e4692Schristos /* is "long double" and "double" different? */
59c41e4692Schristos #if (__LDBL_MANT_DIG__ != __DBL_MANT_DIG__) || \
60c41e4692Schristos     (__LDBL_MAX_EXP__ != __DBL_MAX_EXP__)
61c41e4692Schristos #define WIDE_DOUBLE
62c41e4692Schristos #endif
63c41e4692Schristos 
64c975cdc8Schristos #ifdef WIDE_DOUBLE
65c975cdc8Schristos char *__hldtoa(long double, const char *, int, int *, int *,  char **);
66c975cdc8Schristos char *__ldtoa(long double *, int, int, int *, int *, char **);
67c975cdc8Schristos #endif
68c41e4692Schristos char *__hdtoa(double, const char *, int, int *, int *, char **);
69c975cdc8Schristos 
70b831a8adSchristos void	_malloc_prefork(void);
71b831a8adSchristos void	_malloc_postfork(void);
728409cf4aSjoerg void	_malloc_postfork_child(void);
73b831a8adSchristos 
74bba80928Smanu int	_sys_setcontext(const ucontext_t *);
75bba80928Smanu 
762a1a34d5Schristos int	strerror_r_ss(int, char *, size_t);
77b722e422Schristos __aconst char *strerror_ss(int);
782a1a34d5Schristos 
7900406df8Schristos __END_DECLS
80