From nobody Sun May 3 19:59:05 2026 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 4g7wZx5J2Mz6c0xf for ; Sun, 03 May 2026 19:59:05 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g7wZx28hKz426R for ; Sun, 03 May 2026 19:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777838345; 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=FqOvJNbXifPIF+bC/PUVsHHcy2CfYN8cjCVM5d16FI4=; b=KIv5up//xwglsjWV8M4TPpQ5Jy/IsQma/EnO4OWaBZ5ye/dl+rG0IJzDVVxg4VJER2s6aw cbFjX7RBC2HPb5sFSgMhr1qjF8szTTzIb90hldFT9EImEKiR4a4BFMgSe/Wkk+Rc7/IfE9 UA0w/dBxvkSVJY0Qa0mzXISa6Qdlp6T/UmdQQeRxinTFF2XakHTKCAUZJ6I6eJASc1IxQC Q64XnC5ke3DXd57d0jr8Uf3c2deXyWvWEjcURa6uKUGdBEuBhy30ywyHJ8+lKY7tjnAkdx lEiB4euvyAF7AM+zJPtP1Ycj6Iku1DBrCcHWxnRzWuB9vCGf888oiyWCMDTqrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777838345; a=rsa-sha256; cv=none; b=GLXE7pwcK1dl4piyF/rs+93R7ahAIHIUTl4wzr0Z1mENdzpdseHIS0Wq/b9RFBHksEtjS9 N2v63LG9NfhsgMRiRJFVLXmP6WuxwdMcdPh49YlDhKPky8sCWmZ1SMK9IHdemggvwVmr/f 4laZhrvZjxNBqzfoEdewnDVVuDBaZ3OFzd2uRnxciyz3KgBDnYp21pfyQlv+8NIOfviKaO PBT1dCF7BbdL47K/dO0uF0+2bK7cR+HqanRds2OGYrNChsBsTVYKpnL5nr7F9KInvo/hIJ i6q+aHNTO8T96zWebXKdDdiXc9z0ua6Qkn60QsIg3cbNtn3jy717fAYE7brYig== 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=1777838345; 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=FqOvJNbXifPIF+bC/PUVsHHcy2CfYN8cjCVM5d16FI4=; b=NM/Zxn3MPQlwxkLuXz0ePtwQEV9o3IoAX0ilssIrMZJQixDB+QoqsaHnCvzW2VyExdT6ex i8YJJI6Y6bKwzUYI6motBCxifAkiZuZwBJwQgfGhwla4uwvm/CkyJHf1C64o53zCP2H9L1 9Y/KNIC9wHqGDxX7Ug/r8gKAO/gidBvCkNE+SZXOqp8cE62DMRsykzjt9sG8n+Djn+1x1l 5kfKuX++V8DzwETHMyNr/sHzJSXXl5zAwFG2ys/lu6KO/U9pyckFfFPMpu1nfCHa6MzO6U RWZTg9sSNcE7JUQE/pYlNeIfHyc5e5dmOwW95+pDVQeiiyRRTQzXdUQhBTOIgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g7wZx18S8znK0 for ; Sun, 03 May 2026 19:59:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4061a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 03 May 2026 19:59:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ae6a13deb8e3 - main - libc: add freadlink(3) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae6a13deb8e33a52188643e09171207e1d7171e8 Auto-Submitted: auto-generated Date: Sun, 03 May 2026 19:59:05 +0000 Message-Id: <69f7a909.4061a.41661e22@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ae6a13deb8e33a52188643e09171207e1d7171e8 commit ae6a13deb8e33a52188643e09171207e1d7171e8 Author: Konstantin Belousov AuthorDate: 2026-04-12 08:56:26 +0000 Commit: Konstantin Belousov CommitDate: 2026-05-03 19:58:36 +0000 libc: add freadlink(3) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D56365 --- include/unistd.h | 1 + lib/libc/gen/Makefile.inc | 1 + lib/libc/gen/Symbol.map | 1 + lib/libc/gen/freadlink.c | 16 ++++++++++++++++ 4 files changed, 19 insertions(+) diff --git a/include/unistd.h b/include/unistd.h index 797eac4c364d..290bcce6a0b3 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -518,6 +518,7 @@ int execvpe(const char *, char * const *, char * const *); int feature_present(const char *); int fchroot(int); char *fflagstostr(u_long); +ssize_t freadlink(int fd, char *buf, size_t bufsize); int getdomainname(char *, int); int getentropy(void *, size_t); int getgrouplist(const char *, gid_t, gid_t *, int *); diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index c31f789fd1d1..18a68902f50a 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -56,6 +56,7 @@ SRCS+= \ fmtmsg.c \ fnmatch.c \ fpclassify.c \ + freadlink.c \ frexp.c \ fstab.c \ ftok.c \ diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 60f34b3a1923..4d22251f7ec5 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -475,6 +475,7 @@ FBSD_1.8 { }; FBSD_1.9 { + freadlink; posix_spawn_file_actions_addchdir; posix_spawn_file_actions_addfchdir; posix_spawnattr_getexecfd_np; diff --git a/lib/libc/gen/freadlink.c b/lib/libc/gen/freadlink.c new file mode 100644 index 000000000000..e1ed7aba6c06 --- /dev/null +++ b/lib/libc/gen/freadlink.c @@ -0,0 +1,16 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2026 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + */ + +#include + +ssize_t +freadlink(int fd, char *buf, size_t bufsize) +{ + return (readlinkat(fd, "", buf, bufsize)); +}