int rpc_which_events(struct rpc_context *rpc);
int rpc_service(struct rpc_context *rpc, int revents);
char *rpc_get_error(struct rpc_context *rpc);
+int rpc_queue_length(struct rpc_context *rpc);
#define RPC_STATUS_SUCCESS 0
EXTERN int nfs_get_fd(struct nfs_context *nfs);
EXTERN int nfs_which_events(struct nfs_context *nfs);
EXTERN int nfs_service(struct nfs_context *nfs, int revents);
+EXTERN int nfs_queue_length(struct nfs_context *nfs);
/*
* Used if you need different credentials than the default for the current user.
return rpc_get_fd(nfs->rpc);
}
+int nfs_queue_length(struct nfs_context *nfs)
+{
+ return rpc_queue_length(nfs->rpc);
+}
+
int nfs_which_events(struct nfs_context *nfs)
{
return rpc_which_events(nfs->rpc);
if (revents & POLLIN) {
if (rpc_read_from_socket(rpc) != 0) {
- rpc_disconnect_requeue(rpc);
+ rpc_disconnect_requeue(rpc);
return 0;
}
}
{
return (struct sockaddr *)&rpc->udp_src;
}
+
+int rpc_queue_length(struct rpc_context *rpc)
+{
+ int i=0;
+ struct rpc_pdu *pdu;
+
+ for(pdu = rpc->outqueue; pdu; pdu = pdu->next) {
+ i++;
+ }
+ for(pdu = rpc->waitpdu; pdu; pdu = pdu->next) {
+ i++;
+ }
+ return i;
+}