mailing list of musl libc
 help / color / mirror / code / Atom feed
1f59e8e619f5588fdd0a1cf3bd394729b3d0192c blob 368 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 
#include <sys/resource.h>
#include <ulimit.h>
#include <stdarg.h>

long ulimit(int cmd, ...)
{
	struct rlimit rl;
	getrlimit(RLIMIT_FSIZE, &rl);
	if (cmd == UL_SETFSIZE) {
		long val;
		va_list ap;
		va_start(ap, cmd);
		val = va_arg(ap, long);
		va_end(ap);
		rl.rlim_cur = 512ULL * val;
		if (setrlimit(RLIMIT_FSIZE, &rl)) return -1;
	}
	return rl.rlim_cur / 512;
}
debug log:

solving 1f59e8e ...
found 1f59e8e in https://git.vuxu.org/mirror/musl/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).