aboutsummaryrefslogtreecommitdiff
path: root/tests/threads/regression/resources_counts.zc
blob: 66cfc91b7f9673145b27c6da15809aeebeb9d219 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
namespace;
include rt;
unchecked fn main() {
 int closed = 0;
 for (int i = 0; i < 24; i++) {
  int fd = 0;
  let context = rt.syscall(51, fn() { int value = 1; rt.syscall(44, fd, &value, 1); return 0; } as word, &fd, 0);
  int result; rt.syscall(45, fd, &result, 1); rt.syscall(52, context, 0, 0);
  closed += rt.syscall(44, fd, &result, 1) == -1;
 }
 rt.put_n(closed); rt.put_c(' '); rt.put_n(rt.syscall(55, 0, 0, 0)); rt.put_c(' ');
 rt.put_n(rt.syscall(55, 1, 0, 0)); rt.put_c(' '); rt.put_n(rt.syscall(55, 2, 0, 0)); rt.put_c(10); return 0;
}