authorgravatar for hahv@msn.comHuang Zhichao <hahv@msn.com> 2026-03-11 15:49:37+08:00
committergravatar for hahv@msn.comHuang Zhichao <hahv@msn.com> 2026-03-11 16:04:16+08:00
log3e9ab94d290a52ae6119e92cb8a1e9d0ff4a7423
tree0d87c8ce06863bbf343c5676940258644f6e20a8
parentfeaa690dc6673073039e81c9e5d43d2a65224cfa
signaturebadge-check Signed by SSH key SHA256:1M/wLNh5QHclSdTUgDZGQDGwoPEAbFYSC0b1Oc5JXGA

FreeBSD libc: guard ssp headers and definitions introduced in FreeBSD 15


14 files changed, 42 insertions(+), 0 deletions(-)

lib/libc/include/generic-freebsd/poll.h+3
......@@ -109,9 +109,12 @@ typedef __sigset_t sigset_t;
109109
110110#endif
111111
112// zig patch: ssp/poll.h header was added in FreeBSD 15
113#if __FreeBSD_version >= 1500500
112114#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
113115#include <ssp/poll.h>
114116#endif
117#endif
115118
116119__BEGIN_DECLS
117120int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);
lib/libc/include/generic-freebsd/signal.h+3
......@@ -72,9 +72,12 @@ typedef __pthread_t pthread_t;
7272#endif
7373#endif /* __POSIX_VISIBLE || __XSI_VISIBLE */
7474
75// zig patch: ssp/signal.h header was added in FreeBSD 15
76#if __FreeBSD_version >= 1500500
7577#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
7678#include <ssp/signal.h>
7779#endif
80#endif
7881
7982__BEGIN_DECLS
8083int raise(int);
lib/libc/include/generic-freebsd/stdio.h+3
......@@ -252,9 +252,12 @@ __END_DECLS
252252#define L_ctermid 1024 /* size for ctermid(3); PATH_MAX */
253253#endif /* __POSIX_VISIBLE */
254254
255// zig patch: ssp/stdio.h header was added in FreeBSD 15
256#if __FreeBSD_version >= 1500500
255257#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
256258#include <ssp/stdio.h>
257259#endif
260#endif
258261
259262__BEGIN_DECLS
260263#ifdef _XLOCALE_H_
lib/libc/include/generic-freebsd/stdlib.h+3
......@@ -69,9 +69,12 @@ typedef struct {
6969 */
7070#define RAND_MAX 0x7fffffff
7171
72// zig patch: ssp/stdlib.h header was added in FreeBSD 15
73#if __FreeBSD_version >= 1500500
7274#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
7375#include <ssp/stdlib.h>
7476#endif
77#endif
7578
7679__BEGIN_DECLS
7780#ifdef _XLOCALE_H_
lib/libc/include/generic-freebsd/string.h+3
......@@ -49,9 +49,12 @@ typedef __size_t size_t;
4949#define _SIZE_T_DECLARED
5050#endif
5151
52// zig patch: ssp/string.h header was added in FreeBSD 15
53#if __FreeBSD_version >= 1500500
5254#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
5355#include <ssp/string.h>
5456#endif
57#endif
5558
5659__BEGIN_DECLS
5760#if __XSI_VISIBLE >= 600 || __ISO_C_VISIBLE >= 2023
lib/libc/include/generic-freebsd/strings.h+3
......@@ -37,9 +37,12 @@ typedef __size_t size_t;
3737#define _SIZE_T_DECLARED
3838#endif
3939
40// zig patch: ssp/strings.h header was added in FreeBSD 15
41#if __FreeBSD_version >= 1500500
4042#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
4143#include <ssp/strings.h>
4244#endif
45#endif
4346
4447__BEGIN_DECLS
4548#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
lib/libc/include/generic-freebsd/sys/libkern.h+3
......@@ -334,10 +334,13 @@ signed_extend32(uint32_t bitmap, int lsb, int width)
334334#define FNM_IGNORECASE FNM_CASEFOLD
335335#define FNM_FILE_NAME FNM_PATHNAME
336336
337// zig patch: ssp/ssp.h header and __ssp_real were added in FreeBSD 15
338#if __FreeBSD_version >= 1500500
337339#if !defined(_KERNEL) && __has_include(<ssp/ssp.h>)
338340#include <ssp/ssp.h> /* __ssp_real */
339341#else
340342#define __ssp_real(fun) fun
341343#endif
344#endif
342345
343346#endif /* !_SYS_LIBKERN_H_ */
\ No newline at end of file
lib/libc/include/generic-freebsd/sys/poll.h+3
......@@ -109,9 +109,12 @@ typedef __sigset_t sigset_t;
109109
110110#endif
111111
112// zig patch: ssp/poll.h header was added in FreeBSD 15
113#if __FreeBSD_version >= 1500500
112114#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
113115#include <ssp/poll.h>
114116#endif
117#endif
115118
116119__BEGIN_DECLS
117120int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);
lib/libc/include/generic-freebsd/sys/random.h+3
......@@ -156,9 +156,12 @@ random_harvest_direct(const void *entropy, u_int size, enum random_entropy_sourc
156156
157157#else /* !_KERNEL */
158158
159// zig patch: ssp/random.h header was added in FreeBSD 15
160#if __FreeBSD_version >= 1500500
159161#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
160162#include <ssp/random.h>
161163#endif
164#endif
162165
163166#endif /* _KERNEL */
164167
lib/libc/include/generic-freebsd/sys/select.h+3
......@@ -49,11 +49,14 @@ typedef __fd_mask fd_mask;
4949typedef __sigset_t sigset_t;
5050#endif
5151
52// zig patch: ssp/ssp.h header and __SSP_FORTIFY_LEVEL were added in FreeBSD 15
53#if __FreeBSD_version >= 1500500
5254#if !defined(_KERNEL) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
5355#include <ssp/ssp.h>
5456#else
5557#define __SSP_FORTIFY_LEVEL 0
5658#endif
59#endif
5760
5861/*
5962 * Select uses bit masks of file descriptors in longs. These macros
lib/libc/include/generic-freebsd/sys/socket.h+3
......@@ -691,9 +691,12 @@ struct splice {
691691
692692#ifndef _KERNEL
693693
694// zig patch: ssp/socket.h header was added in FreeBSD 15
695#if __FreeBSD_version >= 1500500
694696#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
695697#include <ssp/socket.h>
696698#endif
699#endif
697700
698701#include <sys/cdefs.h>
699702
lib/libc/include/generic-freebsd/sys/uio.h+3
......@@ -101,9 +101,12 @@ int uiomove_object(struct vm_object *obj, off_t obj_size, struct uio *uio);
101101
102102#else /* !_KERNEL */
103103
104// zig patch: ssp/uio.h header was added in FreeBSD 15
105#if __FreeBSD_version >= 1500500
104106#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
105107#include <ssp/uio.h>
106108#endif
109#endif
107110
108111__BEGIN_DECLS
109112ssize_t readv(int, const struct iovec *, int);
lib/libc/include/generic-freebsd/unistd.h+3
......@@ -37,9 +37,12 @@
3737#include <sys/_null.h>
3838#include <sys/_types.h>
3939
40// zig patch: ssp/unistd.h header was added in FreeBSD 15
41#if __FreeBSD_version >= 1500500
4042#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
4143#include <ssp/unistd.h>
4244#endif
45#endif
4346
4447#ifndef _GID_T_DECLARED
4548typedef __gid_t gid_t;
lib/libc/include/generic-freebsd/wchar.h+3
......@@ -112,9 +112,12 @@ __BEGIN_DECLS
112112size_t wcslen(const wchar_t *) __pure;
113113__END_DECLS
114114
115// zig patch: ssp/wchar.h header was added in FreeBSD 15
116#if __FreeBSD_version >= 1500500
115117#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
116118#include <ssp/wchar.h>
117119#endif
120#endif
118121
119122__BEGIN_DECLS
120123wint_t btowc(int);