From: Lawrence S. <ljs...@us...> - 2020-01-27 16:20:49
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 9cb643e2b16366ffe3a03bd0597670f1ef7b4a63 (commit) via ed113ce4696245151b2c972f46f62e9aa0a36281 (commit) via 83397cba5c03e855b107bef6f8cdebbe04321c93 (commit) via 84320a07c8af05d489e040bbbc44c4c84446bc35 (commit) via 840910462355f1238c0c34f21a64a0498b1b5025 (commit) via 4bd0bd3096537747281b11456839af182ec25489 (commit) via 7adf8f9b05ca668b13c0f20be8bab028d7936f66 (commit) via 37ac7f857b6829135acecbf99bc9d74175c78a01 (commit) via 41be39c6aedb3d24866216942d9da54d7faaf8d9 (commit) from 1c39674de761329d9794e9cee0a9eabfbe4beb53 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9cb643e2b16366ffe3a03bd0597670f1ef7b4a63 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 27 11:18:09 2020 -0500 Apparently init and fini got renamed at some point. commit ed113ce4696245151b2c972f46f62e9aa0a36281 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 27 11:02:39 2020 -0500 Don't cause circular includes to break things badly. commit 83397cba5c03e855b107bef6f8cdebbe04321c93 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 27 11:02:22 2020 -0500 Remove -Werror from addons. commit 84320a07c8af05d489e040bbbc44c4c84446bc35 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 27 10:42:43 2020 -0500 Don't use __FUNCTION__ in assert in standard-compliant mode. commit 840910462355f1238c0c34f21a64a0498b1b5025 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 27 10:31:42 2020 -0500 Add fd_set and friends to sys/select.h, as it is no longer defined in sys/types.h in Newlib. commit 4bd0bd3096537747281b11456839af182ec25489 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 27 10:31:10 2020 -0500 Add types to sys/_types.h that newer versions of Newlib expect. commit 7adf8f9b05ca668b13c0f20be8bab028d7936f66 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 27 10:30:34 2020 -0500 Add __assert_func function. commit 37ac7f857b6829135acecbf99bc9d74175c78a01 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 27 10:29:41 2020 -0500 Get rid of the use of _EXFUN. Newlib removed this macro in newer versions, so get rid of it. commit 41be39c6aedb3d24866216942d9da54d7faaf8d9 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 27 10:27:53 2020 -0500 Rename st_*time members in fs_dcload's stat structure. This is to solve some problems compiling with newer versions of newlib, as st_atime and friends are all declared as macros in <sys/stat.h> now. Thus, using them as variable names in the stat structure like this breaks things. ----------------------------------------------------------------------- Summary of changes: addons/libkosfat/Makefile | 2 +- addons/libppp/Makefile | 2 +- include/assert.h | 21 +++- include/pthread.h | 168 +++++++++++---------------- include/sys/_types.h | 58 +++++++++ include/sys/select.h | 40 ++++++- kernel/arch/dreamcast/fs/fs_dcload.c | 8 +- kernel/arch/dreamcast/fs/fs_dclsocket.c | 8 +- kernel/arch/dreamcast/include/dc/fs_dcload.h | 8 +- kernel/arch/dreamcast/kernel/init.c | 13 ++- kernel/libc/koslib/assert.c | 3 + kernel/libc/koslib/gethostbyname.c | 2 +- 12 files changed, 204 insertions(+), 129 deletions(-) diff --git a/addons/libkosfat/Makefile b/addons/libkosfat/Makefile index 66b6667..de4d0ae 100644 --- a/addons/libkosfat/Makefile +++ b/addons/libkosfat/Makefile @@ -5,6 +5,6 @@ TARGET = libkosfat.a OBJS = fat.o bpb.o fatfs.o directory.o ucs.o fs_fat.o # Make sure everything comiles nice and cleanly (or not at all). -KOS_CFLAGS += -W -Wextra -pedantic -std=c99 -Werror +KOS_CFLAGS += -W -Wextra -pedantic -std=c99 include $(KOS_BASE)/addons/Makefile.prefab diff --git a/addons/libppp/Makefile b/addons/libppp/Makefile index 04d897e..64045f4 100644 --- a/addons/libppp/Makefile +++ b/addons/libppp/Makefile @@ -5,7 +5,7 @@ TARGET = libppp.a OBJS = ppp.o lcp.o pap.o ipcp.o # Make sure everything compiles nice and cleanly (or not at all). -KOS_CFLAGS += -W -pedantic -Werror -std=c99 -I$(KOS_BASE)/kernel/net +KOS_CFLAGS += -W -pedantic -std=c99 -I$(KOS_BASE)/kernel/net # Uncomment the line below to enable all manner of debugging output. KOS_CFLAGS += -DPPP_DEBUG diff --git a/include/assert.h b/include/assert.h index 583992e..9c8a66a 100644 --- a/include/assert.h +++ b/include/assert.h @@ -26,12 +26,26 @@ __BEGIN_DECLS error message. */ #define _assert(e) assert(e) -/* __FUNCTION__ is not ANSI, it's GCC, but we depend on GCC anyway.. */ #ifdef NDEBUG # define assert(e) ((void)0) # define assert_msg(e, m) ((void)0) #else +/* This bit of magic borrowed from Newlib's assert.h... */ +/* \cond */ +#ifndef __ASSERT_FUNC +#if defined(__cplusplus) +# define __ASSERT_FUNC __PRETTY_FUNCTION__ +#elif __STDC_VERSION__ >= 199901L +# define __ASSERT_FUNC __func__ +#elif __GNUC__ >= 2 +# define __ASSERT_FUNC __FUNCTION__ +#else +# define __ASSERT_FUNC ((char *)0) +#endif +#endif +/* \endcond */ + /** \brief Standard C assertion macro. This macro does a standard C assertion, wherein the expression is evaluated, @@ -42,7 +56,7 @@ __BEGIN_DECLS \param e A value or expression to be evaluated as true or false. */ -# define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e, NULL, __FUNCTION__)) +# define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e, NULL, __ASSERT_FUNC)) /** \brief assert() with a custom message. @@ -53,7 +67,7 @@ __BEGIN_DECLS false. \param m A message (const char *). */ -# define assert_msg(e, m) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e, m, __FUNCTION__)) +# define assert_msg(e, m) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e, m, __ASSERT_FUNC)) #endif /* \cond */ @@ -93,4 +107,3 @@ assert_handler_t assert_set_handler(assert_handler_t hnd); __END_DECLS #endif /* __ASSERT_H */ - diff --git a/include/pthread.h b/include/pthread.h index 300adbd..194eed3 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -66,18 +66,15 @@ extern "C" { /* Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 */ - int _EXFUN(pthread_mutexattr_init, (pthread_mutexattr_t *attr)); - int _EXFUN(pthread_mutexattr_destroy, (pthread_mutexattr_t *attr)); - int _EXFUN(pthread_mutexattr_getpshared, - (const pthread_mutexattr_t *attr, int *pshared)); - int _EXFUN(pthread_mutexattr_setpshared, - (pthread_mutexattr_t *attr, int pshared)); + int pthread_mutexattr_init(pthread_mutexattr_t *attr); + int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); + int pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr, int *pshared); + int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared); /* Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 */ - int _EXFUN(pthread_mutex_init, - (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)); - int _EXFUN(pthread_mutex_destroy, (pthread_mutex_t *mutex)); + int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr); + int pthread_mutex_destroy(pthread_mutex_t *mutex); /* This is used to statically initialize a pthread_mutex_t. Example: @@ -89,31 +86,27 @@ extern "C" { /* Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 */ - int _EXFUN(pthread_mutex_lock, (pthread_mutex_t *mutex)); - int _EXFUN(pthread_mutex_trylock, (pthread_mutex_t *mutex)); - int _EXFUN(pthread_mutex_unlock, (pthread_mutex_t *mutex)); + int pthread_mutex_lock(pthread_mutex_t *mutex); + int pthread_mutex_trylock(pthread_mutex_t *mutex); + int pthread_mutex_unlock(pthread_mutex_t *mutex); #if defined(_POSIX_TIMEOUTS) - int _EXFUN(pthread_mutex_timedlock, - (pthread_mutex_t *mutex, const struct timespec *timeout)); + int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout); #endif /* _POSIX_TIMEOUTS */ /* Condition Variable Initialization Attributes, P1003.1c/Draft 10, p. 96 */ - int _EXFUN(pthread_condattr_init, (pthread_condattr_t *attr)); - int _EXFUN(pthread_condattr_destroy, (pthread_condattr_t *attr)); - int _EXFUN(pthread_condattr_getpshared, - (const pthread_condattr_t *attr, int *pshared)); - int _EXFUN(pthread_condattr_setpshared, - (pthread_condattr_t *attr, int pshared)); + int pthread_condattr_init(pthread_condattr_t *attr); + int pthread_condattr_destroy(pthread_condattr_t *attr); + int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared); + int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared); /* Initializing and Destroying a Condition Variable, P1003.1c/Draft 10, p. 87 */ - int _EXFUN(pthread_cond_init, - (pthread_cond_t *cond, const pthread_condattr_t *attr)); - int _EXFUN(pthread_cond_destroy, (pthread_cond_t *cond)); + int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); + int pthread_cond_destroy(pthread_cond_t *cond); /* This is used to statically initialize a pthread_cond_t. Example: @@ -124,49 +117,38 @@ extern "C" { /* Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 */ - int _EXFUN(pthread_cond_signal, (pthread_cond_t *cond)); - int _EXFUN(pthread_cond_broadcast, (pthread_cond_t *cond)); + int pthread_cond_signal(pthread_cond_t *cond); + int pthread_cond_broadcast(pthread_cond_t *cond); /* Waiting on a Condition, P1003.1c/Draft 10, p. 105 */ - int _EXFUN(pthread_cond_wait, - (pthread_cond_t *cond, pthread_mutex_t *mutex)); + int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); - int _EXFUN(pthread_cond_timedwait, - (pthread_cond_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime)); + int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime); #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) /* Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 */ - int _EXFUN(pthread_attr_setscope, - (pthread_attr_t *attr, int contentionscope)); - int _EXFUN(pthread_attr_getscope, - (const pthread_attr_t *attr, int *contentionscope)); - int _EXFUN(pthread_attr_setinheritsched, - (pthread_attr_t *attr, int inheritsched)); - int _EXFUN(pthread_attr_getinheritsched, - (const pthread_attr_t *attr, int *inheritsched)); - int _EXFUN(pthread_attr_setschedpolicy, (pthread_attr_t *attr, int policy)); - int _EXFUN(pthread_attr_getschedpolicy, - (const pthread_attr_t *attr, int *policy)); + int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope); + int pthread_attr_getscope(const pthread_attr_t *attr, int *contentionscope); + int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched); + int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inheritsched); + int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy); + int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy); #endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ - int _EXFUN(pthread_attr_setschedparam, - (pthread_attr_t *attr, const struct sched_param *param)); - int _EXFUN(pthread_attr_getschedparam, - (const pthread_attr_t *attr, struct sched_param *param)); + int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param); + int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *param); #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) /* Dynamic Thread Scheduling Parameters Access, P1003.1c/Draft 10, p. 124 */ - int _EXFUN(pthread_getschedparam, - (pthread_t thread, int *policy, struct sched_param *param)); - int _EXFUN(pthread_setschedparam, - (pthread_t thread, int policy, struct sched_param *param)); + int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param); + int pthread_setschedparam(pthread_t thread, int policy, struct sched_param *param); #endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ @@ -174,14 +156,10 @@ extern "C" { /* Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 */ - int _EXFUN(pthread_mutexattr_setprotocol, - (pthread_mutexattr_t *attr, int protocol)); - int _EXFUN(pthread_mutexattr_getprotocol, - (const pthread_mutexattr_t *attr, int *protocol)); - int _EXFUN(pthread_mutexattr_setprioceiling, - (pthread_mutexattr_t *attr, int prioceiling)); - int _EXFUN(pthread_mutexattr_getprioceiling, - (const pthread_mutexattr_t *attr, int *prioceiling)); + int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol); + int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr, int *protocol); + int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr, int prioceiling); + int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr, int *prioceiling); #endif /* _POSIX_THREAD_PRIO_INHERIT || _POSIX_THREAD_PRIO_PROTECT */ @@ -189,55 +167,46 @@ extern "C" { /* Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131 */ - int _EXFUN(pthread_mutex_setprioceiling, - (pthread_mutex_t *mutex, int prioceiling, int *old_ceiling)); - int _EXFUN(pthread_mutex_getprioceiling, - (pthread_mutex_t *mutex, int *prioceiling)); + int pthread_mutex_setprioceiling(pthread_mutex_t *mutex, int prioceiling, int *old_ceiling); + int pthread_mutex_getprioceiling(pthread_mutex_t *mutex, int *prioceiling); #endif /* _POSIX_THREAD_PRIO_PROTECT */ /* Thread Creation Attributes, P1003.1c/Draft 10, p, 140 */ - int _EXFUN(pthread_attr_init, (pthread_attr_t *attr)); - int _EXFUN(pthread_attr_destroy, (pthread_attr_t *attr)); - int _EXFUN(pthread_attr_getstacksize, - (const pthread_attr_t *attr, size_t *stacksize)); - int _EXFUN(pthread_attr_setstacksize, - (pthread_attr_t *attr, size_t stacksize)); - int _EXFUN(pthread_attr_getstackaddr, - (const pthread_attr_t *attr, void **stackaddr)); - int _EXFUN(pthread_attr_setstackaddr, - (pthread_attr_t *attr, void *stackaddr)); - int _EXFUN(pthread_attr_getdetachstate, - (const pthread_attr_t *attr, int *detachstate)); - int _EXFUN(pthread_attr_setdetachstate, - (pthread_attr_t *attr, int detachstate)); + int pthread_attr_init(pthread_attr_t *attr); + int pthread_attr_destroy(pthread_attr_t *attr); + int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize); + int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize); + int pthread_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr); + int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr); + int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate); + int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate); /* Thread Creation, P1003.1c/Draft 10, p. 144 */ - int _EXFUN(pthread_create, - (pthread_t *thread, const pthread_attr_t *attr, - void * (*start_routine)(void *), void *arg)); + int pthread_create(pthread_t *thread, const pthread_attr_t *attr, + void * (*start_routine)(void *), void *arg); /* Wait for Thread Termination, P1003.1c/Draft 10, p. 147 */ - int _EXFUN(pthread_join, (pthread_t thread, void **value_ptr)); + int pthread_join(pthread_t thread, void **value_ptr); /* Detaching a Thread, P1003.1c/Draft 10, p. 149 */ - int _EXFUN(pthread_detach, (pthread_t thread)); + int pthread_detach(pthread_t thread); /* Thread Termination, p1003.1c/Draft 10, p. 150 */ - void _EXFUN(pthread_exit, (void *value_ptr)); + void pthread_exit(void *value_ptr); /* Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX */ - pthread_t _EXFUN(pthread_self, (void)); + pthread_t pthread_self(void); /* Compare Thread IDs, p1003.1c/Draft 10, p. 153 */ - int _EXFUN(pthread_equal, (pthread_t t1, pthread_t t2)); + int pthread_equal(pthread_t t1, pthread_t t2); /* Dynamic Package Initialization */ @@ -249,22 +218,20 @@ extern "C" { #define PTHREAD_ONCE_INIT { 1, 0 } /* is initialized and not run */ - int _EXFUN(pthread_once, - (pthread_once_t *once_control, void (*init_routine)(void))); + int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)); /* Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 */ - int _EXFUN(pthread_key_create, - (pthread_key_t *key, void (*destructor)(void *))); + int pthread_key_create(pthread_key_t *key, void (*destructor)(void *)); /* Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 */ - int _EXFUN(pthread_setspecific, (pthread_key_t key, const void *value)); - void * _EXFUN(pthread_getspecific, (pthread_key_t key)); + int pthread_setspecific(pthread_key_t key, const void *value); + void *pthread_getspecific(pthread_key_t key); /* Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167 */ - int _EXFUN(pthread_key_delete, (pthread_key_t key)); + int pthread_key_delete(pthread_key_t key); /* Execution of a Thread, P1003.1c/Draft 10, p. 181 */ @@ -276,33 +243,30 @@ extern "C" { #define PTHREAD_CANCELED ((void *) -1) - int _EXFUN(pthread_cancel, (pthread_t thread)); + int pthread_cancel(pthread_t thread); /* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ - int _EXFUN(pthread_setcancelstate, (int state, int *oldstate)); - int _EXFUN(pthread_setcanceltype, (int type, int *oldtype)); - void _EXFUN(pthread_testcancel, (void)); + int pthread_setcancelstate(int state, int *oldstate); + int pthread_setcanceltype(int type, int *oldtype); + void pthread_testcancel(void); /* Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184 */ - void _EXFUN(pthread_cleanup_push, (void (*routine)(void *), void *arg)); - void _EXFUN(pthread_cleanup_pop, (int execute)); + void pthread_cleanup_push(void (*routine)(void *), void *arg); + void pthread_cleanup_pop(int execute); #if defined(_POSIX_THREAD_CPUTIME) /* Accessing a Thread CPU-time Clock, P1003.4b/D8, p. 58 */ - int _EXFUN(pthread_getcpuclockid, - (pthread_t thread_id, clockid_t *clock_id)); + int pthread_getcpuclockid(pthread_t thread_id, clockid_t *clock_id); /* CPU-time Clock Thread Creation Attribute, P1003.4b/D8, p. 59 */ - int _EXFUN(pthread_attr_setcputime, - (pthread_attr_t *attr, int clock_allowed)); + int pthread_attr_setcputime(pthread_attr_t *attr, int clock_allowed); - int _EXFUN(pthread_attr_getcputime, - (pthread_attr_t *attr, int *clock_allowed)); + int pthread_attr_getcputime(pthread_attr_t *attr, int *clock_allowed); #endif /* defined(_POSIX_THREAD_CPUTIME) */ diff --git a/include/sys/_types.h b/include/sys/_types.h index 69cb8d0..82a3859 100644 --- a/include/sys/_types.h +++ b/include/sys/_types.h @@ -15,6 +15,7 @@ #ifndef __off_t_defined /** \brief File offset type. */ typedef long _off_t; +typedef _off_t __off_t; #endif #ifndef __dev_t_defined @@ -83,6 +84,63 @@ typedef __newlib_recursive_lock_t _flock_t; typedef void *_iconv_t; #endif +#ifndef __blkcnt_t_defined +typedef long __blkcnt_t; +#endif + +#ifndef __blksize_t_defined +typedef long __blksize_t; +#endif + +#ifndef __fsblkcnt_t_defined +typedef unsigned long long __fsblkcnt_t; +#endif + +#ifndef __fsfilcnt_t_defined +typedef unsigned long __fsfilcnt_t; +#endif + +#ifndef __id_t_defined +typedef unsigned long __id_t; +#endif + +#ifndef __ino_t_defined +typedef unsigned long __ino_t; +#endif + +#ifndef __pid_t_defined +typedef int __pid_t; +#endif + +#ifndef __key_t_defined +typedef long __key_t; +#endif + +#ifndef __mode_t_defined +typedef unsigned long __mode_t; +#endif + +typedef unsigned short __nlink_t; +typedef long __suseconds_t; /* microseconds (signed) */ +typedef unsigned long __useconds_t; /* microseconds (unsigned) */ + +#define _TIME_T_ long +typedef _TIME_T_ __time_t; + +#ifndef __clockid_t_defined +#define _CLOCKID_T_ unsigned long +#endif + +typedef _CLOCKID_T_ __clockid_t; + +#define _TIMER_T_ unsigned long +typedef _TIMER_T_ __timer_t; + +#ifndef __clock_t_defined +#define _CLOCK_T_ unsigned long /* clock() */ +#endif + +typedef _CLOCK_T_ __clock_t; // This part inserted to fix newlib brokenness. /** \brief Size of an fd_set. */ diff --git a/include/sys/select.h b/include/sys/select.h index d394d1d..7f71a67 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -12,7 +12,7 @@ as directed by the POSIX 2008 standard (aka The Open Group Base Specifications Issue 7). Currently the functionality defined herein only really works for sockets, and that is likely how it will stay for some time. - + \author Lawrence Sebald */ @@ -24,11 +24,45 @@ __BEGIN_DECLS +#include <newlib.h> + +#if __NEWLIB__ > 2 || (__NEWLIB__ == 2 && __NEWLIB_MINOR__ > 2) +#include <sys/_timeval.h> +#else #include <time.h> #include <sys/time.h> +#endif + +/* Newlib used to define fd_set and friends in <sys/types.h>, but at some point + that stopped being the case... This should tell us whether we need to define + it here or not... */ +#ifndef _SYS_TYPES_FD_SET + +#define _SYS_TYPES_FD_SET + +#ifndef FD_SETSIZE +/* This matches fs.h. */ +#define FD_SETSIZE 1024 +#endif + +#define NFDBITS 32 + +typedef struct fd_set { + unsigned long fds_bits[FD_SETSIZE / NFDBITS]; +} fd_set; ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |