[前][次][番号順一覧][スレッド一覧]

ruby-changes:69692

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Thu, 11 Nov 2021 11:46:18 +0900 (JST)
Subject: [ruby-changes:69692] f5dcecf345 (master): rb_file_size: add doxygen

https://git.ruby-lang.org/ruby.git/commit/?id=f5dcecf345

From f5dcecf3456e5f52aa979cc2a59c5dc7b398e123 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Thu, 11 Nov 2021 11:34:09 +0900
Subject: rb_file_size: add doxygen

Must not be a bad idea to improve documents. [ci skip]
---
 include/ruby/internal/intern/file.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/ruby/internal/intern/file.h b/include/ruby/internal/intern/file.h
index 43f1fd7c602..7a6af998725 100644
--- a/include/ruby/internal/intern/file.h
+++ b/include/ruby/internal/intern/file.h
@@ -187,6 +187,23 @@ RBIMPL_ATTR_PURE() https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/intern/file.h#L187
  */
 int rb_is_absolute_path(const char *path);
 
+/**
+ * Queries  the file  size  of the  given file.   Because  this function  calls
+ * `fstat(2)`  internally, it  is  a failure  to  pass a  closed  file to  this
+ * function.
+ *
+ * This function flushes the passed file's buffer if any.  Can take time.
+ *
+ * @param[in]   file                 A file object.
+ * @exception   rb_eFrozenError      `file` is frozen.
+ * @exception   rb_eIOError          `file` is closed.
+ * @exception   rb_eSystemCallError  Permission denied etc.
+ * @return      The size of the passed file.
+ * @note        Passing a non-regular file such as a UNIX domain socket to this
+ *              function  is   not  a  failure.    But  the  return   value  is
+ *              unpredictable.  POSIX's `<sys/stat.h>` states  that "the use of
+ *              this field is unspecified" then.
+ */
 off_t rb_file_size(VALUE file);
 
 RBIMPL_SYMBOL_EXPORT_END()
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]