From nobody Tue Apr 16 20:13:03 2024 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 4VJwFr06Tzz5H0Xq; Tue, 16 Apr 2024 20:13:04 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VJwFq6C4Kz4tjT; Tue, 16 Apr 2024 20:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713298383; 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=OQXE2cDJha6ifDQp1VwJnRNl3Es9G8AO9pXaYuZ/hK4=; b=MXxuo0K+nyxD1S7Vo+z5qyvjyriqMmi8IYJUotaGBc02q2LjTZ1UZm6EPbyiuEoGggkWIC DfDYuEb9BP1u19HPbnL/rxDxVTBHrl11iBq26odc3+moBiZl0qKzdztV6Tvcawoa8xqT+N BB+kxNWkua+dQbyKJM+eprYAmBHDHuyCIV0mOdMW1PMZB5QByHVzlY+3o6hYPUO9W9gGEp ++klM2f7Q8ysRuh2RBdOoi9DqIvtIXAyHn39dWY5Zjg/bJNLVhqvdm1Q2wLC8OUxUh9lmx X6AScVTemW93ckuz3jBGFejTp5UDlEDJeAPG6lumiF2KCY5t8o7p4TOS8UQELQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713298383; a=rsa-sha256; cv=none; b=mGwiFkm2hXezmKctEGRj1HAgru+5qLoahreI4UreuD8ZDV1Zp2hpLJwgfnZ8f/1fAHAA9c Wu75u+KB4Tveodm+wDM7UGDpdlbpVgJ7wKJrcK9fRDLWzkR34A4fVCEvAc/pHPzC4HzJVM vTKng2LSZbIin2PnlUiFq4oiKLcfWl314Vs8ykXL2htkeQ5rww6K5buEdvj1fkpS5OFx5n v6TZMmrOxXbyt4vIk7/QnTGPhAOZ4IcjSixjVUpR1Idfz+4Jmn8GBmHwnQsSWq6Ju1yUOk 4EpHektDRHNw5FcovNLZVNMBbLzmBTbBKwlBZ9WRId6/QvywQB4fWUg9riyvPA== 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=1713298383; 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=OQXE2cDJha6ifDQp1VwJnRNl3Es9G8AO9pXaYuZ/hK4=; b=cWRaloQOCf6qZzRgALI5WE+E1lKEglGKyOOrQvOh7CpuVyldolQncmsV7AGDGzJDW6054u lM0nI3I8+7X/gXHnm0HaWvdL4xbCo+Yj2JjXpJOaKQAEdQjg5l5USFwGKnsPZS8yY1f4xQ XNOu4NdOnPuWUft0TvP77RO8bUwPwLAzg3Cfge/TfUgnP/N3cuHWoWxtyHp1dKJOxhuhGg jSDionfFbGmiiVCa/12g0KJaDKvR7p9iUyo/0zNDzECbkW7nkOXP/3Z7MNmyBtgJcdBSWv ZyYkP9nyCXm3Tf+f1qXg+FFU6gtrXQ3ozfCn39zjOdoLbjEwUnVCwHMYIJ+HEw== 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 4VJwFq5pwDzxPP; Tue, 16 Apr 2024 20:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43GKD3kq038629; Tue, 16 Apr 2024 20:13:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43GKD36t038626; Tue, 16 Apr 2024 20:13:03 GMT (envelope-from git) Date: Tue, 16 Apr 2024 20:13:03 GMT Message-Id: <202404162013.43GKD36t038626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 67d21468bfaf - stable/14 - loader: For the mini-stdio we have for lua, #define them to something else 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 67d21468bfafc489194ee2b88180baefd2b83a2a Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=67d21468bfafc489194ee2b88180baefd2b83a2a commit 67d21468bfafc489194ee2b88180baefd2b83a2a Author: Warner Losh AuthorDate: 2024-02-21 03:31:50 +0000 Commit: Warner Losh CommitDate: 2024-04-16 19:54:25 +0000 loader: For the mini-stdio we have for lua, #define them to something else To make it easier to port lua and some of the lua modules, we have a series of routines to implement the stdio routines, even though we don't normally implement them in the boot loader. Add a comment to this effect. Also, some tools, like sanitizers and static analysis tools, make unwarranted assumptions about these, so #define them to a different name so they stop. Sponsored by: Netflix (cherry picked from commit 9a5aaa97cbae024f90bb626f78c3dbde28653c58) --- stand/liblua/lstd.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/stand/liblua/lstd.h b/stand/liblua/lstd.h index 05a8b8843d9c..ce3aef4bc5fc 100644 --- a/stand/liblua/lstd.h +++ b/stand/liblua/lstd.h @@ -34,6 +34,15 @@ #include #include +/* + * Mini stdio FILE and DIR routines. These are the minimal routines needed by + * the lfs module and lua's base code. We define them minimally here so we don't + * have to modify lua on every import. Further, since they aren't completely + * standard, we #define them to other names so they don't conflict with other + * tooling that makes assumptions about these routines that might not be, in + * fact, correct. + */ + typedef struct FILE { int fd; @@ -46,6 +55,18 @@ typedef struct DIR int fd; } DIR; +#define fopen lua_loader_fopen +#define freopen lua_loader_freopen +#define fread lua_loader_fread +#define fwrite lua_loader_fwrite +#define fclose lua_loader_fclose +#define ferror lua_loader_ferror +#define feof lua_loader_feof +#define getc lua_loader_getc +#define opendir lua_loader_opendir +#define fdopendir lua_loader_fdopendir +#define closedir lua_loader_closedir + FILE *fopen(const char *filename, const char *mode); FILE *freopen( const char *filename, const char *mode, FILE *stream); size_t fread(void *ptr, size_t size, size_t count, FILE *stream);