Hi,

I was playing around with the language bindings mentioned in: Subject: 
[Libcg-devel] [hack] Language bindings for libcgroup

I was just trying to figure out how to call the
"cgroup_read_stats_begin()" function from python. The third argument
takes a 'void **'. How can I call this function in python?

I've posted my full test script (building on the one you posted) below.
The error I'm currently getting is:

Traceback (most recent call last):
  File "./tester.py", line 20, in <module>
    cgroup_read_stats_begin("cpu", "/cgroup/test", byref(handle), cg_stat)
TypeError: in method 'cgroup_read_stats_begin', argument 3 of type 'void **'


thanks,

-Jason


#!/usr/bin/python

from libcgroup import *
from ctypes import *


cgroup_init()
c = cgroup_new_cgroup("test")
#
# Add the correct controllers based on the mount point
#
cgroup_add_controller(c, "cpu")
cgroup_create_cgroup(c, 1)

cg = cgroup_get_controller(c, "cpu")

handle = c_void_p()
cg_stat = cgroup_stat()

cgroup_read_stats_begin("cpu", "/cgroup/test", byref(handle), cg_stat)

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to