summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
34edf26)
This is mainly needed when having to track and control the file descriptors that are used by libnfs, for example when trying to emulate dup2() ontop
of libnfs.
*/
void rpc_set_next_xid(struct rpc_context *rpc, uint32_t xid);
*/
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
#define RPC_STATUS_SUCCESS 0
#define RPC_STATUS_ERROR 1
#define RPC_STATUS_CANCEL 2
rpc_rquota1_getquota_async
rpc_rquota1_getactivequota_async
rpc_service
rpc_rquota1_getquota_async
rpc_rquota1_getactivequota_async
rpc_service
+
+void rpc_set_fd(struct rpc_context *rpc, int fd)
+{
+ assert(rpc->magic == RPC_CONTEXT_MAGIC);
+
+ rpc->fd = fd;
+}