mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-05 05:18:53 +08:00
cf2528eb7c
完善了非阻塞IO的SSL功能;将 acl/samples/ 下的示例分别移到 lib_acl 及 lib_protocol 目录下
35 lines
817 B
C++
35 lines
817 B
C++
#include "lib_acl.h"
|
|
#include <assert.h>
|
|
#include <string.h>
|
|
#include <errno.h>
|
|
#include <sys/time.h>
|
|
#include <stdio.h>
|
|
#include <sys/resource.h>
|
|
|
|
int main(void)
|
|
{
|
|
struct rlimit rlim, rlim_new;
|
|
char buf[256];
|
|
|
|
acl_chroot_uid(NULL, "zsx");
|
|
|
|
printf("curr: %s\r\n", getcwd(buf, sizeof(buf)));
|
|
|
|
if (getrlimit(RLIMIT_CORE, &rlim)==0) {
|
|
rlim_new.rlim_cur = rlim_new.rlim_max = RLIM_INFINITY;
|
|
if (setrlimit(RLIMIT_CORE, &rlim_new) != 0) {
|
|
/* failed. try raising just to the old max */
|
|
rlim_new.rlim_cur = rlim_new.rlim_max =
|
|
rlim.rlim_max;
|
|
if (setrlimit(RLIMIT_CORE, &rlim_new) != 0)
|
|
printf("set core limit error: %s\n", acl_last_serror());
|
|
else
|
|
printf("set core limit ok\n");
|
|
}
|
|
else
|
|
printf("2 set core limit ok\n");
|
|
}
|
|
assert(0);
|
|
return (0);
|
|
}
|