r10656: BIG merge from trunk. Features not copied over
[abartlet/samba.git/.git] / source3 / lib / tallocmsg.c
index a0987aba77d4c0b9f069fdd8701f7840fd5894c0..8f03fd66ff1888749bccb9cd26598a1d8660cb83 100644 (file)
@@ -1,6 +1,6 @@
 /* 
-   samba -- Unix SMB/Netbios implementation.
-   Copyright (C) 2001 by Martin Pool
+   samba -- Unix SMB/CIFS implementation.
+   Copyright (C) 2001, 2002 by Martin Pool
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
  * Respond to a POOL_USAGE message by sending back string form of memory
  * usage stats.
  **/
-void msg_pool_usage(int msg_type, pid_t src_pid, void *buf, size_t len)
+void msg_pool_usage(int msg_type, struct process_id src_pid,
+                   void *UNUSED(buf), size_t UNUSED(len))
 {
-       char *reply = "no memory usage info yet";
+       off_t reply;
+       fstring reply_str;
+
+       SMB_ASSERT(msg_type == MSG_REQ_POOL_USAGE);
        
        DEBUG(2,("Got POOL_USAGE\n"));
+
+       reply = talloc_total_size(NULL);
+       fstr_sprintf(reply_str, "%ld", (long)reply);
+       
        message_send_pid(src_pid, MSG_POOL_USAGE,
-                        reply, strlen(reply)+1, True);
+                        reply_str, strlen(reply_str)+1, True);
 }
 
 /**