We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee52ba9 commit 9d1f06aCopy full SHA for 9d1f06a
1 file changed
tests/unit/syscall/src/clone.cpp
@@ -4,6 +4,7 @@
4
5
#include <fcntl.h>
6
#include <semaphore.h>
7
+#include <syscall.h>
8
#include <unistd.h>
9
10
constexpr int ARRAY_SIZE = 100;
@@ -60,15 +61,15 @@ TEST(SystemCallTest, TestThreadCloneProducerConsumer) {
60
61
}
62
63
TEST(SystemCallTest, TestForkParentChild) {
- auto pid = fork();
64
+ auto pid = syscall(SYS_fork);
65
EXPECT_GE(pid, 0);
66
if (pid == 0) {
67
exit(EXIT_SUCCESS);
68
69
70
71
TEST(SystemCallTest, TestThreadCloneProducerConsumerWithStat) {
- constexpr const char *PATHNAME = "test_file.txt";
72
+ constexpr const char *PATHNAME = "test_clone.txt";
73
sem = static_cast<sem_t *>(malloc(sizeof(sem_t)));
74
EXPECT_EQ(sem_init(sem, 0, 0), 0);
75
FILE *fp = fopen(PATHNAME, "w+");
0 commit comments