Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iLRaa-0007Nv-6D for mharc-grub-devel@gnu.org; Fri, 18 Oct 2019 08:42:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42934) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLRaV-0007Jn-52 for grub-devel@gnu.org; Fri, 18 Oct 2019 08:42:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLRaT-0006Xl-CU for grub-devel@gnu.org; Fri, 18 Oct 2019 08:42:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43284) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLRaP-0006WO-Il for grub-devel@gnu.org; Fri, 18 Oct 2019 08:42:31 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2ED1C057F31 for ; Fri, 18 Oct 2019 12:42:26 +0000 (UTC) Received: by mail-wr1-f72.google.com with SMTP id e25so2035071wra.9 for ; Fri, 18 Oct 2019 05:42:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FXVs3k94IujlP3YoQYn2Bzqcp9rE9kVwPe50wg95KF0=; b=BlbqjrLejqTfUTp1RspY0MwXNdFj+T+0/m5dVb8BWI2f7UuFUh0yrOl2eB5+/FjVEv QSU9hKp7p72iBD7uopN7tq2Xz2gpMyUCE5VYMGAvS0eH08Hox7yimoW8o4NTQqz2kSRD gTmBDiRtd2LkPlfteCfIwLYk4gCEn1rRTgi23k7kV9Eki2CoCcAK55u73KUuBcfsWX9t ryGAMXolSZ/sqijvzwCnYp56QEY/xEKgSZkYM9iwP1LN3P3grVvYkIj8s+Gh7MpIE30/ C2AW7o1JMf57m2kn7DuR3Lj9yesv/8jZpUf4UqWfQn7i3WAMaUUx5HzdpLDpAq9xlQbw fhig== X-Gm-Message-State: APjAAAX9olptlDVIM02BxiytyJfJKXnWbZtibbaf6GZnMDRjcWcXLF95 b4gzHr3R66LcYIxajNZglBC0nJbwaF6CTjocLugX+IIiaP4slmtxAVZGojwAh7+otXCZL5dMov3 z6hx5Ec85Yb8= X-Received: by 2002:a05:600c:2196:: with SMTP id e22mr1676920wme.79.1571402544832; Fri, 18 Oct 2019 05:42:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwB4eiVGwfA795PfEQDNyvvdZBilXUok67EVaQIOjB11nd3RQWwxqxnwaFvvbJkxzKc+pEW7g== X-Received: by 2002:a05:600c:2196:: with SMTP id e22mr1676904wme.79.1571402544593; Fri, 18 Oct 2019 05:42:24 -0700 (PDT) Received: from minerva.redhat.com ([90.168.169.92]) by smtp.gmail.com with ESMTPSA id c4sm5348400wru.31.2019.10.18.05.42.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 05:42:23 -0700 (PDT) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Peter Jones , Adam Jackson , Javier Martinez Canillas Subject: [PATCH 1/2] Add grub_util_readlink() Date: Fri, 18 Oct 2019 14:42:20 +0200 Message-Id: <20191018124221.15934-1-javierm@redhat.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Oct 2019 12:42:37 -0000 From: Peter Jones Add a grub_util_readlink() helper function. Signed-off-by: Peter Jones Reviewed-by: Adam Jackson Signed-off-by: Javier Martinez Canillas --- grub-core/osdep/windows/hostdisk.c | 6 ++++++ include/grub/osdep/hostfile_aros.h | 6 ++++++ include/grub/osdep/hostfile_unix.h | 6 ++++++ include/grub/osdep/hostfile_windows.h | 2 ++ 4 files changed, 20 insertions(+) diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows= /hostdisk.c index 355100789a7..87a106c9b82 100644 --- a/grub-core/osdep/windows/hostdisk.c +++ b/grub-core/osdep/windows/hostdisk.c @@ -365,6 +365,12 @@ grub_util_mkdir (const char *dir) free (windows_name); } =20 +ssize_t +grub_util_readlink (const char *name, char *buf, size_t bufsize) +{ + return readlink(name, buf, bufsize); +} + int grub_util_rename (const char *from, const char *to) { diff --git a/include/grub/osdep/hostfile_aros.h b/include/grub/osdep/host= file_aros.h index a059c0fa40a..161fbb7bdfd 100644 --- a/include/grub/osdep/hostfile_aros.h +++ b/include/grub/osdep/hostfile_aros.h @@ -68,6 +68,12 @@ grub_util_rename (const char *from, const char *to) return rename (from, to); } =20 +static inline ssize_t +grub_util_readlink (const char *name, char *buf, size_t bufsize) +{ + return readlink(name, buf, bufsize); +} + #define grub_util_mkdir(a) mkdir ((a), 0755) =20 struct grub_util_fd diff --git a/include/grub/osdep/hostfile_unix.h b/include/grub/osdep/host= file_unix.h index 9ffe46fa3ca..17cd3aa8b30 100644 --- a/include/grub/osdep/hostfile_unix.h +++ b/include/grub/osdep/hostfile_unix.h @@ -71,6 +71,12 @@ grub_util_rename (const char *from, const char *to) return rename (from, to); } =20 +static inline ssize_t +grub_util_readlink (const char *name, char *buf, size_t bufsize) +{ + return readlink(name, buf, bufsize); +} + #define grub_util_mkdir(a) mkdir ((a), 0755) =20 #if defined (__NetBSD__) diff --git a/include/grub/osdep/hostfile_windows.h b/include/grub/osdep/h= ostfile_windows.h index bf6451b6db4..8c92d0591bb 100644 --- a/include/grub/osdep/hostfile_windows.h +++ b/include/grub/osdep/hostfile_windows.h @@ -41,6 +41,8 @@ typedef struct grub_util_fd_dir *grub_util_fd_dir_t; =20 int grub_util_rename (const char *from, const char *to); +ssize_t +grub_util_readlink (const char *name, char *buf, size_t bufsize); int grub_util_unlink (const char *name); void --=20 2.21.0