Changeset 1214 for trunk/src/kash/miscbltin.c
- Timestamp:
- Oct 7, 2007, 10:39:58 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/miscbltin.c
r1207 r1214 33 33 */ 34 34 35 #ifdef HAVE_SYS_CDEFS_H 36 #include <sys/cdefs.h> 37 #endif 35 #if 0 38 36 #ifndef lint 39 #if 040 37 static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95"; 41 38 #else 42 39 __RCSID("$NetBSD: miscbltin.c,v 1.35 2005/03/19 14:22:50 dsl Exp $"); 43 #endif44 40 #endif /* not lint */ 41 #endif 45 42 46 43 /* … … 49 46 50 47 #include <sys/types.h> 51 #include <sys/stat.h>52 #include <sys/time.h>53 #include <sys/resource.h>54 #include <unistd.h>55 48 #include <stdlib.h> 56 49 #include <ctype.h> 57 50 #include <errno.h> 58 #ifndef _MSC_VER59 # include "mscfakes.h"60 #endif61 51 62 52 #include "shell.h" … … 68 58 #include "miscbltin.h" 69 59 #include "mystring.h" 60 #include "shinstance.h" 70 61 71 62 #undef rflag … … 359 350 { 360 351 int c; 361 rlim_t val = 0;352 shrlim_t val = 0; 362 353 enum { SOFT = 0x1, HARD = 0x2 } 363 354 how = SOFT | HARD; … … 365 356 int set, all = 0; 366 357 int optc, what; 367 s tructrlimit limit;358 shrlimit limit; 368 359 369 360 what = 'f'; … … 397 388 val = RLIM_INFINITY; 398 389 else { 399 val = ( rlim_t) 0;390 val = (shrlim_t) 0; 400 391 401 392 while ((c = *p++) >= '0' && c <= '9') 402 393 { 403 394 val = (val * 10) + (long)(c - '0'); 404 if (val < ( rlim_t) 0)395 if (val < (shrlim_t) 0) 405 396 break; 406 397 } … … 412 403 if (all) { 413 404 for (l = limits; l->name; l++) { 414 getrlimit(l->cmd, &limit);405 sh_getrlimit(psh, l->cmd, &limit); 415 406 if (how & SOFT) 416 407 val = limit.rlim_cur; … … 430 421 } 431 422 432 getrlimit(l->cmd, &limit);423 sh_getrlimit(psh, l->cmd, &limit); 433 424 if (set) { 434 425 if (how & HARD) … … 436 427 if (how & SOFT) 437 428 limit.rlim_cur = val; 438 if (s etrlimit(l->cmd, &limit) < 0)429 if (sh_setrlimit(psh, l->cmd, &limit) < 0) 439 430 error(psh, "error setting limit (%s)", strerror(errno)); 440 431 } else {
Note:
See TracChangeset
for help on using the changeset viewer.