1 /* 2 * Copyright (C) 2012-2020 all contributors <cmogstored-public@yhbt.net> 3 * License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt> 4 */ iov_str(struct iovec * iov,const char * str,size_t len)5static void iov_str(struct iovec *iov, const char *str, size_t len) 6 { 7 union { const char *in; char *out; } deconst; 8 9 deconst.in = str; 10 iov->iov_base = deconst.out; 11 iov->iov_len = len; 12 } 13 14 #define IOV_STR(iov,str) iov_str((iov),(str),sizeof(str)-1) 15