| 870 | @subsection readv - Vectored read from a file |
| 871 | |
| 872 | @findex readv |
| 873 | @cindex vectored read from a file |
| 874 | |
| 875 | @subheading CALLING SEQUENCE: |
| 876 | |
| 877 | @ifset is-C |
| 878 | @example |
| 879 | #include <sys/uio.h> |
| 880 | |
| 881 | ssize_t readv( |
| 882 | int fd, |
| 883 | const struct iovec *iov, |
| 884 | int iovcnt |
| 885 | ); |
| 886 | @end example |
| 887 | @end ifset |
| 888 | |
| 889 | @ifset is-Ada |
| 890 | @end ifset |
| 891 | |
| 892 | @subheading STATUS CODES: |
| 893 | |
| 894 | In addition to the errors detected by |
| 895 | @code{Input and Output Primitives Manager read - Reads from a file, read()}, |
| 896 | this routine may return -1 and sets @code{errno} based upon the following |
| 897 | errors: |
| 898 | |
| 899 | @table @b |
| 900 | @item EINVAL |
| 901 | The sum of the @code{iov_len} values in the iov array overflowed an |
| 902 | @code{ssize_t}. |
| 903 | |
| 904 | @item EINVAL |
| 905 | The @code{iovcnt} argument was less than or equal to 0, or greater |
| 906 | than @code{IOV_MAX}. |
| 907 | |
| 908 | @end table |
| 909 | |
| 910 | @subheading DESCRIPTION: |
| 911 | |
| 912 | The @code{readv()} function is equivalent to @code{read()} |
| 913 | except as described here. The @code{readv()} function shall place |
| 914 | the input data into the @code{iovcnt} buffers specified by the |
| 915 | members of the @code{iov} array: @code{iov[0], iov[1], ..., iov[iovcnt-1]}. |
| 916 | |
| 917 | Each @code{iovec} entry specifies the base address and length of an area |
| 918 | in memory where data should be placed. The @code{readv()} function |
| 919 | always fills an area completely before proceeding to the next. |
| 920 | |
| 921 | @subheading NOTES: |
| 922 | |
| 923 | NONE |
| 924 | |
| 925 | @c |
| 926 | @c |
| 927 | @c |
| 928 | @page |
| 929 | @subsection writev - Vectored write to a file |
| 930 | |
| 931 | @findex writev |
| 932 | @cindex vectored write to a file |
| 933 | |
| 934 | @subheading CALLING SEQUENCE: |
| 935 | |
| 936 | @ifset is-C |
| 937 | @example |
| 938 | #include <sys/uio.h> |
| 939 | |
| 940 | ssize_t writev( |
| 941 | int fd, |
| 942 | const struct iovec *iov, |
| 943 | int iovcnt |
| 944 | ); |
| 945 | @end example |
| 946 | @end ifset |
| 947 | |
| 948 | @ifset is-Ada |
| 949 | @end ifset |
| 950 | |
| 951 | @subheading STATUS CODES: |
| 952 | |
| 953 | In addition to the errors detected by |
| 954 | @code{Input and Output Primitives Manager write - Write to a file, write()}, |
| 955 | this routine may return -1 and sets @code{errno} based upon the following |
| 956 | errors: |
| 957 | |
| 958 | @table @b |
| 959 | @item EINVAL |
| 960 | The sum of the @code{iov_len} values in the iov array overflowed an |
| 961 | @code{ssize_t}. |
| 962 | |
| 963 | @item EINVAL |
| 964 | The @code{iovcnt} argument was less than or equal to 0, or greater |
| 965 | than @code{IOV_MAX}. |
| 966 | |
| 967 | @end table |
| 968 | |
| 969 | @subheading DESCRIPTION: |
| 970 | |
| 971 | The @code{writev()} function is equivalent to @code{write()}, |
| 972 | except as noted here. The @code{writev()} function gathers output |
| 973 | data from the @code{iovcnt} buffers specified by the members of |
| 974 | the @code{iov array}: @code{iov[0], iov[1], ..., iov[iovcnt-1]}. |
| 975 | The @code{iovcnt} argument is valid if greater than 0 and less |
| 976 | than or equal to @code{IOV_MAX}. |
| 977 | |
| 978 | Each @code{iovec} entry specifies the base address and length of |
| 979 | an area in memory from which data should be written. The @code{writev()} |
| 980 | function always writes a complete area before proceeding to the next. |
| 981 | |
| 982 | If @code{fd} refers to a regular file and all of the @code{iov_len} |
| 983 | members in the array pointed to by @code{iov} are 0, @code{writev()} |
| 984 | returns 0 and has no other effect. For other file types, the behavior |
| 985 | is unspecified by POSIX. |
| 986 | |
| 987 | @subheading NOTES: |
| 988 | |
| 989 | NONE |
| 990 | |
| 991 | @c |
| 992 | @c |
| 993 | @c |
| 994 | @page |