From nobody Wed Mar 19 23:45:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZJ51742pzz5qv1p; Wed, 19 Mar 2025 23:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZJ5173CbGz3wFy; Wed, 19 Mar 2025 23:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742427915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZUjlyKNdCrN/UkUNW+Bfv4BIrPWB9GyBZgkdEs7KvU=; b=eJhwTjD982d2y0FE0B+JElRo6LDBWzIuDAFs/l/3sBqVZdSpdZUCTFdZ7Q+2FrEWoY3SLc PN1AYd+31/ySgqv4bGI3e+x6RMiikwdSGC6UwOBeIZ540891amdtmu/VM5549OGKQ1GXZ4 0qEIMgL9wTVHDBCYzCgJIqh0ToXnBdkA7bqnpEBIVEyq+iiTKM4x+8/4A2CGqK34IMhip2 xWxVBdNK23tqj/71ZLfRo6itgaJdPHY1ciYWUdAadh2IcZhXp6WStvS6rNmqbnhpCxAjFV k8gwIW/F3ZeH/U7GBofZAlx4u1C0a54KaRQ0oaFzRyJfKNftb5xIX1roTAdYfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1742427915; a=rsa-sha256; cv=none; b=Y1GcANDkpmGiavslqdTtXGFvxGkZ5oaFLiSwm7otjDCAfeN66yTPQhxSdh+uxn6aRq3u1u rDPPpAtgYAsFmY+QH8ioA47POzn0V5u3NujDQC/UZxVHudFH5LQDdI6mj1ew+4OGmHMSiw JkQ2YlqhEOS0NeVjPniZC1qYnqTx4T2jP3eSzTU2sQw/WCgGzw2YehN9edTpNaSexcs0Rd 1WYgqpSi94TPleEv5zjgTv8+ZJ2iQzrf5zY19t0QQZVGYNR5LaU2cx/dJiMIXU35CMkAYV hmPa0/1U35c4RNbolmz4L8u3LeL6putlEohTeMatpiIGovEDJ6bIC7sp5NqwLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742427915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZUjlyKNdCrN/UkUNW+Bfv4BIrPWB9GyBZgkdEs7KvU=; b=TibhVDuMbhGMtQJbBT/hO6cVwD9EcfiR3t/Red5S1bEWnOrq1hXqa/nKpy7nam1gWOn4yD qR+Msx4ZqncTs5yAZUo1DfDnMkWXQ00g/Zrr4ApAq8I9dPL3KKO9D0KSsfKBNkVqSiA5g4 2CtrF+sinrMOs7TwMZrbCXBL8M+7oWloMnZSiWzb9waJIkuHgecyQFvGpM/n0CwKQUYe7P H2DS1TjvxTCHpIrR15WFV93UDqrTkyKUQEj8OhHZbILRjRvzmo2HNr+Ot0TpYm/wiNEJ/e SzUjtcVYX8zz8ngEIkfEjE41V2gzJKbutEyGbaDPtkX04+LOkrVmZHAxHZ0y1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZJ5172b7nzhk6; Wed, 19 Mar 2025 23:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 52JNjFgY093049; Wed, 19 Mar 2025 23:45:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 52JNjFxt093046; Wed, 19 Mar 2025 23:45:15 GMT (envelope-from git) Date: Wed, 19 Mar 2025 23:45:15 GMT Message-Id: <202503192345.52JNjFxt093046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stephen Hurd Subject: git: 9d0eea9422d0 - main - Make newly POSIX functions visible List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: shurd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d0eea9422d075c8a6924b33161d2d5abfb4072a Auto-Submitted: auto-generated The branch main has been updated by shurd: URL: https://cgit.FreeBSD.org/src/commit/?id=9d0eea9422d075c8a6924b33161d2d5abfb4072a commit 9d0eea9422d075c8a6924b33161d2d5abfb4072a Author: Stephen Hurd AuthorDate: 2025-03-19 23:45:06 +0000 Commit: Stephen Hurd CommitDate: 2025-03-19 23:45:06 +0000 Make newly POSIX functions visible Some of the POSIX 202405L functions are already in the system, make them visible when appropriate. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47859 --- include/dlfcn.h | 8 +++++++- include/stdlib.h | 13 ++++++++----- include/string.h | 6 +++--- include/time.h | 8 +++++--- include/unistd.h | 16 ++++++++++------ include/wchar.h | 7 +++++-- 6 files changed, 38 insertions(+), 20 deletions(-) diff --git a/include/dlfcn.h b/include/dlfcn.h index 89ec43b332e9..ec4ad14b5091 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -80,6 +80,9 @@ typedef struct dl_info { const char *dli_sname; /* Name of nearest symbol. */ void *dli_saddr; /* Address of nearest symbol. */ } Dl_info; +#if __POSIX_VISIBLE >= 202405 +typedef struct dl_info Dl_info_t; +#endif /*- * The actual type declared by this typedef is immaterial, provided that @@ -119,9 +122,12 @@ char *dlerror(void); void *dlopen(const char *, int); void *dlsym(void * __restrict, const char * __restrict); +#if __POSIX_VISIBLE >= 202405 +int dladdr(const void * __restrict, Dl_info * __restrict); +#endif + #if __BSD_VISIBLE void *fdlopen(int, int); -int dladdr(const void * __restrict, Dl_info * __restrict); dlfunc_t dlfunc(void * __restrict, const char * __restrict); int dlinfo(void * __restrict, int, void * __restrict); void dllockinit(void *_context, diff --git a/include/stdlib.h b/include/stdlib.h index 162031ab393d..449b17fefff5 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -157,7 +157,7 @@ _Noreturn void _Exit(int) __noexcept; /* * If we're in a mode greater than C99, expose C11 functions. */ -#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L +#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L || __POSIX_VISIBLE >= 202405 void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1) __alloc_size(2); int at_quick_exit(void (*)(void)) __noexcept; @@ -236,6 +236,13 @@ int unlockpt(int); int ptsname_r(int, char *, size_t); #endif +#if __POSIX_VISIBLE >= 202405 +void qsort_r(void *, size_t, size_t, + int (*)(const void *, const void *, void *), void *); +void *reallocarray(void *, size_t, size_t) __result_use_check + __alloc_size2(2, 3); +#endif + #if __BSD_VISIBLE extern const char *malloc_conf; extern void (*malloc_message)(void *, const char *); @@ -305,12 +312,8 @@ int mergesort_b(void *, size_t, size_t, int (^)(const void *, const void *)); int mkostemp(char *, int); int mkostemps(char *, int, int); int mkostempsat(int, char *, int, int); -void qsort_r(void *, size_t, size_t, - int (*)(const void *, const void *, void *), void *); int radixsort(const unsigned char **, int, const unsigned char *, unsigned); -void *reallocarray(void *, size_t, size_t) __result_use_check - __alloc_size2(2, 3); void *reallocf(void *, size_t) __result_use_check __alloc_size(2); int rpmatch(const char *); char *secure_getenv(const char *); diff --git a/include/string.h b/include/string.h index a3fa96ebb449..3deca63bd71a 100644 --- a/include/string.h +++ b/include/string.h @@ -63,8 +63,8 @@ void *memrchr(const void *, int, size_t) __pure; #endif int memcmp(const void *, const void *, size_t) __pure; void *(memcpy)(void * __restrict, const void * __restrict, size_t); -#if __BSD_VISIBLE -void *memmem(const void *, size_t, const void *, size_t) __pure; +#if __POSIX_VISIBLE >= 202405 +void *(memmem)(const void *, size_t, const void *, size_t) __pure; #endif void *(memmove)(void *, const void *, size_t); #if __BSD_VISIBLE @@ -98,7 +98,7 @@ char *strerror(int); #if __POSIX_VISIBLE >= 200112 int strerror_r(int, char *, size_t); #endif -#if __BSD_VISIBLE +#if __POSIX_VISIBLE >= 202405 size_t (strlcat)(char * __restrict, const char * __restrict, size_t); size_t (strlcpy)(char * __restrict, const char * __restrict, size_t); #endif diff --git a/include/time.h b/include/time.h index 89a76ca5fd93..f85d9c40715a 100644 --- a/include/time.h +++ b/include/time.h @@ -180,15 +180,17 @@ time_t posix2time(time_t t); #include #endif -#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2011 || \ +#if __ISO_C_VISIBLE >= 2011 || __POSIX_VISIBLE >= 202405 \ (defined(__cplusplus) && __cplusplus >= 201703) #include /* ISO/IEC 9899:2011 7.27.2.5 The timespec_get function */ #define TIME_UTC 1 /* time elapsed since epoch */ -int timespec_get(struct timespec *ts, int base); -#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2023 +#if __ISO_C_VISIBLE >= 2023 || __POSIX_VISIBLE >= 202405 /* ISO/IEC 9899:2024 7.29.1 Components of time */ #define TIME_MONOTONIC 2 /* monotonic time */ +#endif +int timespec_get(struct timespec *ts, int base); +#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2023 /* ISO/IEC 9899:2024 7.29.2.7 The timespec_getres function */ int timespec_getres(struct timespec *, int); #endif diff --git a/include/unistd.h b/include/unistd.h index 8574b2ba9915..3a4e1be192d9 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -483,6 +483,16 @@ int usleep(useconds_t); pid_t vfork(void) __returns_twice; #endif +/* 1003.1-2024 */ +#if __POSIX_VISIBLE >= 202405 +pid_t _Fork(void); +int getentropy(void *, size_t); +int getresgid(gid_t *, gid_t *, gid_t *); +int getresuid(uid_t *, uid_t *, uid_t *); +int setresgid(gid_t, gid_t, gid_t); +int setresuid(uid_t, uid_t, uid_t); +#endif + #if __BSD_VISIBLE struct timeval; /* select(2) */ @@ -510,14 +520,11 @@ int feature_present(const char *); int fchroot(int); char *fflagstostr(u_long); int getdomainname(char *, int); -int getentropy(void *, size_t); int getgrouplist(const char *, gid_t, gid_t *, int *); int getloginclass(char *, size_t); mode_t getmode(const void *, mode_t); int getosreldate(void); int getpeereid(int, uid_t *, gid_t *); -int getresgid(gid_t *, gid_t *, gid_t *); -int getresuid(uid_t *, uid_t *, uid_t *); char *getusershell(void); int initgroups(const char *, gid_t); int iruserok(unsigned long, int, const char *, const char *); @@ -575,8 +582,6 @@ void *setmode(const char *); int setpgrp(pid_t, pid_t); /* obsoleted by setpgid() */ void setproctitle(const char *_fmt, ...) __printf0like(1, 2); void setproctitle_fast(const char *_fmt, ...) __printf0like(1, 2); -int setresgid(gid_t, gid_t, gid_t); -int setresuid(uid_t, uid_t, uid_t); int setrgid(gid_t); int setruid(uid_t); void setusershell(void); @@ -589,7 +594,6 @@ int undelete(const char *); int unwhiteout(const char *); void *valloc(size_t); /* obsoleted by malloc() */ int funlinkat(int, const char *, int, int); -pid_t _Fork(void); #ifndef _OPTRESET_DECLARED #define _OPTRESET_DECLARED diff --git a/include/wchar.h b/include/wchar.h index e4b037c9b16f..a8c016c42faf 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -235,12 +235,15 @@ size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t, size_t, mbstate_t * __restrict); #endif -#if __BSD_VISIBLE -wchar_t *fgetwln(FILE * __restrict, size_t * __restrict); +#if __POSIX_VISIBLE >= 202405 size_t wcslcat(wchar_t *, const wchar_t *, size_t); size_t wcslcpy(wchar_t *, const wchar_t *, size_t); #endif +#if __BSD_VISIBLE +wchar_t *fgetwln(FILE * __restrict, size_t * __restrict); +#endif + #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) #include #endif