summaryrefslogtreecommitdiff
path: root/Tests/Kernel/path-resolution-race.cpp
blob: 0abf5e088be13d3fdfe3cf3e79fe0f25a7946dcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * Copyright (c) 2018-2020, the SerenityOS developers.
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <sys/stat.h>
#include <unistd.h>

int main()
{
    if (!fork()) {
        for (;;) {
            mkdir("/tmp/x", 0666);
            rmdir("/tmp/x");
        }
    }
    for (;;) {
        chdir("/tmp/x");
    }
}