Changeset 601
- Timestamp:
- 05/15/07 22:58:34 (2 years ago)
- Files:
-
- trunk/src/vcd/methods/vx/vx_limstatus.c (modified) (1 diff)
- trunk/src/vcd/methods/vxdb/vxdb_vx_limit_set.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/vcd/methods/vx/vx_limstatus.c
r600 r601 30 30 int pagestobytes(int pages) { 31 31 int bytes; 32 bytes = (pages * getpagesize()) >> 10;32 bytes = (pages * getpagesize()) / 1024; 33 33 return bytes; 34 34 } trunk/src/vcd/methods/vxdb/vxdb_vx_limit_set.c
r575 r601 16 16 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 17 18 #include <unistd.h> 18 19 #include <inttypes.h> 19 20 … … 26 27 #include <lucid/scanf.h> 27 28 #include <lucid/str.h> 29 30 static 31 uint64_t bytestopages(uint64_t bytes) { 32 uint64_t pages; 33 pages = (bytes * 1024) / (uint64_t) getpagesize(); 34 return pages; 35 } 36 37 static 38 struct limtype_data { 39 char *type; 40 } LIMTYPE[] = { 41 { "RLIMIT_AS" }, 42 { "RLIMIT_MEMLOCK" }, 43 { "RLIMIT_RSS" }, 44 { "VLIMIT_ANON" }, 45 { "VLIMIT_MAPPED" }, 46 { "VLIMIT_SHMEM" }, 47 { NULL } 48 }; 28 49 29 50 /* vxdb.vx.limit.set(string name, string type, string soft, string max) */ … … 74 95 method_return_fault(env, MENOVPS); 75 96 97 for(i = 0; LIMTYPE[i].type; i++) { 98 if (str_equal(type, LIMTYPE[i].type)) { 99 soft = bytestopages(soft); 100 max = bytestopages(max); 101 } 102 } 103 76 104 rc = vxdb_exec( 77 105 "INSERT OR REPLACE INTO vx_limit (xid, type, soft, max) "
