From: Lawrence S. <ljs...@us...> - 2017-01-02 20:51:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via a0c96f374d6afe0afd1487d1cf88b6b8c138e310 (commit) via f61025745b30a1d5cc6f7b38e6ef8863b493dee6 (commit) from ca3a51cbc21df2306c2df3f03ad111c793b6b110 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a0c96f374d6afe0afd1487d1cf88b6b8c138e310 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 2 15:50:08 2017 -0500 Include <sys/uio.h> from <sys/socket.h>. Per POSIX: "The <sys/socket.h> header shall define the iovec structure as described in <sys/uio.h>." commit f61025745b30a1d5cc6f7b38e6ef8863b493dee6 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 2 15:16:20 2017 -0500 Move <kos/iovec.h> to <sys/uio.h>, as specified by POSIX. ----------------------------------------------------------------------- Summary of changes: include/kos/iovec.h | 24 ++++-------------------- include/sys/_types.h | 5 +++++ include/sys/socket.h | 3 ++- include/sys/uio.h | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 21 deletions(-) create mode 100644 include/sys/uio.h diff --git a/include/kos/iovec.h b/include/kos/iovec.h index cd0b54b..b835b38 100644 --- a/include/kos/iovec.h +++ b/include/kos/iovec.h @@ -1,35 +1,19 @@ /* KallistiOS ##version## kos/iovec.h - Copyright (C)2001 Dan Potter + Copyright (C) 2001 Dan Potter */ /** \file kos/iovec.h - \brief Scatter/Gather arrays. + \brief Deprecated header file for I/O scatter/gather arrays. - This file contains the definition of a scatter/gather array. - - \author Dan Potter + See <sys/uio.h> for what used to be here. */ #ifndef __KOS_IOVEC_H #define __KOS_IOVEC_H -#include <sys/cdefs.h> -__BEGIN_DECLS - -#include <stddef.h> - -/** \brief Scatter/Gather array. - \headerfile kos/iovec.h -*/ -typedef struct iovec { - char *iov_base; /**< \brief Base address */ - size_t iov_len; /**< \brief Length */ -} iovec_t; - -__END_DECLS +#include <sys/uio.h> #endif /* __KOS_IOVEC_H */ - diff --git a/include/sys/_types.h b/include/sys/_types.h index db252d9..69cb8d0 100644 --- a/include/sys/_types.h +++ b/include/sys/_types.h @@ -122,6 +122,11 @@ typedef void *_iconv_t; #define AT_REMOVEDIR 8 #endif +#ifndef IOV_MAX +/** \brief Maximum length of an iovec, in elements. */ +#define IOV_MAX 1024 +#endif + // And this is for old KOS source compatability. #include <arch/types.h> diff --git a/include/sys/socket.h b/include/sys/socket.h index 04fdfa7..fba088f 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -1,7 +1,7 @@ /* KallistiOS ##version## sys/socket.h - Copyright (C)2006, 2010, 2012 Lawrence Sebald + Copyright (C) 2006, 2010, 2012, 2017 Lawrence Sebald */ @@ -23,6 +23,7 @@ #include <sys/cdefs.h> #include <sys/types.h> +#include <sys/uio.h> __BEGIN_DECLS diff --git a/include/sys/uio.h b/include/sys/uio.h new file mode 100644 index 0000000..1086559 --- /dev/null +++ b/include/sys/uio.h @@ -0,0 +1,39 @@ +/* KallistiOS ##version## + + sys/uio.h + Copyright (C) 2017 Lawrence Sebald + +*/ + +/** \file sys/uio.h + \brief Header for vector I/O. + + This file contains definitions for vector I/O operations, as specified by + the POSIX 2008 specification. Full vector-based I/O is not supported for + file operations, but the stuff in here is still useful elsewhere. + + \author Lawrence Sebald +*/ + +#ifndef __SYS_UIO_H +#define __SYS_UIO_H + +#include <sys/cdefs.h> +#include <sys/types.h> + +__BEGIN_DECLS + +/** \brief I/O vector structure + \headerfile sys/iovec.h +*/ +struct iovec { + /** \brief Base address of memory for I/O. */ + void * iov_base; + /** \brief Size of memory pointed to by iov_base. */ + size_t iov_len; +}; + +/** \brief Old alias for the maximum length of an iovec. */ +#define UIO_MAXIOV IOV_MAX + +#endif /* __SYS_UIO_H */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |