[vlc-devel] [PATCH 08/19] interrupt: move documentation to vlc_interrupt.h

Kartik Ohri kartikohri13 at gmail.com
Thu Jul 23 15:18:23 CEST 2020


From: rustyc <amcap1712 at gmail.com>

Move documentation for VLC API methods vlc_readv_i11e,
vlc_writev_i11e, vlc_read_i11e and vlc_write_i11e from
src/misc/interrupt.c to include/vlc_interrupt.h.
---
 include/vlc_interrupt.h | 25 +++++++++++++++++++++++++
 src/misc/interrupt.c    | 22 ----------------------
 2 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/include/vlc_interrupt.h b/include/vlc_interrupt.h
index 5527de3213..cd7380051c 100644
--- a/include/vlc_interrupt.h
+++ b/include/vlc_interrupt.h
@@ -108,9 +108,34 @@ static inline int vlc_msleep_i11e(vlc_tick_t delay)
  */
 VLC_API int vlc_poll_i11e(struct pollfd *, unsigned, int);
 
+/**
+ * Wrapper for readv() that returns the EINTR error upon VLC I/O interruption.
+ * @warning This function ignores the non-blocking file flag.
+ */
 VLC_API ssize_t vlc_readv_i11e(int fd, struct iovec *, int);
+
+/**
+ * Wrapper for writev() that returns the EINTR error upon VLC I/O interruption.
+ *
+ * @note Like writev(), once some but not all bytes are written, the function
+ * might wait for write completion, regardless of signals and interruptions.
+ * @warning This function ignores the non-blocking file flag.
+ */
 VLC_API ssize_t vlc_writev_i11e(int fd, const struct iovec *, int);
+
+/**
+ * Wrapper for read() that returns the EINTR error upon VLC I/O interruption.
+ * @warning This function ignores the non-blocking file flag.
+ */
 VLC_API ssize_t vlc_read_i11e(int fd, void *, size_t);
+
+/**
+ * Wrapper for write() that returns the EINTR error upon VLC I/O interruption.
+ *
+ * @note Like write(), once some but not all bytes are written, the function
+ * might wait for write completion, regardless of signals and interruptions.
+ * @warning This function ignores the non-blocking file flag.
+ */
 VLC_API ssize_t vlc_write_i11e(int fd, const void *, size_t);
 
 VLC_API ssize_t vlc_recvmsg_i11e(int fd, struct msghdr *, int flags);
diff --git a/src/misc/interrupt.c b/src/misc/interrupt.c
index 972c01ebf5..0161dbd29e 100644
--- a/src/misc/interrupt.c
+++ b/src/misc/interrupt.c
@@ -407,10 +407,6 @@ int vlc_poll_i11e(struct pollfd *fds, unsigned nfds, int timeout)
  * block in spite of an interruption. This should never happen in practice.
  */
 
-/**
- * Wrapper for readv() that returns the EINTR error upon VLC I/O interruption.
- * @warning This function ignores the non-blocking file flag.
- */
 ssize_t vlc_readv_i11e(int fd, struct iovec *iov, int count)
 {
     struct pollfd ufd;
@@ -423,13 +419,6 @@ ssize_t vlc_readv_i11e(int fd, struct iovec *iov, int count)
     return readv(fd, iov, count);
 }
 
-/**
- * Wrapper for writev() that returns the EINTR error upon VLC I/O interruption.
- *
- * @note Like writev(), once some but not all bytes are written, the function
- * might wait for write completion, regardless of signals and interruptions.
- * @warning This function ignores the non-blocking file flag.
- */
 ssize_t vlc_writev_i11e(int fd, const struct iovec *iov, int count)
 {
     struct pollfd ufd;
@@ -442,23 +431,12 @@ ssize_t vlc_writev_i11e(int fd, const struct iovec *iov, int count)
     return writev(fd, iov, count);
 }
 
-/**
- * Wrapper for read() that returns the EINTR error upon VLC I/O interruption.
- * @warning This function ignores the non-blocking file flag.
- */
 ssize_t vlc_read_i11e(int fd, void *buf, size_t count)
 {
     struct iovec iov = { .iov_base = buf, .iov_len = count };
     return vlc_readv_i11e(fd, &iov, 1);
 }
 
-/**
- * Wrapper for write() that returns the EINTR error upon VLC I/O interruption.
- *
- * @note Like write(), once some but not all bytes are written, the function
- * might wait for write completion, regardless of signals and interruptions.
- * @warning This function ignores the non-blocking file flag.
- */
 ssize_t vlc_write_i11e(int fd, const void *buf, size_t count)
 {
     struct iovec iov = { .iov_base = (void*)buf, .iov_len = count };
-- 
2.25.1



More information about the vlc-devel mailing list