Skip to content

Instantly share code, notes, and snippets.

@joycemaferko
joycemaferko / sig2str.c
Created August 18, 2021 13:07
sig2str/str2sig Implementation
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2021 Matthew Joyce
*
* 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
@joycemaferko
joycemaferko / signal.h
Created August 18, 2021 13:11
sys/signal.h
/* Prototype added to Newlib/libc/include/sys/signal.h */
/* Using __MISC_VISIBLE until POSIX Issue 8 is officially released */
#if __MISC_VISIBLE
/* POSIX Issue 8 adds sig2str() and str2sig() */
#if __STDINT_EXP(INT_MAX) > 0x7fff
#define SIG2STR_MAX (sizeof("RTMAX+") + sizeof("4294967295") - 1)
#else
@joycemaferko
joycemaferko / pthread.h
Created August 18, 2021 13:17
Pthread Prototypes
/* Prototypes for the following new *clock methods added to Newlib
* libc/include/pthread.h */
#if __GNU_VISIBLE
/* The Issue 8 standard adds pthread_mutex_clocklock() */
int pthread_mutex_clocklock(pthread_mutex_t *__restrict, clockid_t,
const struct timespec *__restrict);
#endif /* __GNU_VISIBLE */
#if __GNU_VISIBLE
@joycemaferko
joycemaferko / pthread_cond_clockwait.c
Created August 18, 2021 13:21
Compile Test: pthread_cond_clockwait()
/*
* @file
* @brief pthread_cond_clockwait() API Conformance Test
*/
/*
* Copyright (C) 2021 Matthew Joyce
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@joycemaferko
joycemaferko / pthread_mutex_clocklock.c
Created August 18, 2021 13:22
Compile Test: pthread_mutex_clocklock
/*
* @file
* @brief pthread_mutex_clocklock() API Conformance Test
*/
/*
* Copyright (C) 2021 Matthew Joyce
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@joycemaferko
joycemaferko / pthread_rwlock_clockrdlock.c
Created August 18, 2021 13:23
Compile Test: pthread_rwlock_clockrdlock
/*
* @file
* @brief pthread_rwlock_clockrdlock() API Conformance Test
*/
/*
* Copyright (C) 2021 Matthew Joyce
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@joycemaferko
joycemaferko / pthread_rwlock_clockwrlock.c
Created August 18, 2021 13:24
Compile Test: pthread_rwlock_clockwrlock
/*
* @file
* @brief pthread_rwlock_clockwrlock() API Conformance Test
*/
/*
* Copyright (C) 2021 Matthew Joyce
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@joycemaferko
joycemaferko / sig2str.c
Created August 18, 2021 13:31
Compile Test: sig2str/str2sig
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
* @brief Header File Conformance Test
*
* This test file is used to verify that the header files associated with
* invoking this function are correct.
*/
@joycemaferko
joycemaferko / init.c
Last active September 6, 2021 07:49
RTEMS Test for sig2str.c (psxsignal09)
/* SPDX-License-Identifier: BSD-2-Clause */
/**
* @file
* @brief Test of sig2str and str2sig methods
*
* This test file is used to verify that the methods sig2str and str2sig
* are functioning as expected
*/
@joycemaferko
joycemaferko / init.c
Last active August 25, 2021 12:51
RTEMS Test for pthread_cond_clockwait() (psxcond03)
/*
* Copyright (C) 2021 Matthew Joyce
*
* 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