Commit 9f1e4fa8 authored by Christopher Friedt's avatar Christopher Friedt Committed by Carles Cufi
Browse files

posix: signal: type corrections for sigval, sigevent, notify attr

* `struct sigevent` is not type-defined
* `union sigval` is not type-defined
* `struct sigevent` must include `sigev_notify_attributes`

For more information, see https://bit.ly/3YfnELI

Signed-off-by: default avatarChristopher Friedt <cfriedt@meta.com>
parent 33c30529
Loading
Loading
Loading
Loading
+0 −3
Changes for include/zephyr/posix/posix_types.h: 0 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ typedef uint32_t clockid_t;
typedef unsigned long timer_t;
#endif

#ifdef CONFIG_PTHREAD_IPC
/* Thread attributes */
struct pthread_attr {
	int priority;
@@ -101,8 +100,6 @@ typedef struct pthread_rwlock_obj {
	k_tid_t wr_owner;
} pthread_rwlock_t;

#endif /* CONFIG_PTHREAD_IPC */

#ifdef __cplusplus
}
#endif
+6 −8
Changes for include/zephyr/posix/signal.h: 6 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -77,20 +77,18 @@ int sigismember(const sigset_t *set, int signo);

typedef int	sig_atomic_t;		/* Atomic entity type (ANSI) */

typedef union sigval {
union sigval {
	int sival_int;
	void *sival_ptr;
} sigval;
};

typedef struct sigevent {
struct sigevent {
	int sigev_notify;
	int sigev_signo;
	sigval sigev_value;
	void (*sigev_notify_function)(sigval val);
	#ifdef CONFIG_PTHREAD_IPC
	union sigval sigev_value;
	void (*sigev_notify_function)(union sigval val);
	pthread_attr_t *sigev_notify_attributes;
	#endif
} sigevent;
};

#ifdef __cplusplus
}
+3 −2
Changes for lib/posix/timer.c: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#include <errno.h>
#include <string.h>
#include <zephyr/sys/printk.h>
#include <zephyr/posix/signal.h>
#include <zephyr/posix/time.h>

#define ACTIVE 1
@@ -16,8 +17,8 @@ static void zephyr_timer_wrapper(struct k_timer *ztimer);

struct timer_obj {
	struct k_timer ztimer;
	void (*sigev_notify_function)(sigval val);
	sigval val;
	void (*sigev_notify_function)(union sigval val);
	union sigval val;
	struct timespec interval;	/* Reload value */
	uint32_t reload;			/* Reload value in ms */
	uint32_t status;