From: quzar <qu...@us...> - 2024-07-31 16:58:18
|
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 25a851792351a9818cc5d02762f5f925ee05e69b (commit) via 3f12e2627cbb9c7446345ed4627278c6e0cbf099 (commit) via d3e17e6bcfc558bda85ef8b0a63379061d646ea7 (commit) from d07bebfc468cd0046364031a01158c2e83ea2e00 (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 25a851792351a9818cc5d02762f5f925ee05e69b Author: Falco Girgis <gyr...@gm...> Date: Wed Jul 31 11:55:31 2024 -0500 Added utime h POSIX header file (#658) * Added utime.h header for missing declaration. - Freaking Newlib does NOT publicly declare the utime() function within the cross-platform header, utime.h; however, we have utime() implemented for SH. - Trying to use the utime() function prior to GCC14 would result in an implicit declaration of the function, which would resolve at link-time. GCC14 deprecated this, so now it's a hard error. - Added utime.h header file to KOS's root include folder so that #include <utime.h> will look there and find it first, rather than using Newlib's (worthless) header. commit 3f12e2627cbb9c7446345ed4627278c6e0cbf099 Author: Falco Girgis <gyr...@gm...> Date: Wed Jul 31 11:52:43 2024 -0500 Fixed GCC9+10 build failures: pthread_atfork() (#663) 1) pthread_atfork()'s implementation was not declaring agument variables by name, which was not supported in ancient GCC9 and GCC10, apparently. 2) pthread_atfork() was added as a symbol for CMake checks for pthreads to pass, yet we were never declaring the symbol publicly anywhere, and implicit declarations of C functions are now deprecated in GCC14+. commit d3e17e6bcfc558bda85ef8b0a63379061d646ea7 Author: Andy Barajas <and...@gm...> Date: Wed Jul 31 09:47:23 2024 -0700 Fix ramdisk_find (#687) Fix ramdisk_find by making sure we also compare the filename lengths so false positives wont occur ----------------------------------------------------------------------- Summary of changes: include/pthread.h | 3 ++- include/utime.h | 32 ++++++++++++++++++++++++++++++++ kernel/fs/fs_ramdisk.c | 4 ++-- kernel/libc/pthreads/pthread_thd.c | 5 +++-- 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 include/utime.h diff --git a/include/pthread.h b/include/pthread.h index bfff123a..c9ba378f 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -62,7 +62,8 @@ extern "C" { NOTE: RTEMS does not provide pthread_atfork(). */ #if !defined(__rtems__) -// #warning "Add pthread_atfork() prototype" + int pthread_atfork(void (*prepare)(void), void (*parent)(void), + void (*child)(void)); #endif /* Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 */ diff --git a/include/utime.h b/include/utime.h new file mode 100644 index 00000000..c7f9ef45 --- /dev/null +++ b/include/utime.h @@ -0,0 +1,32 @@ +/* KallistiOS ##version## + + utime.h + Copyright (C) 2024 Falco Girgis +*/ + +/** \file utime.h + \brief KOS extension of Newlib's utime.h + + Newlib does not ever actually declare a prototype for utime() within + its header, despite implementing it for SH. We add the prototype ourselves. + + \author Falco Girgis +*/ + +#ifndef __KOS_UTIME_H +#define __KOS_UTIME_H + +__BEGIN_DECLS + +#include <time.h> + +struct utimbuf { + time_t actime; /**< access time */ + time_t modtime; /**< modification time */ +}; + +extern int utime(const char *path, struct utimbuf *times); + +__END_DECLS + +#endif /* __KOS_UTIME_H */ diff --git a/kernel/fs/fs_ramdisk.c b/kernel/fs/fs_ramdisk.c index b2c8d57e..2dd0eda3 100644 --- a/kernel/fs/fs_ramdisk.c +++ b/kernel/fs/fs_ramdisk.c @@ -103,11 +103,11 @@ static mutex_t rd_mutex; /* Search a directory for the named file; return the struct if we find it. Assumes we hold rd_mutex. */ -static rd_file_t * ramdisk_find(rd_dir_t * parent, const char * name, int namelen) { +static rd_file_t *ramdisk_find(rd_dir_t *parent, const char *name, size_t namelen) { rd_file_t *f; LIST_FOREACH(f, parent, dirlist) { - if(!strncasecmp(name, f->name, namelen)) + if((strlen(f->name) == namelen) && !strncasecmp(name, f->name, namelen)) return f; } diff --git a/kernel/libc/pthreads/pthread_thd.c b/kernel/libc/pthreads/pthread_thd.c index 9217c9e8..04152942 100644 --- a/kernel/libc/pthreads/pthread_thd.c +++ b/kernel/libc/pthreads/pthread_thd.c @@ -71,7 +71,8 @@ int pthread_equal(pthread_t t1, pthread_t t2) { return t1 == t2; } -int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)) -{ +int pthread_atfork(void (*prepare)(void), void (*parent)(void), + void (*child)(void)) { + (void)prepare; (void)parent; (void)child; return 0; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |