Skip to content

Commit d7555a2

Browse files
committed
Add src rules for variadic functions
1 parent d00b40e commit d7555a2

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

rules/fcntl/src.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (c) 2022-present INESC-ID.
2+
// Distributed under the MIT license that can be found in the LICENSE file.
3+
4+
#include <fcntl.h>
5+
6+
template <typename... Args>
7+
int f1(int a0, int a1, Args... args) {
8+
return fcntl(a0, a1, args...);
9+
}
10+
11+
template <typename... Args>
12+
int f2(const char *a0, int a1, Args... args) {
13+
return open(a0, a1, args...);
14+
}

rules/ioctl/src.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) 2022-present INESC-ID.
2+
// Distributed under the MIT license that can be found in the LICENSE file.
3+
4+
#include <sys/ioctl.h>
5+
6+
template <typename... Args>
7+
int f1(int a0, unsigned long a1, Args... args) {
8+
return ioctl(a0, a1, args...);
9+
}

rules/stdio/src.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,8 @@ int f19(FILE *stream, off_t offset, int whence) {
5656
}
5757

5858
FILE *f20(int fd, const char *mode) { return fdopen(fd, mode); }
59+
60+
template <typename... Args>
61+
int f21(char *a0, size_t a1, const char *a2, Args... args) {
62+
return snprintf(a0, a1, a2, args...);
63+
}

0 commit comments

Comments
 (0)