Re: [PATCH] mm: add ulimit API for user

2014-01-06 Thread Michal Hocko
On Tue 31-12-13 17:13:14, Xishi Qiu wrote: > Add ulimit API for users. When memory is not enough, > user's app will receive a signal, and it can do something > in the handler. > > e.g. > #include > #include > #include > void handler(int sig) > { > char *b = malloc(10); > memset(b, '\0'

[PATCH] mm: add ulimit API for user

2013-12-31 Thread Xishi Qiu
Add ulimit API for users. When memory is not enough, user's app will receive a signal, and it can do something in the handler. e.g. #include #include #include void handler(int sig) { char *b = malloc(10); memset(b, '\0', 10); printf("catch the signal by wwy\n"); exit(1); } int