]> git.saurik.com Git - apple/launchd.git/blame - src/ktrace.c
launchd-842.92.1.tar.gz
[apple/launchd.git] / src / ktrace.c
CommitLineData
eabd1701 1#include "ktrace.h"
ddbbfbc1
A
2
3void
4runtime_ktrace1(runtime_ktrace_code_t code)
5{
6 void *ra = __builtin_extract_return_addr(__builtin_return_address(1));
7
8 /* This syscall returns EINVAL when the trace isn't enabled. */
eabd1701 9 if (launchd_apple_internal) {
ddbbfbc1
A
10 syscall(180, code, 0, 0, 0, (long)ra);
11 }
12}
13
14void
15runtime_ktrace0(runtime_ktrace_code_t code)
16{
17 void *ra = __builtin_extract_return_addr(__builtin_return_address(0));
18
19 /* This syscall returns EINVAL when the trace isn't enabled. */
eabd1701 20 if (launchd_apple_internal) {
ddbbfbc1
A
21 syscall(180, code, 0, 0, 0, (long)ra);
22 }
23}
24
25void
26runtime_ktrace(runtime_ktrace_code_t code, long a, long b, long c)
27{
28 void *ra = __builtin_extract_return_addr(__builtin_return_address(0));
29
30 /* This syscall returns EINVAL when the trace isn't enabled. */
eabd1701 31 if (launchd_apple_internal) {
ddbbfbc1
A
32 syscall(180, code, a, b, c, (long)ra);
33 }
34}