public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Sergey Bugaev <bugaevc@gmail.com>
To: libc-alpha@sourceware.org
Cc: bug-hurd@gnu.org, Samuel Thibault <samuel.thibault@gnu.org>
Subject: [PATCH 2/3] hurd: Mark error functions as __COLD
Date: Sat, 29 Apr 2023 16:12:22 +0300	[thread overview]
Message-ID: <20230429131223.2507236-2-bugaevc@gmail.com> (raw)
In-Reply-To: <20230429131223.2507236-1-bugaevc@gmail.com>

This should hopefully hint the compiler that they are unlikely
to be called.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
 hurd/hurd.h    | 2 +-
 hurd/hurd/fd.h | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hurd/hurd.h b/hurd/hurd.h
index eca4abb7..06f00e93 100644
--- a/hurd/hurd.h
+++ b/hurd/hurd.h
@@ -48,7 +48,7 @@
 #define _HURD_H_EXTERN_INLINE __extern_inline
 #endif
 
-extern int __hurd_fail (error_t err);
+extern int __hurd_fail (error_t err) __COLD;
 
 #ifdef __USE_EXTERN_INLINES
 _HURD_H_EXTERN_INLINE int
diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h
index f6139544..241797bf 100644
--- a/hurd/hurd/fd.h
+++ b/hurd/hurd/fd.h
@@ -149,7 +149,7 @@ _hurd_fd_get (int fd)
 /* Check if ERR should generate a signal.
    Returns the signal to take, or zero if none.  */
 
-extern int _hurd_fd_error_signal (error_t err);
+extern int _hurd_fd_error_signal (error_t err) __COLD;
 
 #ifdef __USE_EXTERN_INLINES
 _HURD_FD_H_EXTERN_INLINE int
@@ -174,7 +174,7 @@ _hurd_fd_error_signal (error_t err)
    always use this function to handle errors from RPCs made on file
    descriptor ports.  Some errors are translated into signals.  */
 
-extern error_t _hurd_fd_error (int fd, error_t err);
+extern error_t _hurd_fd_error (int fd, error_t err) __COLD;
 
 #ifdef __USE_EXTERN_INLINES
 _HURD_FD_H_EXTERN_INLINE error_t
@@ -194,7 +194,7 @@ _hurd_fd_error (int fd, error_t err)
 /* Handle error code ERR from an RPC on file descriptor FD's port.
    Set `errno' to the appropriate error code, and always return -1.  */
 
-extern int __hurd_dfail (int fd, error_t err);
+extern int __hurd_dfail (int fd, error_t err) __COLD;
 
 #ifdef __USE_EXTERN_INLINES
 _HURD_FD_H_EXTERN_INLINE int
@@ -208,7 +208,7 @@ __hurd_dfail (int fd, error_t err)
 /* Likewise, but do not raise SIGPIPE on EPIPE if flags contain
    MSG_NOSIGNAL.  */
 
-extern int __hurd_sockfail (int fd, int flags, error_t err);
+extern int __hurd_sockfail (int fd, int flags, error_t err) __COLD;
 
 #ifdef __USE_EXTERN_INLINES
 _HURD_FD_H_EXTERN_INLINE int
-- 
2.40.1


  reply	other threads:[~2023-04-29 13:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-29 13:12 [PATCH 1/3] cdefs.h: Define __COLD Sergey Bugaev
2023-04-29 13:12 ` Sergey Bugaev [this message]
2023-04-29 15:04   ` [PATCH 2/3] hurd: Mark error functions as __COLD Samuel Thibault
2023-04-29 13:12 ` [PATCH 3/3] Mark various cold " Sergey Bugaev
2023-04-29 15:06   ` Samuel Thibault
2023-05-01 16:15     ` Siddhesh Poyarekar
2023-05-01 17:38       ` Samuel Thibault
2023-05-01 21:52   ` Cristian Rodríguez
2023-05-01 21:54     ` Samuel Thibault
2023-05-02  6:45       ` Sergey Bugaev
2023-04-29 13:20 ` [PATCH] cdefs.h: Define __COLD Sergey Bugaev
2023-04-29 15:02   ` Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230429131223.2507236-2-bugaevc@gmail.com \
    --to=bugaevc@gmail.com \
    --cc=bug-hurd@gnu.org \
    --cc=libc-alpha@sourceware.org \
    --cc=samuel.thibault@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).