X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2Fnfsc%2Flibnfs-raw.h;h=a680f5ca658234f0be170a57d8e29def46ed9920;hb=6ec481d3fae973cf077d70c9cf870b425fee7112;hp=b62ea70b801bfe1729d8208c94f0773664c85dde;hpb=34edf264dc678d3df086bb76ff0d40fb28d08b60;p=deb_libnfs.git diff --git a/include/nfsc/libnfs-raw.h b/include/nfsc/libnfs-raw.h index b62ea70..a680f5c 100644 --- a/include/nfsc/libnfs-raw.h +++ b/include/nfsc/libnfs-raw.h @@ -59,6 +59,20 @@ struct nfs_fh3 *nfs_get_fh(struct nfsfh *nfsfh); */ void rpc_set_next_xid(struct rpc_context *rpc, uint32_t xid); +/* This function can be used to set the file descriptor used for + * the RPC context. It is primarily useful when emulating dup2() + * and similar or where you want full control of the filedescriptor numbers + * used by the rpc socket. + * + * ... + * oldfd = rpc_get_fd(rpc); + * dup2(oldfd, newfd); + * rpc_set_fd(rpc, newfd); + * close(oldfd); + * ... + */ +void rpc_set_fd(struct rpc_context *rpc, int fd); + #define RPC_STATUS_SUCCESS 0 #define RPC_STATUS_ERROR 1 #define RPC_STATUS_CANCEL 2