Compare commits
No commits in common. "b63e5af467d6ee89aa1c5aa8bf4b7db522566c04" and "8210ac97d333ab1e7ce7eace7f71ef22fdfbdfe1" have entirely different histories.
b63e5af467
...
8210ac97d3
9 changed files with 30 additions and 91 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2014, 2024 Jonas 'Sortie' Termansen.
|
||||
* Copyright (c) 2014 Jonas 'Sortie' Termansen.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -42,8 +42,6 @@ extern "C" {
|
|||
|
||||
#define __WSTOPSIG(status) __WTERMSIG(status)
|
||||
|
||||
#define __WCOREDUMP(status) ((status) & 0)
|
||||
|
||||
#define __WCONSTRUCT(nature, exitcode, signal) \
|
||||
(((nature) & 0xFF) << 16 | \
|
||||
((exitcode) & 0xFF) << 8 | \
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <sortix/__/sigset.h>
|
||||
|
||||
#if __USE_SORTIX || __USE_POSIX
|
||||
#define HOST_NAME_MAX 255
|
||||
#define TTY_NAME_MAX 32
|
||||
|
@ -32,7 +30,6 @@
|
|||
|
||||
#if __USE_SORTIX || 202405L <= __USE_POSIX
|
||||
#define GETENTROPY_MAX 256
|
||||
#define NSIG_MAX __SIGSET_NUM_SIGNALS
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2014, 2024 Jonas 'Sortie' Termansen.
|
||||
* Copyright (c) 2012, 2014 Jonas 'Sortie' Termansen.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -48,8 +48,6 @@ extern "C" {
|
|||
|
||||
#define WSTOPSIG(status) __WSTOPSIG(status)
|
||||
|
||||
#define WCOREDUMP(status) __WCOREDUMP(status)
|
||||
|
||||
#define WCONSTRUCT(nature, exitcode, signal) \
|
||||
__WCONSTRUCT(nature, exitcode, signal)
|
||||
|
||||
|
|
|
@ -164,7 +164,6 @@ stdlib/qsort.o \
|
|||
stdlib/qsort_r.o \
|
||||
stdlib/reallocarray.o \
|
||||
stdlib/realloc.o \
|
||||
stdlib/secure_getenv.o \
|
||||
stdlib/strtod.o \
|
||||
stdlib/strtof.o \
|
||||
stdlib/strtold.o \
|
||||
|
|
|
@ -88,30 +88,6 @@ typedef int nl_item;
|
|||
#define YESEXPR 53
|
||||
#define NOEXPR 54
|
||||
#define CRNCYSTR 55
|
||||
#define ALTMON_1 56
|
||||
#define ALTMON_2 57
|
||||
#define ALTMON_3 58
|
||||
#define ALTMON_4 59
|
||||
#define ALTMON_5 60
|
||||
#define ALTMON_6 61
|
||||
#define ALTMON_7 62
|
||||
#define ALTMON_8 63
|
||||
#define ALTMON_9 64
|
||||
#define ALTMON_10 65
|
||||
#define ALTMON_11 66
|
||||
#define ALTMON_12 67
|
||||
#define ABALTMON_1 69
|
||||
#define ABALTMON_2 70
|
||||
#define ABALTMON_3 71
|
||||
#define ABALTMON_4 72
|
||||
#define ABALTMON_5 73
|
||||
#define ABALTMON_6 74
|
||||
#define ABALTMON_7 75
|
||||
#define ABALTMON_8 76
|
||||
#define ABALTMON_9 77
|
||||
#define ABALTMON_10 78
|
||||
#define ABALTMON_11 79
|
||||
#define ABALTMON_12 80
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -168,8 +168,6 @@ struct pthread_cond_elem
|
|||
|
||||
#define PTHREAD_ONCE_INIT { PTHREAD_NORMAL_MUTEX_INITIALIZER_NP, 0 }
|
||||
|
||||
#define PTHREAD_NULL ((pthread_t) 0)
|
||||
|
||||
#if defined(__is_sortix_libc)
|
||||
|
||||
struct pthread_key
|
||||
|
|
|
@ -115,6 +115,8 @@ size_t mbstowcs(wchar_t* __restrict, const char* __restrict, size_t);
|
|||
int mbtowc(wchar_t *__restrict, const char* __restrict, size_t);
|
||||
char* mkdtemp(char*);
|
||||
char* mkdtemps(char*, size_t);
|
||||
int mkostemp(char*, int);
|
||||
int mkostemps(char*, int, int);
|
||||
int mkstemp(char*);
|
||||
int mkstemps(char*, int);
|
||||
int on_exit(void (*function)(int, void*), void* arg);
|
||||
|
@ -155,8 +157,6 @@ long long strtoll(const char* __restrict, char** __restrict, int);
|
|||
|
||||
/* Functions from POSIX 2024. */
|
||||
#if __USE_SORTIX || 202405L <= __USE_POSIX
|
||||
int mkostemp(char*, int);
|
||||
int ptsname_r(int, char*, size_t);
|
||||
void qsort_r(void*, size_t, size_t, int (*)(const void*, const void*, void*), void*);
|
||||
#ifdef __TRACE_ALLOCATION_SITES
|
||||
void* reallocarray_trace(struct __allocation_site*, void*, size_t, size_t);
|
||||
|
@ -164,7 +164,6 @@ void* reallocarray_trace(struct __allocation_site*, void*, size_t, size_t);
|
|||
#else
|
||||
void* reallocarray(void*, size_t, size_t);
|
||||
#endif
|
||||
char* secure_getenv(const char*);
|
||||
#endif
|
||||
|
||||
#if defined(__is_sortix_libc)
|
||||
|
@ -215,7 +214,7 @@ int posix_openpt(int);
|
|||
uint32_t arc4random(void);
|
||||
void arc4random_buf(void*, size_t);
|
||||
uint32_t arc4random_uniform(uint32_t);
|
||||
int mkostemps(char*, int, int);
|
||||
int ptsname_r(int, char*, size_t);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016, 2024 Jonas 'Sortie' Termansen.
|
||||
* Copyright (c) 2016 Jonas 'Sortie' Termansen.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -45,30 +45,30 @@ char* nl_langinfo_l(nl_item item, locale_t locale)
|
|||
case ABDAY_5: return "Thu";
|
||||
case ABDAY_6: return "Fri";
|
||||
case ABDAY_7: return "Sat";
|
||||
case MON_1: case ALTMON_1: return "January";
|
||||
case MON_2: case ALTMON_2: return "February";
|
||||
case MON_3: case ALTMON_3: return "March";
|
||||
case MON_4: case ALTMON_4: return "April";
|
||||
case MON_5: case ALTMON_5: return "May";
|
||||
case MON_6: case ALTMON_6: return "June";
|
||||
case MON_7: case ALTMON_7: return "July";
|
||||
case MON_8: case ALTMON_8: return "August";
|
||||
case MON_9: case ALTMON_9: return "September";
|
||||
case MON_10: case ALTMON_10: return "October";
|
||||
case MON_11: case ALTMON_11: return "November";
|
||||
case MON_12: case ALTMON_12: return "December";
|
||||
case ABMON_1: case ABALTMON_1: return "Jan";
|
||||
case ABMON_2: case ABALTMON_2: return "Feb";
|
||||
case ABMON_3: case ABALTMON_3: return "Mar";
|
||||
case ABMON_4: case ABALTMON_4: return "Apr";
|
||||
case ABMON_5: case ABALTMON_5: return "May";
|
||||
case ABMON_6: case ABALTMON_6: return "Jun";
|
||||
case ABMON_7: case ABALTMON_7: return "Jul";
|
||||
case ABMON_8: case ABALTMON_8: return "Aug";
|
||||
case ABMON_9: case ABALTMON_9: return "Sep";
|
||||
case ABMON_10: case ABALTMON_10: return "Oct";
|
||||
case ABMON_11: case ABALTMON_11: return "Nov";
|
||||
case ABMON_12: case ABALTMON_12: return "Dec";
|
||||
case MON_1: return "January";
|
||||
case MON_2: return "February";
|
||||
case MON_3: return "March";
|
||||
case MON_4: return "April";
|
||||
case MON_5: return "May";
|
||||
case MON_6: return "June";
|
||||
case MON_7: return "July";
|
||||
case MON_8: return "August";
|
||||
case MON_9: return "September";
|
||||
case MON_10: return "October";
|
||||
case MON_11: return "November";
|
||||
case MON_12: return "December";
|
||||
case ABMON_1: return "Jan";
|
||||
case ABMON_2: return "Feb";
|
||||
case ABMON_3: return "Mar";
|
||||
case ABMON_4: return "Apr";
|
||||
case ABMON_5: return "May";
|
||||
case ABMON_6: return "Jun";
|
||||
case ABMON_7: return "Jul";
|
||||
case ABMON_8: return "Aug";
|
||||
case ABMON_9: return "Sep";
|
||||
case ABMON_10: return "Oct";
|
||||
case ABMON_11: return "Nov";
|
||||
case ABMON_12: return "Dec";
|
||||
case ERA: return "";
|
||||
case ERA_D_FMT: return "";
|
||||
case ERA_D_T_FMT: return "";
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Jonas 'Sortie' Termansen.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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.
|
||||
*
|
||||
* stdlib/secure_getenv.c
|
||||
* Get an environment variable securely.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
char* secure_getenv(const char* name)
|
||||
{
|
||||
// Sortix does not have setuid / setgid executables.
|
||||
return getenv(name);
|
||||
}
|
Loading…
Reference in a new issue