Skip to content

Commit fd18158

Browse files
razvanvirtanunikraft-bot
authored andcommitted
Add missing symbols to the uksignal interface
The Go runtime requires some symbols related to signals that are not currently defined in `signal.h` (after the uksignal support was added). Changes brought in this commit: - add missing fields to `siginfo_t` - declare `sigaltstack` (the stub implementation is added to uksignal in a separate pull request, part of the core Unikraft repository) - add symbols for `ss_flags` values Signed-off-by: Răzvan Vîrtan <[email protected]> Tested-by: Unikraft CI <[email protected]> GitHub-Pull-Request: unikraft#11
1 parent fa59296 commit fd18158

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

musl-imported/include/signal.h

+30-6
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,33 @@ typedef __sigset_t sigset_t;
6565

6666
#define NSIG _NSIG
6767

68+
/* XXX: not used - defined just for newlib */
69+
union sigval {
70+
int sival_int; /* Integer signal value */
71+
void *sival_ptr; /* Pointer signal value */
72+
};
73+
6874
typedef struct {
6975
int si_signo; /* Signal number */
7076
int si_code; /* Cause of the signal */
7177
pid_t si_pid; /* Sending process ID */
78+
union sigval si_value; /* Signal value */
79+
80+
union {
81+
struct {
82+
void *si_addr;
83+
short si_addr_lsb;
84+
union {
85+
struct {
86+
void *si_lower;
87+
void *si_upper;
88+
} __addr_bnd;
89+
unsigned si_pkey;
90+
} __first;
91+
} __sigfault;
92+
} __si_fields;
7293
} siginfo_t;
94+
#define si_addr __si_fields.__sigfault.si_addr
7395

7496
struct sigaction {
7597
union {
@@ -119,25 +141,27 @@ int sigismember(const sigset_t *set, int signo);
119141
int siginterrupt(int sig, int flag);
120142
void psignal(int sig, const char *s);
121143

122-
/* TODO: not used - defined just for newlib */
123-
union sigval {
124-
int sival_int; /* Integer signal value */
125-
void *sival_ptr; /* Pointer signal value */
126-
};
127-
128144
struct sigevent {
129145
int sigev_notify; /* Notification type */
130146
int sigev_signo; /* Signal number */
131147
union sigval sigev_value; /* Signal value */
132148
};
133149

150+
/*
151+
* Possible values for ss_flags in stack_t below.
152+
*/
153+
#define SS_ONSTACK 0x1
154+
#define SS_DISABLE 0x2
155+
134156
/* TODO: not used - defined just for v8 */
135157
typedef struct sigaltstack {
136158
void *ss_sp;
137159
int ss_flags;
138160
size_t ss_size;
139161
} stack_t;
140162

163+
int sigaltstack(const stack_t *ss, stack_t *old_ss);
164+
141165
#ifdef __cplusplus
142166
}
143167
#endif

0 commit comments

Comments
 (0)